mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Move most of the processing into the upload
This commit is contained in:
parent
970d3dcf66
commit
0a27d79a82
8 changed files with 107 additions and 100 deletions
|
@ -4,10 +4,9 @@ Parse metadata from images if available
|
|||
otherwise get some basic information from the file
|
||||
"""
|
||||
import os
|
||||
import logging
|
||||
|
||||
from PIL import Image
|
||||
from PIL.ExifTags import TAGS, GPSTAGS
|
||||
from PIL.ExifTags import TAGS
|
||||
|
||||
from .helpers import *
|
||||
from .mapping import *
|
||||
|
@ -72,6 +71,7 @@ class Metadata:
|
|||
}
|
||||
elif data in CAMERA_MAPPING:
|
||||
if len(CAMERA_MAPPING[data]) == 2:
|
||||
# Camera - Exif Tag name
|
||||
exif['Camera'][CAMERA_MAPPING[data][0]] = {
|
||||
'raw': encoded_exif[data],
|
||||
'formatted':
|
||||
|
|
|
@ -41,8 +41,6 @@ CAMERA_MAPPING = {
|
|||
'LightSource': ['Light Source', 'light_source'],
|
||||
'SceneCaptureType': ['Scene Capture Type', 'scene_capture_type'],
|
||||
'SceneType': ['Scene Type', 'scene_type'],
|
||||
'Rating': ['Rating', 'rating'],
|
||||
'RatingPercent': ['Rating Percent', 'rating_percent'],
|
||||
}
|
||||
SOFTWARE_MAPPING = {
|
||||
'Software': ['Software'],
|
||||
|
@ -59,4 +57,6 @@ FILE_MAPPING = {
|
|||
'XResolution': ['X-resolution'],
|
||||
'YResolution': ['Y-resolution'],
|
||||
'ResolutionUnit': ['Resolution Units', 'resolution_unit'],
|
||||
'Rating': ['Rating', 'rating'],
|
||||
'RatingPercent': ['Rating Percent', 'rating_percent'],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue