globocom/thumbor — Issue #64: watermark filter is broken
Author: dhardy92
Created: 2012-02-03 14:57:29+00:00
State: open

Hello,

It seams that the watermark() filter is broken.
It can't get a new instance of the engine because context['handler'] does not exists.

I use pil engine.

I am interested in the resolution of this bug because I try to create a "fill()" filter witch return a fit-in image with exact request size filled with chosen color.
So I need also to get a new instance of the engine to create a colored background and past the image on it.

Here is the stack trace :

ERROR:root:Uncaught exception GET /unsafe/fit-in/800x800/filters:fill(white)/github.com/globocom/thumbor/wiki/tom_before_brightness.jpg (10.147.28.20)
HTTPRequest(protocol='http', host='192.168.135.117:8887', method='GET', uri='/unsafe/fit-in/800x800/filters:fill(white)/github.com/globocom/thumbor/wiki/tom_before_brightness.jpg', version='HTTP/1.1', remote_ip='10.147.28.20', body='', headers={'Accept-Language': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'Accept-Encoding': 'gzip, deflate', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Host': '192.168.135.117:8887', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1', 'Dnt': '1', 'Connection': 'keep-alive'})
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/tornado/stack_context.py", line 209, in _nested
yield vars
File "/usr/local/lib/python2.6/dist-packages/tornado/stack_context.py", line 180, in wrapped
callback(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/thumbor/loaders/http_loader.py", line 37, in return_contents
callback(response.body)
File "/usr/local/lib/python2.6/dist-packages/thumbor/handlers/__init__.py", line 220, in handle_loader_loaded
callback(normalized, buffer)
File "/usr/local/lib/python2.6/dist-packages/thumbor/handlers/__init__.py", line 113, in callback
Transformer(self.context).transform(after_transform_cb)
File "/usr/local/lib/python2.6/dist-packages/thumbor/transformer.py", line 66, in transform
self.smart_detect()
File "/usr/local/lib/python2.6/dist-packages/thumbor/transformer.py", line 82, in smart_detect
self.after_smart_detect([])
File "/usr/local/lib/python2.6/dist-packages/thumbor/transformer.py", line 111, in after_smart_detect
self.done_callback()
File "/usr/local/lib/python2.6/dist-packages/thumbor/handlers/__init__.py", line 121, in after_transform
self.apply_filters(filters_module.create_instances(context, context.modules.filters, context.request.filters), finish_callback)
File "/usr/local/lib/python2.6/dist-packages/thumbor/handlers/__init__.py", line 141, in apply_filters
exec_one_filter()
File "/usr/local/lib/python2.6/dist-packages/thumbor/handlers/__init__.py", line 140, in exec_one_filter
f.run_filter_async(exec_one_filter)
File "/usr/local/lib/python2.6/dist-packages/thumbor/filters/fill.py", line 18, in run_filter_async
self.fill_engine = self.engine_class()
AttributeError: 'Filter' object has no attribute 'engine_class'
ERROR:root:500 GET /unsafe/fit-in/800x800/filters:fill(white)/github.com/globocom/thumbor/wiki/tom_before_brightness.jpg (10.147.28.20) 863.15ms