Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cached_property
def exif(self):
datetime_format = self.settings['datetime_format']
return (get_exif_tags(self.raw_exif, datetime_format=datetime_format)
if self.raw_exif and self.ext in ('.jpg', '.jpeg') else None)
def nozip_gallery_file(album, settings=None):
"""Filesystem based switch to disable ZIP generation for an Album"""
Album.zip = cached_property(generate_album_zip)
@cached_property
def date(self):
return (self.exif and self.exif.get('dateobj', None) or
self._get_file_date())
@cached_property
def raw_exif(self):
try:
return (get_exif_data(self.src_path)
if self.ext in ('.jpg', '.jpeg') else None)
except Exception as e:
self.logger.warning('Could not read EXIF data from %s: %s',
self.src_path, e)
@cached_property
def size(self):
return get_size(self.dst_path)
@cached_property
def thumb_size(self):
return get_size(self.thumb_path)
@cached_property
def zip(self):
"""Placeholder ZIP method.
The ZIP logic is controlled by the zip_gallery plugin
"""
return None