btubbs / thumpy

A Python web server that dynamically scales, crops, and transforms images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError quality when not in config

jaraco opened this issue · comments

In 99755d4, the save operation added support for an option, 'quality' but also required it to be supplied. To restore compatibility, let's make that config value optional.

According to the docs, the default is 75, so that's what the fallback should be, if supplied.

huh. Looking at the code, the comment and the implementation both indicate to me that the 'quality' in the defaults should suffice. So how is it we are getting a KeyError?

Ahh. It's not an issue with the lib, but an issue with our deployment of it:

filepath = os.environ.get('APP_SETTINGS_YAML')
if filepath:
    import yaml
    thumpy.config = yaml.safe_load(open(filepath))
else:
    from app_container import config
    thumpy.config = config

app = thumpy.app