After a second look it seemed that the canvas action was only properly
supported for RGB and RGBA images. Your image is CMYK. (That is why it
is good to provide an example image.) So the best way to solve it for
now is to convert your images to RGB first, instead of RGBA which will
consume a bit more memory and might be slower.

I've commited a fix in bazaar to support non RGB(A) images in the canvas
action:

$ bzr diff
=== modified file 'phatch/actions/canvas.py'
--- phatch/actions/canvas.py    2008-02-29 17:12:11 +0000
+++ phatch/actions/canvas.py    2008-07-31 10:23:22 +0000
@@ -41,7 +41,11 @@
     #mode
     if image.mode == 'RGBA':
         background_colour = HTMLColorToRGBA(background_colour,opacity)
-    new_canvas      = Image.new(image.mode,new_size,background_colour)
+    if image.mode in ['RGB','RGBA']:
+        new_canvas  = Image.new(image.mode,new_size,background_colour)
+    else:
+        new_canvas  = Image.new('RGB',new_size,background_colour)
+        new_canvas  = new_canvas.convert(image.mode)
     new_canvas.paste(image,(x,y))
     
     return new_canvas

$ bzr commit -m "fix canvas action for not RGB images"
Committing to: /home/stani/sync/python/phatch/trunk/
modified phatch/actions/canvas.py
Committed revision 540.

This fix will be included in the next release of Phatch.


** Attachment added: "fixed actionlist as temporary solution"
   
http://launchpadlibrarian.net/16450722/Resize%20to%20max%20500x500x93q-square.phatch

-- 
Only black canvas for non RGB(A) images such as CMYK
https://bugs.launchpad.net/bugs/252949
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to