New submission from Damien Baty <>:

The "repoze.bitblt" middleware accepts a "quality" parameter. However, with the 
following Paster deploy configuration:

  use = egg:MyApp#app
  filter-with = bitblt

  use = egg:repoze.bitblt#bitblt
  secret = lkjsdflkj0909KJLKJD9908
  quality = 80

I get the following traceback:

  File "/Users/damien/dev/repoze.bitblt/repoze/bitblt/", line 49, 
process, image.format.upper(), quality=self.quality)
  File "/Users/damien/env-bfg/lib/python2.5/site-packages/PIL/", line 
1405, in save
    save_handler(self, fp, filename)
  File "/Users/damien/env-bfg/lib/python2.5/site-packages/PIL/", line 409, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "/Users/damien/env-bfg/lib/python2.5/site-packages/PIL/", 
473, in _save
    e = Image._getencoder(im.mode, e, a, im.encoderconfig)
  File "/Users/damien/env-bfg/lib/python2.5/site-packages/PIL/", line 
389, in _getencoder
    return apply(encoder, (mode,) + args + extra)
  TypeError: an integer is required

As far as I know, there is no way in Paste Deploy to indicate that "quality" 
be coerced into an integer. The fix is obvious, cf. attached file.

assignedto: malthe
messages: 243
nosy: dbaty, malthe
priority: bug
status: unread
title: Unable to configure image quality in Paste Deploy for repoze.bitblt
topic: repoze.bitblt

Repoze Bugs <>
---	(révision 5653)
+++	(copie de travail)
@@ -24,7 +24,7 @@
         if secret is None:
             raise ValueError("Must configure ``secret``.")
-        self.quality = quality
+        self.quality = int(quality) = app
         self.secret = secret
         self.filter = {
Repoze-dev mailing list

Reply via email to