From ab8055b5cab2523d925f59c65bc38df103a26991 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 2 Dec 2020 15:02:12 -0500 Subject: deleted old apps and media --- app/photos/readexif.py | 78 -------------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 app/photos/readexif.py (limited to 'app/photos/readexif.py') diff --git a/app/photos/readexif.py b/app/photos/readexif.py deleted file mode 100644 index 70a6987..0000000 --- a/app/photos/readexif.py +++ /dev/null @@ -1,78 +0,0 @@ -import time -from fractions import Fraction - -from django.contrib.gis.geos import Point - -import exiftool - -from locations.models import Location - - -def readexif(image): - """ - takes an image and fills in all the exif data tracked in the image model - - """ - with exiftool.ExifTool() as et: - meta = et.get_metadata(image.image.path) - et.terminate() - image.exif_raw = meta - try: - image.title = meta["EXIF:ImageDescription"] - except: - try: - image.title = meta["XMP:Title"] - except: - pass - try: - image.caption = meta["EXIF:UserComment"] - except: - pass - try: - image.exif_lens = meta["MakerNotes:LensType"] - except: - try: - image.exif_lens = meta["XMP:Lens"] - except: - pass - try: - image.exif_aperture = meta["EXIF:FNumber"] - except: - pass - try: - image.exif_make = meta["EXIF:Make"] - except: - pass - try: - image.exif_model = meta["EXIF:Model"] - except: - pass - try: - image.exif_exposure = str(Fraction(float(meta["EXIF:ExposureTime"])).limit_denominator()) - except: - pass - try: - image.exif_iso = meta["EXIF:ISO"] - except: - pass - try: - image.exif_focal_length = meta["EXIF:FocalLength"] - except: - pass - try: - fmt_date = time.strptime(meta["EXIF:DateTimeOriginal"], "%Y:%m:%d %H:%M:%S") - except: - pass - try: - image.exif_date = time.strftime("%Y-%m-%d %H:%M:%S", fmt_date) - except: - pass - try: - image.height = meta["File:ImageHeight"] - except: - pass - try: - image.width = meta["File:ImageWidth"] - except: - pass - return image -- cgit v1.2.3-70-g09d2