Move log statement to top of method.

This commit is contained in:
voussoir 2019-04-01 23:17:01 -07:00
parent 2f33023025
commit 3aa064cde3

View file

@ -933,6 +933,9 @@ class Photo(ObjectBase):
''' '''
Load the file's height, width, etc as appropriate for this type of file. Load the file's height, width, etc as appropriate for this type of file.
''' '''
self.photodb.log.debug('Reloading metadata for %s', self)
# If the file has disappeared, this will just return None.
self.bytes = self.real_path.size self.bytes = self.real_path.size
self.width = None self.width = None
self.height = None self.height = None
@ -940,8 +943,6 @@ class Photo(ObjectBase):
self.ratio = None self.ratio = None
self.duration = None self.duration = None
self.photodb.log.debug('Reloading metadata for %s', self)
if self.simple_mimetype == 'image': if self.simple_mimetype == 'image':
try: try:
image = PIL.Image.open(self.real_path.absolute_path) image = PIL.Image.open(self.real_path.absolute_path)