kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fix OAM plugin bug, improve buttons CSS
rodzic
d9e46e252f
commit
b10fc806d5
|
@ -89,6 +89,7 @@
|
|||
.action-buttons{
|
||||
button{
|
||||
margin-right: 4px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.btn-group{
|
||||
|
|
|
@ -59,38 +59,41 @@ class Info(TaskView):
|
|||
|
||||
# Populate fields from first image in task
|
||||
img = ImageUpload.objects.filter(task=task).exclude(image__iendswith='.txt').first()
|
||||
img_path = os.path.join(settings.MEDIA_ROOT, img.path())
|
||||
im = Image.open(img_path)
|
||||
if img is not None:
|
||||
img_path = os.path.join(settings.MEDIA_ROOT, img.path())
|
||||
im = Image.open(img_path)
|
||||
|
||||
# TODO: for better data we could look over all images
|
||||
# and find actual end and start time
|
||||
# Here we're picking an image at random and assuming a one hour flight
|
||||
if not 'sensor' in task_info:
|
||||
task_info['endDate'] = datetime.utcnow().timestamp() * 1000
|
||||
task_info['sensor'] = ''
|
||||
task_info['title'] = task.name
|
||||
task_info['provider'] = get_site_settings().organization_name
|
||||
# TODO: for better data we could look over all images
|
||||
# and find actual end and start time
|
||||
# Here we're picking an image at random and assuming a one hour flight
|
||||
if not 'sensor' in task_info:
|
||||
task_info['endDate'] = datetime.utcnow().timestamp() * 1000
|
||||
task_info['sensor'] = ''
|
||||
task_info['title'] = task.name
|
||||
task_info['provider'] = get_site_settings().organization_name
|
||||
|
||||
if 'exif' in im.info:
|
||||
exif_dict = piexif.load(im.info['exif'])
|
||||
if 'Exif' in exif_dict:
|
||||
if piexif.ExifIFD.DateTimeOriginal in exif_dict['Exif']:
|
||||
try:
|
||||
parsed_date = datetime.strptime(exif_dict['Exif'][piexif.ExifIFD.DateTimeOriginal].decode('ascii'),
|
||||
'%Y:%m:%d %H:%M:%S')
|
||||
task_info['endDate'] = parsed_date.timestamp() * 1000
|
||||
except ValueError:
|
||||
# Ignore date field if we can't parse it
|
||||
pass
|
||||
if '0th' in exif_dict:
|
||||
if piexif.ImageIFD.Make in exif_dict['0th']:
|
||||
task_info['sensor'] = exif_dict['0th'][piexif.ImageIFD.Make].decode('ascii').strip(' \t\r\n\0')
|
||||
if 'exif' in im.info:
|
||||
exif_dict = piexif.load(im.info['exif'])
|
||||
if 'Exif' in exif_dict:
|
||||
if piexif.ExifIFD.DateTimeOriginal in exif_dict['Exif']:
|
||||
try:
|
||||
parsed_date = datetime.strptime(exif_dict['Exif'][piexif.ExifIFD.DateTimeOriginal].decode('ascii'),
|
||||
'%Y:%m:%d %H:%M:%S')
|
||||
task_info['endDate'] = parsed_date.timestamp() * 1000
|
||||
except ValueError:
|
||||
# Ignore date field if we can't parse it
|
||||
pass
|
||||
if '0th' in exif_dict:
|
||||
if piexif.ImageIFD.Make in exif_dict['0th']:
|
||||
task_info['sensor'] = exif_dict['0th'][piexif.ImageIFD.Make].decode('ascii').strip(' \t\r\n\0')
|
||||
|
||||
if piexif.ImageIFD.Model in exif_dict['0th']:
|
||||
task_info['sensor'] = (task_info['sensor'] + " " + exif_dict['0th'][piexif.ImageIFD.Model].decode('ascii')).strip(' \t\r\n\0')
|
||||
if piexif.ImageIFD.Model in exif_dict['0th']:
|
||||
task_info['sensor'] = (task_info['sensor'] + " " + exif_dict['0th'][piexif.ImageIFD.Model].decode('ascii')).strip(' \t\r\n\0')
|
||||
|
||||
task_info['startDate'] = task_info['endDate'] - 60 * 60 * 1000
|
||||
set_task_info(task.id, task_info)
|
||||
task_info['startDate'] = task_info['endDate'] - 60 * 60 * 1000
|
||||
set_task_info(task.id, task_info)
|
||||
else:
|
||||
task_info['noImages'] = True
|
||||
|
||||
return Response(task_info, status=status.HTTP_200_OK)
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ export default class ShareButton extends React.Component{
|
|||
|
||||
render(){
|
||||
const { loading, taskInfo, error } = this.state;
|
||||
if (taskInfo.noImages) return (<div/>);
|
||||
|
||||
const getButtonIcon = () => {
|
||||
if (loading || taskInfo.sharing) return "fa fa-circle-notch fa-spin fa-fw";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "WebODM",
|
||||
"version": "1.9.11",
|
||||
"version": "1.9.12",
|
||||
"description": "User-friendly, extendable application and API for processing aerial imagery.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
Ładowanie…
Reference in New Issue