ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> image-sig
image-sig
[Image-SIG] Re: PCX
by Fredrik Lundh other posts by this author
Aug 3 2004 5:18PM messages near this date
[Image-SIG] Re: CMYK->RGB [was Re: PCX] | [Image-SIG] Re: PCX
Greg Hamilton wrote:

>  I have a PCX image which I can't manipulate with PIL.
> 
>  The image loads without error. PIL identifies it as a mode '1' PCX file
>  and reads the image size correctly. Unfortunately the image content is
>  lost, I just get a black rectangle.

turns out that the tile member isn't properly set up for images where
the PCX xmin or xmax headers are non-zero.  here's a patch:

Index: PIL/PcxImagePlugin.py
===================================================================
--- PIL/PcxImagePlugin.py       (revision 1939)
+++ PIL/PcxImagePlugin.py       (working copy)
@@ -96,6 +96,8 @@
         self.mode = mode
         self.size = bbox[2]-bbox[0], bbox[3]-bbox[1]

+        bbox = (0, 0) + self.size
+
         self.tile = [("pcx", bbox, self.fp.tell(), (rawmode, planes * stride))]


 # --------------------------------------------------------------------



_______________________________________________
Image-SIG maillist  -  Image-SIG@[...].org
http://mail.python.org/mailman/listinfo/image-sig
Thread:
Greg Hamilton
Fredrik Lundh
Fredrik Lundh
Fredrik Lundh

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved