Skip to content

Commit

Permalink
Respect a user's right to provide no image formats via the config
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfullerton committed Jan 2, 2017
1 parent 835a468 commit 477f4a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ckanext/imageview/plugin.py
Expand Up @@ -6,7 +6,7 @@
log = logging.getLogger(__name__)
ignore_empty = p.toolkit.get_validator('ignore_empty')

DEFAULT_IMAGE_FORMATS = ['png', 'jpeg', 'jpg', 'gif']
DEFAULT_IMAGE_FORMATS = 'png jpeg jpg gif'


class ImageView(p.SingletonPlugin):
Expand All @@ -17,8 +17,7 @@ class ImageView(p.SingletonPlugin):

def update_config(self, config):
p.toolkit.add_template_directory(config, 'theme/templates')
image_formats = config.get('ckan.preview.image_formats', '').split()
self.formats = image_formats or DEFAULT_IMAGE_FORMATS
self.formats = config.get('ckan.preview.image_formats', DEFAULT_IMAGE_FORMATS).split()

def info(self):
return {'name': 'image_view',
Expand Down

0 comments on commit 477f4a0

Please sign in to comment.