Add 'enable_photo_reload_metadata' and '...generate_thumbnail'

master
voussoir 2017-03-17 14:01:39 -07:00
parent 96e530e190
commit 80a861deee
2 changed files with 8 additions and 0 deletions

View File

@ -152,6 +152,8 @@ DEFAULT_CONFIGURATION = {
'enable_new_tag': True, 'enable_new_tag': True,
'enable_new_user': True, 'enable_new_user': True,
'enable_photo_add_remove_tag': True, 'enable_photo_add_remove_tag': True,
'enable_photo_reload_metadata': True,
'enable_photo_generate_thumbnail': True,
'min_tag_name_length': 1, 'min_tag_name_length': 1,
'max_tag_name_length': 32, 'max_tag_name_length': 32,

View File

@ -528,6 +528,9 @@ class Photo(ObjectBase):
special: special:
For videos, you can provide a `timestamp` to take the thumbnail from. For videos, you can provide a `timestamp` to take the thumbnail from.
''' '''
if not self.photodb.config['enable_photo_generate_thumbnail']:
raise exceptions.FeatureDisabled('photo.generate_thumbnail')
hopeful_filepath = self.make_thumbnail_filepath() hopeful_filepath = self.make_thumbnail_filepath()
hopeful_filepath = hopeful_filepath.relative_path hopeful_filepath = hopeful_filepath.relative_path
#print(hopeful_filepath) #print(hopeful_filepath)
@ -659,6 +662,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.
''' '''
if not self.photodb.config['enable_photo_reload_metadata']:
raise exceptions.FeatureDisabled('photo.reload_metadata')
self.bytes = os.path.getsize(self.real_filepath) self.bytes = os.path.getsize(self.real_filepath)
self.width = None self.width = None
self.height = None self.height = None