From charlie at begeistert.org Mon Mar 2 20:04:46 2009 From: charlie at begeistert.org (Charlie Clark) Date: Mon, 2 Mar 2009 20:04:46 +0100 Subject: [Image-SIG] playing with CMYK images In-Reply-To: References: Message-ID: Am 27.02.2009 um 19:09 schrieb Ask Holme: > Hey list > > i have just tried using PIL to crop and resize CMYK images (with > CMYK as end result, no color mode conversion). I must say i was > surprised how awfull the result look. Even though PIL is not > supposed to touch the color mode, colors is totally fucked up in the > modified image. > > Is that because i'm doing something wrong or is the only solution > simply to switch to imagemagick if i want better CMYK support wow! As someone who normally appreciates informality on mailing lists and relishes in the triumph of the vernacular I found this a rude first post. Can you please provide some details as to what's gone so horribly wrong. I would be surprised if the problem is actually with PIL per se and not with one of the underlying C libraries. Charlie -- Charlie Clark Helmholtzstr. 20 D?sseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 From tim at timhatch.com Mon Mar 2 20:32:32 2009 From: tim at timhatch.com (Tim Hatch) Date: Mon, 2 Mar 2009 11:32:32 -0800 Subject: [Image-SIG] playing with CMYK images In-Reply-To: References: Message-ID: <70DCC813-8501-4B29-A2EF-BD8190465A2A@timhatch.com> > i have just tried using PIL to crop and resize CMYK images (with > CMYK as end result, no color mode conversion). I must say i was > surprised how awfull the result look. Even though PIL is not > supposed to touch the color mode, colors is totally fucked up in the > modified image. Can you provide an example of your image and your cropping script? The first thing that comes to mind is that there is a color profile attached to the original, and it's being stripped. Tim From d_berthelot at yahoo.com Mon Mar 2 22:14:57 2009 From: d_berthelot at yahoo.com (David Berthelot) Date: Mon, 2 Mar 2009 13:14:57 -0800 (PST) Subject: [Image-SIG] playing with CMYK images References: <70DCC813-8501-4B29-A2EF-BD8190465A2A@timhatch.com> Message-ID: <430166.97363.qm@web52108.mail.re2.yahoo.com> I ran into a similar problems with CMYK and I think it's because libjpeg doesn't interpret the CMYK data correctly (possibly stripping a color profile). This is easily verified using libjpeg standalone tools (like jpegtran that you can compile when compiling libjpeg). On the other hand, using ImageMagick python bindings (PythonMagick) worked fine (I assume ImageMagick doesn't rely on libjpeg). However it is my understanding that PythonMagick is unfortunately not fully fonctional and barely documented. ----- Original Message ---- From: Tim Hatch To: image-sig Sent: Monday, March 2, 2009 11:32:32 AM Subject: Re: [Image-SIG] playing with CMYK images > i have just tried using PIL to crop and resize CMYK images (with CMYK as end result, no color mode conversion). I must say i was surprised how awfull the result look. Even though PIL is not supposed to touch the color mode, colors is totally fucked up in the modified image. Can you provide an example of your image and your cropping script? The first thing that comes to mind is that there is a color profile attached to the original, and it's being stripped. Tim _______________________________________________ Image-SIG maillist - Image-SIG at python.org http://mail.python.org/mailman/listinfo/image-sig From jcupitt at gmail.com Mon Mar 2 23:58:04 2009 From: jcupitt at gmail.com (jcupitt at gmail.com) Date: Mon, 2 Mar 2009 22:58:04 +0000 Subject: [Image-SIG] playing with CMYK images In-Reply-To: <430166.97363.qm@web52108.mail.re2.yahoo.com> References: <70DCC813-8501-4B29-A2EF-BD8190465A2A@timhatch.com> <430166.97363.qm@web52108.mail.re2.yahoo.com> Message-ID: <522c6460903021458y10929c48sba7f89cf766a6d88@mail.gmail.com> 2009/3/2 David Berthelot : > I ran into a similar problems with CMYK and I think it's because libjpeg doesn't interpret the CMYK data correctly (possibly stripping a color profile). This is easily verified using libjpeg standalone tools (like jpegtran that you can compile when compiling libjpeg). The problem is probably that Photoshop does not follow the spec and for some reason writes CMYK JPEGs with inverted inks. Sadly there's not a (as far as I know) 100% way to spot Photoshop CMYK JPEGs. If you think you might have a P/shop CMYK JPEG, you need to do 255-r, 255-g, 255-b, 255-k after loading it. Here's a previous thread on the issue: http://aspn.activestate.com/ASPN/Mail/Message/image-sig/3110476 > On the other hand, using ImageMagick python bindings (PythonMagick) worked fine (I assume ImageMagick doesn't rely on libjpeg). IM does use libjpeg, but it guesses that if there's an Adobe app marker it should invert inks. I don't think this is foolproof though. John From kevin at cazabon.com Mon Mar 2 23:52:31 2009 From: kevin at cazabon.com (Kevin Cazabon) Date: Mon, 2 Mar 2009 17:52:31 -0500 Subject: [Image-SIG] playing with CMYK images In-Reply-To: References: Message-ID: <5DBF929E-B78D-484C-A5EB-3ABC36671F5B@cazabon.com> The jpeg plugin doesn't handle CMYK properly - I've posted patches in the past... trivial to fix. Kevin. On 02 Mar 2009, at 14:04, Charlie Clark wrote: > > Am 27.02.2009 um 19:09 schrieb Ask Holme: > >> Hey list >> >> i have just tried using PIL to crop and resize CMYK images (with >> CMYK as end result, no color mode conversion). I must say i was >> surprised how awfull the result look. Even though PIL is not >> supposed to touch the color mode, colors is totally fucked up in >> the modified image. >> >> Is that because i'm doing something wrong or is the only solution >> simply to switch to imagemagick if i want better CMYK support > > wow! As someone who normally appreciates informality on mailing > lists and relishes in the triumph of the vernacular I found this a > rude first post. > > Can you please provide some details as to what's gone so horribly > wrong. I would be surprised if the problem is actually with PIL per > se and not with one of the underlying C libraries. > > Charlie > -- > Charlie Clark > Helmholtzstr. 20 > D?sseldorf > D- 40215 > Tel: +49-211-938-5360 > GSM: +49-178-782-6226 > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From d_berthelot at yahoo.com Tue Mar 3 04:45:31 2009 From: d_berthelot at yahoo.com (David Berthelot) Date: Mon, 2 Mar 2009 19:45:31 -0800 (PST) Subject: [Image-SIG] playing with CMYK images References: <70DCC813-8501-4B29-A2EF-BD8190465A2A@timhatch.com> <430166.97363.qm@web52108.mail.re2.yahoo.com> <522c6460903021458y10929c48sba7f89cf766a6d88@mail.gmail.com> Message-ID: <874882.7370.qm@web52104.mail.re2.yahoo.com> Thanks for the explanation, I followed your link to the thread but I couldn't find the attachement you mentioned in it (because I'd like to use your patch !). Is PIL still maintained (considering the patch is 3 years old) ? Or is there a specific reason it's not included in PIL ? ----- Original Message ---- From: "jcupitt at gmail.com" Cc: image-sig Sent: Monday, March 2, 2009 2:58:04 PM Subject: Re: [Image-SIG] playing with CMYK images 2009/3/2 David Berthelot : > I ran into a similar problems with CMYK and I think it's because libjpeg doesn't interpret the CMYK data correctly (possibly stripping a color profile). This is easily verified using libjpeg standalone tools (like jpegtran that you can compile when compiling libjpeg). The problem is probably that Photoshop does not follow the spec and for some reason writes CMYK JPEGs with inverted inks. Sadly there's not a (as far as I know) 100% way to spot Photoshop CMYK JPEGs. If you think you might have a P/shop CMYK JPEG, you need to do 255-r, 255-g, 255-b, 255-k after loading it. Here's a previous thread on the issue: http://aspn.activestate.com/ASPN/Mail/Message/image-sig/3110476 > On the other hand, using ImageMagick python bindings (PythonMagick) worked fine (I assume ImageMagick doesn't rely on libjpeg). IM does use libjpeg, but it guesses that if there's an Adobe app marker it should invert inks. I don't think this is foolproof though. John _______________________________________________ Image-SIG maillist - Image-SIG at python.org http://mail.python.org/mailman/listinfo/image-sig From tim at timhatch.com Tue Mar 3 06:42:03 2009 From: tim at timhatch.com (Tim Hatch) Date: Mon, 2 Mar 2009 21:42:03 -0800 Subject: [Image-SIG] playing with CMYK images In-Reply-To: <874882.7370.qm@web52104.mail.re2.yahoo.com> References: <70DCC813-8501-4B29-A2EF-BD8190465A2A@timhatch.com> <430166.97363.qm@web52108.mail.re2.yahoo.com> <522c6460903021458y10929c48sba7f89cf766a6d88@mail.gmail.com> <874882.7370.qm@web52104.mail.re2.yahoo.com> Message-ID: <33888160-BF91-49A9-AC1B-37E557F1846B@timhatch.com> > Thanks for the explanation, I followed your link to the thread but I > couldn't find the attachement you mentioned in it (because I'd like > to use your patch !). Try http://mail.python.org/pipermail/image-sig/2006-April/003871.html instead. Tim From ask at jillion.dk Mon Mar 2 20:45:30 2009 From: ask at jillion.dk (Ask Holme) Date: Mon, 2 Mar 2009 20:45:30 +0100 Subject: [Image-SIG] playing with CMYK images In-Reply-To: References: Message-ID: Hey list I'm sorry if your guys find my post rude - it wasn't meant that way! i find PIL a great product, but when writing the post i might have been a little bit fustrated. I will post an example tomorrow, when i fetch it - i might note, that i currently have made a solution with imagemagick (running via an perl-script since i couldn't find working python bindings to magick wand) and that works flawlessly... But i would like a native python solution - i'll upload examples tomorrow. On Mon, Mar 2, 2009 at 8:04 PM, Charlie Clark wrote: > > Am 27.02.2009 um 19:09 schrieb Ask Holme: > > Hey list >> >> i have just tried using PIL to crop and resize CMYK images (with CMYK as >> end result, no color mode conversion). I must say i was surprised how awfull >> the result look. Even though PIL is not supposed to touch the color mode, >> colors is totally fucked up in the modified image. >> >> Is that because i'm doing something wrong or is the only solution simply >> to switch to imagemagick if i want better CMYK support >> > > wow! As someone who normally appreciates informality on mailing lists and > relishes in the triumph of the vernacular I found this a rude first post. > > Can you please provide some details as to what's gone so horribly wrong. I > would be surprised if the problem is actually with PIL per se and not with > one of the underlying C libraries. > > Charlie > -- > Charlie Clark > Helmholtzstr. 20 > D?sseldorf > D- 40215 > Tel: +49-211-938-5360 > GSM: +49-178-782-6226 > > > > -- Ask Holme - 28 76 98 87 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paulegan at mail.com Tue Mar 3 18:56:42 2009 From: paulegan at mail.com (Paul Egan) Date: Tue, 3 Mar 2009 09:56:42 -0800 (PST) Subject: [Image-SIG] PIL 1.1.6 and convert cmyk jpegs to rgb and writing png files References: <49AD6B49.4080401@yahoo.com> Message-ID: <934271.45593.qm@web30803.mail.mud.yahoo.com> Just in case this CMYK patch does make it into the PIL svn repo... there's a small bug: before calling invert, self.im should be checked. This is necessary because the ImageFile.Parser.feed method tries an open() to see if the image is complete. Attached is an updated patch. -------------- next part -------------- A non-text attachment was scrubbed... Name: PIL.JpegImagePlugin.diff Type: text/x-diff Size: 2154 bytes Desc: not available URL: From chris at stemcel.co.uk Wed Mar 4 14:06:12 2009 From: chris at stemcel.co.uk (Chris Adams) Date: Wed, 4 Mar 2009 13:06:12 +0000 Subject: [Image-SIG] Using PIL to merge postscript generated text and png files Message-ID: <67A4B838-D111-47B0-AA83-DA217BADFE00@stemcel.co.uk> Hi there, I'm trying to programatically generate text onto an existing png file as part of a very simple online tool for an NGO, and I'm looking at using PIL to do this. Blank badge: http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/ The copy would be pasted in goes here: http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge.png And the rollover state would be generated as well here: http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge_rollover.png However, the issue here is that I'm trying to do this with a Postscript font (not a Truetype .ttf one), which needs the PSDraw class, rather than the basic ImageFont class, and I was under the impression that it was designed for printing rather than output for the screen. I'm used to using GUI apps for design related work like this or writing html and css on the front end of websites, and I'm very new to python, but I naively assumed that doing this would be simple, and it's proving not to be the case so far. What's the best way to try doing what I'm doing? -- --- I'm currently only checking my email at 9am, midday and at 4pm. If you need a response from me urgently, please call or text my mobile, or contact me via Skype (chris.d.adams). --- Chris Adams Stemcel Studios The Hub 5 Torrens Street London EC1V 1NQ email: chris at stemcel.co.uk web: www.stemcel.co.uk twitter:chris_d_adams skype: chris.d.adams mob: 07974 368 229 tel: 0207 558 8971 From cannon.el at gmail.com Wed Mar 4 17:26:55 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Wed, 4 Mar 2009 08:26:55 -0800 Subject: [Image-SIG] Using PIL to merge postscript generated text and png files In-Reply-To: <67A4B838-D111-47B0-AA83-DA217BADFE00@stemcel.co.uk> References: <67A4B838-D111-47B0-AA83-DA217BADFE00@stemcel.co.uk> Message-ID: My best suggestion is to convert the font you need to a format that PIL can understand, either its own bitmap format or to a truetype font. Font conversion utilities exist, and you would only need to do the conversion once, and then just use the converted font. It may not be completely elegant, but it is probably the minimum amount of work. Edward On Wed, Mar 4, 2009 at 5:06 AM, Chris Adams wrote: > Hi there, > > I'm trying to programatically generate text onto an existing png file as > part of a very simple online tool for an NGO, and I'm looking at using PIL > to do this. > > Blank badge: > http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/ > > The copy ?would be pasted in goes here: > http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge.png > > And the rollover state would be generated as well here: > http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge_rollover.png > > However, the issue here is that I'm trying to do this with a Postscript font > (not a Truetype .ttf one), which needs the PSDraw class, rather than the > basic ImageFont class, and I was under the impression that it was designed > for printing rather than output for the screen. > > I'm used to using GUI apps for design related work like this or writing html > and css on the front end of websites, and I'm very new to python, but I > naively assumed that doing this would be simple, and it's proving not to be > the case so far. > > What's the best way to try doing what I'm doing? > > > > > > > -- > --- > I'm currently only checking my email at 9am, midday and at 4pm. > If you need a response from me urgently, please call or text my mobile, or > contact me via Skype (chris.d.adams). > --- > Chris Adams > Stemcel Studios > The Hub > 5 Torrens Street > London > EC1V 1NQ > > email: chris at stemcel.co.uk > web: ?www.stemcel.co.uk > twitter:chris_d_adams > skype: chris.d.adams > mob: 07974 368 229 > tel: 0207 558 8971 > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From wichert at simplon.biz Tue Mar 3 22:21:05 2009 From: wichert at simplon.biz (Wichert Akkerman) Date: Tue, 03 Mar 2009 22:21:05 +0100 Subject: [Image-SIG] OverflowError on image save Message-ID: <49AD9F41.2050604@simplon.biz> I have a small routine which tries to verify if an uploaded file is a valid image. It works like this: image_data=StringIO(data) try: pil_data=PIL.Image.open(image_data) except IOError: # PIL abuses IOError to report parsing errors raise Invalid(self.message("bad_image", state), value, state) pil_data.load() (width,height)=pil_data.size For some images I get an OverflowError on the load() call: ModulePIL.ImageFile:*155* in|load| >> self.load_prepare() ModulePIL.ImageFile:*223* in|load_prepare| >> self.im = Image.core.new(self.mode, self.size)* OverflowError: long int too large to convert to int * I can not find any information as to what the problem might be. It seems to only occur for bmp files; jpeg and png appear to work correctly. This is using PIL 1.1.6 and Python 2.5 on a Linux system. Wichert. << self.map = None self.load_prepare() # look for read/seek overrides << if not self.im or\ self.im.mode != self.mode or self.im.size != self.size: self.im = Image.core.new(self.mode, self.size) # create palette (optional) if self.mode == "P": -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsh2134 at gmail.com Wed Mar 4 01:52:39 2009 From: jsh2134 at gmail.com (Jeff Hull) Date: Tue, 3 Mar 2009 19:52:39 -0500 Subject: [Image-SIG] Image to Matrix to Image. Message-ID: <807450d00903031652s30112838sc5eb3b3ecbac6866@mail.gmail.com> I am having the same problem. I can not save this image after i edit its data. im = myimage.load() ...do stuff to im... im.save('jeff', "JPEG") Traceback (most recent call last): File "numberfinder.py", line 116, in main() File "numberfinder.py", line 97, in main imL = applyMask(imL, immask) File "numberfinder.py", line 113, in applyMask return im.save("jeff", "JPEG") AttributeError: 'PixelAccess' object has no attribute 'save' what do i convert the PixelAccess object to so that I can save it? thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cannon.el at gmail.com Thu Mar 5 17:00:05 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Thu, 5 Mar 2009 08:00:05 -0800 Subject: [Image-SIG] Using PIL to merge postscript generated text and png files In-Reply-To: <7387B742-F906-4D44-9AF7-36B50B8ACD14@stemcel.co.uk> References: <67A4B838-D111-47B0-AA83-DA217BADFE00@stemcel.co.uk> <7387B742-F906-4D44-9AF7-36B50B8ACD14@stemcel.co.uk> Message-ID: As far as I know, line wrapping in PIL has to be done automatically. You need to use the font.getsize(text) method in ImageFont it returns a (width, height) tuple for the given text. A little work will allow you to write a function to split the lines at the appropriate places (I would split the text into words with the .split() string method) and then you can draw each line individually. Edward On 3/5/09, Chris Adams wrote: > Hi Edward, thanks for the heads up! > > In the end, I used FontForge to create a Truetype font from the postscript, > and it worked pretty seamlessly - it's not quite photoshop, but it IS free > and cross platform (http://fontforge.sourceforge.net/) > > Initially, the typefaces looked nasty and pixellated when I was using an > initial png8 graphic - > instead of a full colour version. > > I resolved this case by exporting the file from photoshop as a 24bit png > instead, which took the rough edges off the fonts. > > However, I'm still stuck with the issue of having no line wrapping. > > Is this something PIL can handle as well? > > C > > > On 4 Mar 2009, at 16:26, Laura & Edward Cannon wrote: > > > > My best suggestion is to convert the font you need to a format that > > PIL can understand, either its own bitmap format or to a truetype > > font. Font conversion utilities exist, and you would only need to do > > the conversion once, and then just use the converted font. It may not > > be completely elegant, but it is probably the minimum amount of work. > > Edward > > > > On Wed, Mar 4, 2009 at 5:06 AM, Chris Adams wrote: > > > > > Hi there, > > > > > > I'm trying to programatically generate text onto an existing png file as > > > part of a very simple online tool for an NGO, and I'm looking at using > PIL > > > to do this. > > > > > > Blank badge: > > > > http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/ > > > > > > The copy would be pasted in goes here: > > > > http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge.png > > > > > > And the rollover state would be generated as well here: > > > > http://test.stemcel.co.uk/clients/org/org-widget/blank_badge/posted_copy_badge_rollover.png > > > > > > However, the issue here is that I'm trying to do this with a Postscript > font > > > (not a Truetype .ttf one), which needs the PSDraw class, rather than the > > > basic ImageFont class, and I was under the impression that it was > designed > > > for printing rather than output for the screen. > > > > > > I'm used to using GUI apps for design related work like this or writing > html > > > and css on the front end of websites, and I'm very new to python, but I > > > naively assumed that doing this would be simple, and it's proving not to > be > > > the case so far. > > > > > > What's the best way to try doing what I'm doing? > > > > > > > > > > > > > > > > > > > > > -- > > > --- > > > I'm currently only checking my email at 9am, midday and at 4pm. > > > If you need a response from me urgently, please call or text my mobile, > or > > > contact me via Skype (chris.d.adams). > > > --- > > > Chris Adams > > > Stemcel Studios > > > The Hub > > > 5 Torrens Street > > > London > > > EC1V 1NQ > > > > > > email: chris at stemcel.co.uk > > > web: www.stemcel.co.uk > > > twitter:chris_d_adams > > > skype: chris.d.adams > > > mob: 07974 368 229 > > > tel: 0207 558 8971 > > > > > > _______________________________________________ > > > Image-SIG maillist - Image-SIG at python.org > > > http://mail.python.org/mailman/listinfo/image-sig > > > > > > > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > > -- > --- > I'm currently only checking my email at 9am, midday and at 4pm. > If you need a response from me urgently, please call or text my mobile, or > contact me via Skype (chris.d.adams). > --- > Chris Adams > Stemcel Studios > The Hub > 5 Torrens Street > London > EC1V 1NQ > > email: chris at stemcel.co.uk > web: www.stemcel.co.uk > twitter:chris_d_adams > skype: chris.d.adams > mob: 07974 368 229 > tel: 0207 558 8971 > > From fredrik at pythonware.com Thu Mar 5 18:41:20 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 5 Mar 2009 18:41:20 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <49AD9F41.2050604@simplon.biz> References: <49AD9F41.2050604@simplon.biz> Message-ID: <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> Can you print the following attributes for a broken file, before calling load: pil_data.mode pil_data.size pil_data.tile 2009/3/3 Wichert Akkerman : > I have a small routine which tries to verify if an uploaded file is a valid > image. It works like this: > > image_data=StringIO(data) > try: > pil_data=PIL.Image.open(image_data) > except IOError: # PIL abuses IOError to report parsing errors > raise Invalid(self.message("bad_image", state), > value, state) > > pil_data.load() > (width,height)=pil_data.size > > For some images I get an OverflowError on the load() call: > > Module PIL.ImageFile:155 in load >>>? self.load_prepare() > Module PIL.ImageFile:223 in load_prepare >>>? self.im = Image.core.new(self.mode, self.size) > OverflowError: long int too large to convert to int > > I can not find any information as to what the problem might be. It seems to > only occur for bmp files; jpeg and png appear to work correctly. > > This is using PIL 1.1.6 and Python 2.5 on a Linux system. > > Wichert. > < > ?????????????? self.load_prepare() > > ?????????????? # look for read/seek overrides > < ????????????????? self.im.mode != self.mode or self.im.size != self.size: > ?????????????????? self.im = Image.core.new(self.mode, self.size) > ?????????????? # create palette (optional) > ?????????????? if self.mode == "P": > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From fredrik at pythonware.com Thu Mar 5 19:27:44 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 5 Mar 2009 19:27:44 +0100 Subject: [Image-SIG] Image to Matrix to Image. In-Reply-To: <807450d00903031652s30112838sc5eb3b3ecbac6866@mail.gmail.com> References: <807450d00903031652s30112838sc5eb3b3ecbac6866@mail.gmail.com> Message-ID: <368a5cd50903051027v2357842ft449d20ae987c505b@mail.gmail.com> 2009/3/4 Jeff Hull : > I am having the same problem. I can not save this image after i edit its > data. > > im = myimage.load() > > ...do stuff to im... > > im.save('jeff', "JPEG") make that myimage.save(...) the object that's returned from load is a reference to the contents of the image, not the image itself. From jorge-m-pereira at ptinovacao.pt Thu Mar 5 15:40:58 2009 From: jorge-m-pereira at ptinovacao.pt (Jorge Pereira) Date: Thu, 5 Mar 2009 14:40:58 +0000 Subject: [Image-SIG] ZLIB (PNG/ZIP) support not available Message-ID: Hi, We're trying to install PIL 1.1.6 on a RHEL 4Up4 x64, but we are having some difficulties. Although zlib RHEL's rpms are installed (zlib-1.2.1.2-1.2.i386 and zlib-1.2.1.2-1.2.x86_64), when executing "python setup.py build_ext -I", we keep getting the message saying that ZLIB (PNG/ZIP) support is not available. Same happens with FREETYPE and JPEG. Can you hel? Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tim.Swan at disney.com Thu Mar 5 19:23:57 2009 From: Tim.Swan at disney.com (Swan, Tim) Date: Thu, 5 Mar 2009 18:23:57 +0000 Subject: [Image-SIG] PIL 1.1.6, python 64bit on Windows XP x64 Message-ID: <918738C226E29C488423AC1B6D203D2201B248FF@SM-GBLO-VXM31A.emea.wdpr.disney.com> Hi, I've been trying to get PIL 1.1.6 working on python 64bit: Python version : 2.5.2 (r252:60911, Feb 21 2008, 13:17:27) [MSC v.1400 64 bit (AMD64)] OS : Windows XP Professional x64 SP2. The installer on the main download page appears to only be valid for 32bit python, causing a variety of import errors when used with 64bit python. Is there any plan to provide an installer for 64bit versions of python on 64 bit Windows in the future? I've sucessfully built a version locally with DevStudio 2005, including zlib and jpeg-6b support. I'll detail the steps required later for posterity, it may be useful for someone browsing this forum at a later time - I have no plans to provide an installer myself! I did have to work around an issue, which I thought was worth raising to you folks, in case there was a better way to fix this. After building locally (setup.py build, setup.py install) and importing PIL.Image, the quick test detailed below caused my python process to crash. Import PIL.Image Im = PIL.Image.open('my_image.gif') Im2 = im.rotate(45) Im2.save() At the point of saving, the process crashes with a windows IO exception. Digging into the python, and then into the C extension code, I found the problem appears to be due to some conflict with using the file descriptor that's being passed into _encode_to_file (encode.c) from _save in ImageFile.py (line 492 in ImageFile.py in the source I'm looking at). After trying various different things, I found that I could not use the file descriptor int (acquired via fp.fileno(), line 469 in ImageFile.py) passed into encode_to_file - trying to write to a file using that file descriptor was causing the crash (for example, line 164 in encode.c). I tried using _rdinfo to convert the file descriptor to a FILE pointer, and work with that, but that crashed in _rdinfo, and I tried a couple of different conversions using calls like _get_osfhandle , but pretty much everything I tried continued to cause crashes. My knowledge of Windows is pretty minimal, so I've no idea why using that file descriptor should be problematic (and, presumably, works just fine with the 32bit python version). After taking a step back, I realised that the code in ImageFile has two paths, and by putting a forced call to raise an AttributeError around line 469 caused the _save function to take the top code path, and this works just fine for me. I ended up modifying the code to look like this: Line 467, ImageFile.py try: # FIXME: force an AttributeError exception to use the python file-compatible object path raise AttributeError fh = fp.fileno() fp.flush() except AttributeError: ... It's not clean, but it appears to work. Anyone got any ideas why? Can someone suggest a cleaner way of doing this? If anyone is interested, here's the steps I followed to get PIL 1.1.6 working locally for me - DevStudio 2005 required. Step 1: unarchive the source to a location locally, I'll refer to this as the build root directory (in my case, c:\temp\Imaging-1.1.6) Step 2: run the visual studio 2005 command prompt for the relevant bits of the OS (in my case from Windows start menu: Programs -> (somewhere) -> Microsoft Visual Studio 2005 -> Visual Studio Tools -> Visual Studio 2005 x64 Win64 Command Prompt http://docs.python.org/dist/module-distutils.msvccompiler.html Step 3: set up the following environment variables at the command prompt set DISTUTILS_USE_SDK=1 set MSSdk=1 Step 4: edit ImageFile.py as described above Step 5: (optional) edit setup.py to point to the correct locations for zlib, jpeg-6b, etc. source and built libs Step 6 : build PIL using "setup.py build" in the build root directory. (it's worth at this point confirming that you're running setup.py with the correct (64bit) version of python - slap a pdb break in there and check sys.version if needed) Step 7 : embed the manifests for the two DLLS by running mt.exe in the build root directory: Mt.exe -manifest build\lib.win32-2.5_imaging.pyd.manifest -outputresource:build\lib.win32-2.5_imaging.pyd;2 Mt.exe -manifest build\lib.win32-2.5_imagingmath.pyd.manifest -outputresource:build\lib.win32-2.5_imagingmath.pyd;2 http://msdn.microsoft.com/en-us/library/ms235591(VS.80).aspx Step 8: install PIL (setup.py install) -------------- next part -------------- An HTML attachment was scrubbed... URL: From karsten.hiddemann at mathematik.uni-dortmund.de Thu Mar 5 21:49:54 2009 From: karsten.hiddemann at mathematik.uni-dortmund.de (Karsten Hiddemann) Date: Thu, 05 Mar 2009 21:49:54 +0100 Subject: [Image-SIG] ZLIB (PNG/ZIP) support not available In-Reply-To: References: Message-ID: <49B03AF2.5040700@mathematik.uni-dortmund.de> Jorge Pereira schrieb: > We?re trying to install PIL 1.1.6 on a RHEL 4Up4 x64, but we are having > some difficulties. > > Although zlib RHEL?s rpms are installed (zlib-1.2.1.2-1.2.i386 and > zlib-1.2.1.2-1.2.x86_64), when executing ?python setup.py build_ext ?I?, > we keep getting the message saying that ZLIB (PNG/ZIP) support is not > available. Same happens with FREETYPE and JPEG. Same answer as for the other people with these kinds of problems: Install the development packages of the libs which include the sources. Cheers, Karsten From fredrik at pythonware.com Thu Mar 5 22:04:38 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 5 Mar 2009 22:04:38 +0100 Subject: [Image-SIG] ZLIB (PNG/ZIP) support not available In-Reply-To: References: Message-ID: <368a5cd50903051304n5d00195fn29d27cadc3d5b8c6@mail.gmail.com> I'm not up to date with RHEL packaging, but judging from e.g. http://rpm.pbone.net/index.php3/stat/4/idpl/5602905/com/zlib-1.2.1.2-1.2.x86_64.rpm.html the packages you have are runtime libraries, not development packages (i.e. header files and link libraries are missing). Look for packages with -dev or -devel in their names. Or look for a python-imaging package from RedHat; I'm pretty sure you can find prebuilt packages for all major Linuxes these days. Cheers /F 2009/3/5 Jorge Pereira : > Hi, > > We?re trying to install PIL 1.1.6 on a RHEL 4Up4 x64, but we are having some > difficulties. > > Although zlib RHEL?s rpms are installed (zlib-1.2.1.2-1.2.i386 and > zlib-1.2.1.2-1.2.x86_64), when executing ?python setup.py build_ext ?I?, we > keep getting the message saying that ZLIB (PNG/ZIP) support is not > available. Same happens with FREETYPE and JPEG. > > Can you hel? > > > > Best regards > > > > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From tim at timhatch.com Thu Mar 5 22:03:24 2009 From: tim at timhatch.com (Tim Hatch) Date: Thu, 5 Mar 2009 13:03:24 -0800 Subject: [Image-SIG] ZLIB (PNG/ZIP) support not available In-Reply-To: References: Message-ID: <699AF96D-0185-49FD-8310-49534C956688@timhatch.com> > Although zlib RHEL?s rpms are installed (zlib-1.2.1.2-1.2.i386 and > zlib-1.2.1.2-1.2.x86_64)... Make sure you have the dev versions of those packages as well, namely zlib-devel, freetype-devel, etc. Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Thu Mar 5 22:09:42 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 5 Mar 2009 22:09:42 +0100 Subject: [Image-SIG] PIL 1.1.6, python 64bit on Windows XP x64 In-Reply-To: <918738C226E29C488423AC1B6D203D2201B248FF@SM-GBLO-VXM31A.emea.wdpr.disney.com> References: <918738C226E29C488423AC1B6D203D2201B248FF@SM-GBLO-VXM31A.emea.wdpr.disney.com> Message-ID: <368a5cd50903051309t4530ac7cr772a9d40f7cfbd53@mail.gmail.com> Thanks for the howto. Now I just need to go find myself a 64-bit box to play with ;-) As for the file descriptor crashes, things like that is usually caused by a mismatch between the C runtime libraries used for core Python and the extension (the file handle is allocated by the Python main process, but used by code in the extension. If the internal structs don't match, all sort of oddities can happen). You can use e.g. dumpbin /imports on the python DLL and the PIL PYD's, and verify that they're not importing differenct MSVC-something DLL:s. 2009/3/5 Swan, Tim : > > Hi, > > I've been trying to get PIL 1.1.6 working on python 64bit: > Python version : 2.5.2 (r252:60911, Feb 21 2008, 13:17:27) [MSC v.1400 64 > bit (AMD64)] > OS : Windows XP Professional x64 SP2. > > The installer on the main download page appears to only be valid for 32bit > python, causing a variety of import errors when used with 64bit python. > > Is there any plan to provide an installer for 64bit versions of python on 64 > bit Windows in the future? > > I've sucessfully built a version locally with DevStudio 2005, including zlib > and jpeg-6b support. I'll detail the steps required later for posterity, it > may be useful for someone browsing this forum at a later time - I have no > plans to provide an installer myself! > > ?I did have to work around an issue, which I thought was worth raising to > you folks, in case there was a better way to fix this. > > After building locally (setup.py build, setup.py install) and importing > PIL.Image, the quick test detailed below caused my python process to crash. > > Import PIL.Image > Im = PIL.Image.open('my_image.gif') > Im2 = im.rotate(45) > Im2.save() > > At the point of saving, the process crashes with a windows IO exception. > Digging into the python, and then into the C extension code, I found the > problem appears to be due to some conflict with using the file descriptor > that's being passed into _encode_to_file (encode.c) from _save in > ImageFile.py (line 492 in ImageFile.py in the source I'm looking at). After > trying various different things, I found that I could not use the file > descriptor int (acquired via fp.fileno(), line 469 in ImageFile.py) passed > into encode_to_file - trying to write to a file using that file descriptor > was causing the crash (for example, line 164 in encode.c). I tried using > _rdinfo to convert the file descriptor to a FILE pointer, and work with > that, but that crashed in _rdinfo, and I tried a couple of different > conversions using calls like _get_osfhandle > > , but pretty much everything I tried continued to cause crashes. My > knowledge of Windows is pretty minimal, so I've no idea why using that file > descriptor should be problematic (and, presumably, works just fine with the > 32bit python version). > > After taking a step back, I realised that the code in ImageFile has two > paths, and by putting a forced call to raise an AttributeError around line > 469 caused the _save function to take the top code path, and this works just > fine for me. I ended up modifying the code to look like this: > > Line 467, ImageFile.py > ??? try: > ??????? # FIXME: force an AttributeError exception to use the python > file-compatible object path > ??????? raise AttributeError > ??????? fh = fp.fileno() > ??????? fp.flush() > ??? except AttributeError: > ??????? ... > > It's not clean, but it appears to work. Anyone got any ideas why? Can > someone suggest a cleaner way of doing this? > > > If anyone is interested, here's the steps I followed to get PIL 1.1.6 > working locally for me - DevStudio 2005 required. > > Step 1: unarchive the source to a location locally, I'll refer to this as > the build root directory (in my case, c:\temp\Imaging-1.1.6) > > Step 2: run the visual studio 2005 command prompt for the relevant bits of > the OS > (in my case from Windows start menu: Programs -> (somewhere) -> Microsoft > Visual Studio 2005 -> Visual Studio Tools -> Visual Studio 2005 x64 Win64 > Command Prompt > > http://docs.python.org/dist/module-distutils.msvccompiler.html > > Step 3: set up the following environment variables at the command prompt > set DISTUTILS_USE_SDK=1 > set MSSdk=1 > > Step 4: edit ImageFile.py as described above > > Step 5: (optional) edit setup.py to point to the correct locations for zlib, > jpeg-6b, etc. source and built libs > > Step 6 : build PIL using "setup.py build" in the build root directory. > (it's worth at this point confirming that you're running setup.py with the > correct (64bit) version of python - slap a pdb break in there and check > sys.version if needed) > > Step 7 : embed the manifests for the two DLLS by running mt.exe in the build > root directory: > Mt.exe -manifest build\lib.win32-2.5_imaging.pyd.manifest > -outputresource:build\lib.win32-2.5_imaging.pyd;2 > Mt.exe -manifest build\lib.win32-2.5_imagingmath.pyd.manifest > -outputresource:build\lib.win32-2.5_imagingmath.pyd;2 > http://msdn.microsoft.com/en-us/library/ms235591(VS.80).aspx > > Step 8: install PIL (setup.py install) > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From wichert at simplon.biz Fri Mar 6 14:50:11 2009 From: wichert at simplon.biz (Wichert Akkerman) Date: Fri, 06 Mar 2009 14:50:11 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> Message-ID: <49B12A13.2080406@simplon.biz> The first image: >>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont.bmp")) >>> i >>> i.mode 'RGB' >>> i.size (290, 4294967075L) >>> i.tile [('raw', (0, 0, 290, 4294967075L), 54, ('BGR', 872, -1))] and the second image: >>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont2.bmp")) >>> i.mode 'RGB' >>> i.size (288, 4294967078L) >>> i.tile [('raw', (0, 0, 288, 4294967078L), 54, ('BGR', 864, -1))] Regards, Wichert. On 3/5/09 6:41 PM, Fredrik Lundh wrote: > Can you print the following attributes for a broken file, before calling load: > > pil_data.mode > pil_data.size > pil_data.tile > > > > 2009/3/3 Wichert Akkerman: > >> I have a small routine which tries to verify if an uploaded file is a valid >> image. It works like this: >> >> image_data=StringIO(data) >> try: >> pil_data=PIL.Image.open(image_data) >> except IOError: # PIL abuses IOError to report parsing errors >> raise Invalid(self.message("bad_image", state), >> value, state) >> >> pil_data.load() >> (width,height)=pil_data.size >> >> For some images I get an OverflowError on the load() call: >> >> Module PIL.ImageFile:155 in load >> >>>> self.load_prepare() >>>> >> Module PIL.ImageFile:223 in load_prepare >> >>>> self.im = Image.core.new(self.mode, self.size) >>>> >> OverflowError: long int too large to convert to int >> >> I can not find any information as to what the problem might be. It seems to >> only occur for bmp files; jpeg and png appear to work correctly. >> >> This is using PIL 1.1.6 and Python 2.5 on a Linux system. >> >> Wichert. >> << self.map = None >> >> self.load_prepare() >> >> # look for read/seek overrides >> << if not self.im or\ >> self.im.mode != self.mode or self.im.size != self.size: >> self.im = Image.core.new(self.mode, self.size) >> # create palette (optional) >> if self.mode == "P": >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> >> >> From fredrik at pythonware.com Fri Mar 6 17:43:46 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 17:43:46 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> <49B12A13.2080406@simplon.biz> <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> Message-ID: <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> Does anyone have a (preferrably) small example, or a simple way to create a broken file on a stock Windows XP machine? An URL or an off-list mail works fine. On Fri, Mar 6, 2009 at 4:52 PM, Howard Lightstone wrote: > This LOOKS like a bug in Windows XP which creates .BMP files via DirectX > with an incorrect bitmap header size (54 vice 40).? Changing the 54 to 40 > makes the file readable again.? Most utilities seem to ignore this but > Windows itself won't be able to 'read' it as a .BMP file. > > (using XP SP2 and DirectX 9.0c ... I haven't tried this on Vista yet) > > On Fri, Mar 6, 2009 at 5:50 AM, Wichert Akkerman > wrote: >> >> The first image: >> >> >>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont.bmp")) >> >>> i >> >> >>> i.mode >> 'RGB' >> >>> i.size >> (290, 4294967075L) >> >>> i.tile >> [('raw', (0, 0, 290, 4294967075L), 54, ('BGR', 872, -1))] >> >> and the second image: >> >> >>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont2.bmp")) >> >>> i.mode >> 'RGB' >> >>> i.size >> (288, 4294967078L) >> >>> i.tile >> [('raw', (0, 0, 288, 4294967078L), 54, ('BGR', 864, -1))] >> >> >> Regards, >> Wichert. >> >> On 3/5/09 6:41 PM, Fredrik Lundh wrote: >>> >>> Can you print the following attributes for a broken file, before calling >>> load: >>> >>> ? ? pil_data.mode >>> ? ? pil_data.size >>> ? ? pil_data.tile >>> >>> >>> >>> 2009/3/3 Wichert Akkerman: >>> >>>> >>>> I have a small routine which tries to verify if an uploaded file is a >>>> valid >>>> image. It works like this: >>>> >>>> ? ? ? ? image_data=StringIO(data) >>>> ? ? ? ? try: >>>> ? ? ? ? ? ? pil_data=PIL.Image.open(image_data) >>>> ? ? ? ? except IOError: # PIL abuses IOError to report parsing errors >>>> ? ? ? ? ? ? raise Invalid(self.message("bad_image", state), >>>> ? ? ? ? ? ? ? ? ? ? value, state) >>>> >>>> ? ? ? ? pil_data.load() >>>> ? ? ? ? (width,height)=pil_data.size >>>> >>>> For some images I get an OverflowError on the load() call: >>>> >>>> Module PIL.ImageFile:155 in load >>>> >>>>>> >>>>>> ? self.load_prepare() >>>>>> >>>> >>>> Module PIL.ImageFile:223 in load_prepare >>>> >>>>>> >>>>>> ? self.im = Image.core.new(self.mode, self.size) >>>>>> >>>> >>>> OverflowError: long int too large to convert to int >>>> >>>> I can not find any information as to what the problem might be. It seems >>>> to >>>> only occur for bmp files; jpeg and png appear to work correctly. >>>> >>>> This is using PIL 1.1.6 and Python 2.5 on a Linux system. >>>> >>>> Wichert. >>>> << ? ? ? ? ? ? ? ? ? ? ? self.map = None >>>> >>>> ? ? ? ? ? ? ? ?self.load_prepare() >>>> >>>> ? ? ? ? ? ? ? ?# look for read/seek overrides >>>> << ? ? ? ? ? if not self.im or\ >>>> ? ? ? ? ? ? ? ? ? self.im.mode != self.mode or self.im.size != >>>> self.size: >>>> ? ? ? ? ? ? ? ? ? ?self.im = Image.core.new(self.mode, self.size) >>>> ? ? ? ? ? ? ? ?# create palette (optional) >>>> ? ? ? ? ? ? ? ?if self.mode == "P": >>>> _______________________________________________ >>>> Image-SIG maillist ?- ?Image-SIG at python.org >>>> http://mail.python.org/mailman/listinfo/image-sig >>>> >>>> >>>> >> >> _______________________________________________ >> Image-SIG maillist ?- ?Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> > > > > -- > Howard Lightstone > hlightstone at gmail.com > howard at eegsoftware.com > From howard at eegsoftware.com Fri Mar 6 16:52:57 2009 From: howard at eegsoftware.com (Howard Lightstone) Date: Fri, 6 Mar 2009 07:52:57 -0800 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <49B12A13.2080406@simplon.biz> References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> <49B12A13.2080406@simplon.biz> Message-ID: <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> This LOOKS like a bug in Windows XP which creates .BMP files via DirectX with an incorrect bitmap header size (54 vice 40). Changing the 54 to 40 makes the file readable again. Most utilities seem to ignore this but Windows itself won't be able to 'read' it as a .BMP file. (using XP SP2 and DirectX 9.0c ... I haven't tried this on Vista yet) On Fri, Mar 6, 2009 at 5:50 AM, Wichert Akkerman wrote: > The first image: > > >>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont.bmp")) > >>> i > > >>> i.mode > 'RGB' > >>> i.size > (290, 4294967075L) > >>> i.tile > [('raw', (0, 0, 290, 4294967075L), 54, ('BGR', 872, -1))] > > and the second image: > > >>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont2.bmp")) > >>> i.mode > 'RGB' > >>> i.size > (288, 4294967078L) > >>> i.tile > [('raw', (0, 0, 288, 4294967078L), 54, ('BGR', 864, -1))] > > > Regards, > Wichert. > > > On 3/5/09 6:41 PM, Fredrik Lundh wrote: > >> Can you print the following attributes for a broken file, before calling >> load: >> >> pil_data.mode >> pil_data.size >> pil_data.tile >> >> >> >> 2009/3/3 Wichert Akkerman: >> >> >>> I have a small routine which tries to verify if an uploaded file is a >>> valid >>> image. It works like this: >>> >>> image_data=StringIO(data) >>> try: >>> pil_data=PIL.Image.open(image_data) >>> except IOError: # PIL abuses IOError to report parsing errors >>> raise Invalid(self.message("bad_image", state), >>> value, state) >>> >>> pil_data.load() >>> (width,height)=pil_data.size >>> >>> For some images I get an OverflowError on the load() call: >>> >>> Module PIL.ImageFile:155 in load >>> >>> >>>> self.load_prepare() >>>>> >>>>> >>>> Module PIL.ImageFile:223 in load_prepare >>> >>> >>>> self.im = Image.core.new(self.mode, self.size) >>>>> >>>>> >>>> OverflowError: long int too large to convert to int >>> >>> I can not find any information as to what the problem might be. It seems >>> to >>> only occur for bmp files; jpeg and png appear to work correctly. >>> >>> This is using PIL 1.1.6 and Python 2.5 on a Linux system. >>> >>> Wichert. >>> << self.map = None >>> >>> self.load_prepare() >>> >>> # look for read/seek overrides >>> << if not self.im or\ >>> self.im.mode != self.mode or self.im.size != self.size: >>> self.im = Image.core.new(self.mode, self.size) >>> # create palette (optional) >>> if self.mode == "P": >>> _______________________________________________ >>> Image-SIG maillist - Image-SIG at python.org >>> http://mail.python.org/mailman/listinfo/image-sig >>> >>> >>> >>> >> > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -- Howard Lightstone hlightstone at gmail.com howard at eegsoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Fri Mar 6 18:35:44 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 18:35:44 +0100 Subject: [Image-SIG] towards 1.1.7 (code name "raclette") Message-ID: <368a5cd50903060935x2b4a269cy816feb2cae06a2e4@mail.gmail.com> Looks like some people out there have noticed this little page: http://bitbucket.org/effbot/pil-2009-raclette/overview/ so I might as well announce it to the list - it's finally time for the 1.1.7 "patch catchup" I mentioned last year. The plan is simple: pick must-have/low-hanging/obviously-correct fixes and patches, add them all on top of 1.1.6, and cut a new 1.1.7 release. No big overhauls, no CADT-style rewrites, just plain old boring software maintenance. The plan is to collect patches/fixes over the next few weeks, and cut an alpha before the end of the month. Here's what you can do: 1. Go to the above page and look for your favourite patches. If it's there, you don't need to do anything now - just keep an eye on this list and help us with testing when this thing goes alpha. 2. If the patch or fix isn't there, you can: a) followup on this list - either post a patch or a pointer to a patch if you have it, or describe the problem. b) add it to the issue tracker on that site. c) grab a source snapshot (use the 'download >>' feature) and prepare a patch; submit it using approach (a) or (b). d) or, if you're a Mercurial user, clone the repository and work on a patch, and either submit it as as above, send me a pull request, or send me a patchbomb (if you don't know what that is, please don't ;-). e) for sensitive or bulky stuff (e.g. if the test data needed to trigger the bug cannot be posted in public), feel free to contact me off-list. As usual, I reserve the right to reject/postpone patches that are too big or complicated or risk breaking old code. I also reserve the right to remove the above repository when this catchup is done; the final version will be released through the usual channels. Cheers /F From fredrik at pythonware.com Fri Mar 6 18:40:28 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 18:40:28 +0100 Subject: [Image-SIG] towards 1.1.7 (code name "raclette") In-Reply-To: <368a5cd50903060935x2b4a269cy816feb2cae06a2e4@mail.gmail.com> References: <368a5cd50903060935x2b4a269cy816feb2cae06a2e4@mail.gmail.com> Message-ID: <368a5cd50903060940ha2e9d53wa035db32330419c0@mail.gmail.com> > so I might as well announce it to the list - it's finally time for the > 1.1.7 "patch catchup" I mentioned last year. (and many thanks to Tim Hatch who happened to nag me about this at a point where I had some cycles to spare and happened to be tinkering with Mercurial for another reason) From karsten.hiddemann at mathematik.uni-dortmund.de Fri Mar 6 18:33:36 2009 From: karsten.hiddemann at mathematik.uni-dortmund.de (Karsten Hiddemann) Date: Fri, 06 Mar 2009 18:33:36 +0100 Subject: [Image-SIG] towards 1.1.7 (code name "raclette") In-Reply-To: <368a5cd50903060940ha2e9d53wa035db32330419c0@mail.gmail.com> References: <368a5cd50903060935x2b4a269cy816feb2cae06a2e4@mail.gmail.com> <368a5cd50903060940ha2e9d53wa035db32330419c0@mail.gmail.com> Message-ID: <49B15E70.9020009@mathematik.uni-dortmund.de> Fredrik Lundh schrieb: >> so I might as well announce it to the list - it's finally time for the >> 1.1.7 "patch catchup" I mentioned last year. Ah, wonderful. > (and many thanks to Tim Hatch who happened to nag me about this at a > point where I had some cycles to spare and happened to be tinkering > with Mercurial for another reason) I'd be nagging you constantly, but I was fearing that this might have had the opposite effect. ;) Cheers, Karsten From fredrik at pythonware.com Fri Mar 6 19:52:42 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 19:52:42 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> <49B12A13.2080406@simplon.biz> <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> Message-ID: <368a5cd50903061052m47a33e63s65f01eccdc4fe0cb@mail.gmail.com> Ok, a patch for this issue can be found here: http://bitbucket.org/effbot/pil-2009-raclette/changeset/53b7aa435b9c/ (you can also grab the updated files via that page) Thanks to Wichert, who reported the problem and provided overflowing samples. On Fri, Mar 6, 2009 at 5:43 PM, Fredrik Lundh wrote: > Does anyone have a (preferrably) small example, or a simple way to > create a broken file on a stock Windows XP machine? ?An URL or an > off-list mail works fine. > > From tim at timhatch.com Fri Mar 6 21:49:08 2009 From: tim at timhatch.com (Tim Hatch) Date: Fri, 6 Mar 2009 12:49:08 -0800 Subject: [Image-SIG] PIL and embedded ICC profiles Message-ID: <576DA127-C143-4299-B9C6-E8EA0D3A1C7C@timhatch.com> Hiya, This patch came through last year but it didn't get much review. I was wondering if it's a candidate for PIL 1.1.7 ? I've tested that it does indeed pass through profiles in jpeg-to-jpeg and jpeg-to-png conversion. http://mail.python.org/pipermail/image-sig/2008-June/005026.html There's a version at http://timhatch.com/ex/2009/03/pil-keep-icc-profiles.diff that applies cleanly on raclette edc72df13132 with some whitespace cleanups. I took out most of the unrelated patches, since they'd either been fixed already, or (in the case of TIFF resolution information) I'm not familiar with the code and it didn't apply cleanly. I suppose that's a separate topic, and I'm missing a pointer to the original issue. Tim From fredrik at pythonware.com Fri Mar 6 21:49:45 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 21:49:45 +0100 Subject: [Image-SIG] [raclette] help wanted - anyone has a recent photoshop within reach and a few minutes to spare? Message-ID: <368a5cd50903061249h243d3b57qbc2a9998da6c7b9b@mail.gmail.com> I'm have a lingering feeling that someone have helped me with this before, but I cannot find the mails/files, so here we go again: I need a small (e.g. 100x100) sample CMYK JPEG from Photoshop - that is, the kind of file that keeps causing trouble for people on this list from time to time. To make it easy for me to work with this file, do something like this: 1. create a small CMYK image, and fill it with solid black or solid white 2. pick a nice font and draw the text "RED" in big red letters 3. put a small red object in the upper left corner (make sure the corner pixel and at least a few pixels around it are red) 4. save as JPEG. 5. convert to RGB, and save another JPEG copy of the same image. 6. mail both images to me and/or the list Thanks /F From fredrik at pythonware.com Fri Mar 6 21:58:32 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 21:58:32 +0100 Subject: [Image-SIG] PIL and embedded ICC profiles In-Reply-To: <576DA127-C143-4299-B9C6-E8EA0D3A1C7C@timhatch.com> References: <576DA127-C143-4299-B9C6-E8EA0D3A1C7C@timhatch.com> Message-ID: <368a5cd50903061258k283ddc55jd95e3da2055a6653@mail.gmail.com> Except for the JPEG hack, Florian's original patch looks pretty quite clean to me. And I'm pretty sure I can do something about the hack before we go alpha. That diff link looks a bit strange to me, though - looks more like status output than diff output. Am I missing something, or did you post the wrong file? I could pull the patch from your Hg repository if that's easier for you. On Fri, Mar 6, 2009 at 9:49 PM, Tim Hatch wrote: > Hiya, > > This patch came through last year but it didn't get much review. ?I was > wondering if it's a candidate for PIL 1.1.7 ? I've tested that it does > indeed pass through profiles in jpeg-to-jpeg and jpeg-to-png conversion. > > http://mail.python.org/pipermail/image-sig/2008-June/005026.html > > There's a version at > http://timhatch.com/ex/2009/03/pil-keep-icc-profiles.diff?that applies > cleanly on raclette edc72df13132 with some whitespace cleanups. ?I took out > most of the unrelated patches, since they'd either been fixed already, or > (in the case of TIFF resolution information) I'm not familiar with the code > and it didn't apply cleanly. ?I suppose that's a separate topic, and I'm > missing a pointer to the original issue. > > Tim > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From fredrik at pythonware.com Fri Mar 6 22:11:20 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 22:11:20 +0100 Subject: [Image-SIG] [raclette] help wanted - anyone has a recent photoshop within reach and a few minutes to spare? In-Reply-To: <368a5cd50903061249h243d3b57qbc2a9998da6c7b9b@mail.gmail.com> References: <368a5cd50903061249h243d3b57qbc2a9998da6c7b9b@mail.gmail.com> Message-ID: <368a5cd50903061311p3d51a2adh948a8012439af08f@mail.gmail.com> Problem solved! Roughly half of the display tools I have on my machine displays it as blue on gray, and the rest as red on black. This is going to be rather interesting ;-) On Fri, Mar 6, 2009 at 9:49 PM, Fredrik Lundh wrote: > I'm have a lingering feeling that someone have helped me with this > before, but I cannot find the mails/files, so here we go again: > > I need a small (e.g. 100x100) sample CMYK JPEG from Photoshop - that > is, the kind of file that keeps causing trouble for people on this > list from time to time. ?To make it easy for me to work with this > file, do something like this: > > 1. create a small CMYK image, and fill it with solid black or solid white > 2. pick a nice font and draw the text "RED" in big red letters > 3. put a small red object in the upper left corner (make sure the > corner pixel and at least a few pixels around it are red) > 4. save as JPEG. > 5. convert to RGB, and save another JPEG copy of the same image. > 6. mail both images to me and/or the list > > Thanks /F > From charlie at begeistert.org Fri Mar 6 22:16:13 2009 From: charlie at begeistert.org (Charlie Clark) Date: Fri, 6 Mar 2009 22:16:13 +0100 Subject: [Image-SIG] [raclette] help wanted - anyone has a recent photoshop within reach and a few minutes to spare? In-Reply-To: <368a5cd50903061249h243d3b57qbc2a9998da6c7b9b@mail.gmail.com> References: <368a5cd50903061249h243d3b57qbc2a9998da6c7b9b@mail.gmail.com> Message-ID: Am 06.03.2009 um 21:49 schrieb Fredrik Lundh: > I'm have a lingering feeling that someone have helped me with this > before, but I cannot find the mails/files, so here we go again: > > I need a small (e.g. 100x100) sample CMYK JPEG from Photoshop - that > is, the kind of file that keeps causing trouble for people on this > list from time to time. To make it easy for me to work with this > file, do something like this: > > 1. create a small CMYK image, and fill it with solid black or solid > white > 2. pick a nice font and draw the text "RED" in big red letters > 3. put a small red object in the upper left corner (make sure the > corner pixel and at least a few pixels around it are red) > 4. save as JPEG. > 5. convert to RGB, and save another JPEG copy of the same image. > 6. mail both images to me and/or the list 'Ere you go. -- Charlie Clark -------------- next part -------------- A non-text attachment was scrubbed... Name: pil_sample_cmyk.jpg Type: image/jpeg Size: 29364 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pil_sample_rgb.jpg Type: image/jpeg Size: 29342 bytes Desc: not available URL: -------------- next part -------------- Helmholtzstr. 20 D?sseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 From tim at timhatch.com Fri Mar 6 22:25:09 2009 From: tim at timhatch.com (Tim Hatch) Date: Fri, 6 Mar 2009 13:25:09 -0800 Subject: [Image-SIG] PIL and embedded ICC profiles In-Reply-To: <368a5cd50903061258k283ddc55jd95e3da2055a6653@mail.gmail.com> References: <576DA127-C143-4299-B9C6-E8EA0D3A1C7C@timhatch.com> <368a5cd50903061258k283ddc55jd95e3da2055a6653@mail.gmail.com> Message-ID: <84D83908-E583-4AD3-9BBD-95C8933BBA02@timhatch.com> > Except for the JPEG hack, Florian's original patch looks pretty quite > clean to me. Right, I just fixed where hunks didn't apply and adjusted to be more PEP8. > That diff link looks a bit strange to me, though - looks more like > status output than diff output. Am I missing something, or did you > post the wrong file? You're correct. The diff itself is up there now. > http://timhatch.com/ex/2009/03/pil-keep-icc-profiles.diff Tim From bbrace at eskimo.com Fri Mar 6 22:22:36 2009 From: bbrace at eskimo.com ({ brad brace }) Date: Fri, 6 Mar 2009 13:22:36 -0800 (PST) Subject: [Image-SIG] 12hr project In-Reply-To: References: Message-ID: _ |__ __| | /_ |__ \| | | __| | | | (_) | | __/ (__| |_ __ | | | | | | __/ | |/ /_| | | | | _ | | | '_ \ / _ \ | | / /| '_ \| '__| The 12hr-ISBN-JPEG Project >>>> posted since 1994 <<<< _ | | | '_ \ / _ \ | | / /| '_ \| '__| -_ | | | |__ ___ | | ) | |__ _ __ _ | __ \ (_) | | "An impassive observer, { brad brace } forges a personal aesthetic in these 12hr-images infused with blank-sadness and a sense of mystery. What makes them both new and significant is the fact that he organizes its contents in sequences, applying the principles of cinematographic montage to fixed images." You begin to sense the byshadows that stretch from the awe of global dominance. How the intersecting systems help pull us apart, leaving us vague, drained, docile, soft in our inner discourse, willing to be shaped, to be overwhelmed -- easy retreats, half beliefs. Works of art are complex formal interventions within discursive traditions and their myriad filiations. These interventions are defined precisely by their incomparable capacity to trace the dynamics of historical process in paradoxical gestures of simultaneously prognostic and mnemonic temporalities. | __| | | | (_) | | __/ (__| |_ _ | | | '_ \ / _ \ | | / /| '_ \| '__| _| |__) | __ ___ _ ___ ___| |_ |_ ___/ '__/ _ \| |/ _ \/ __| __| |_| _ |_| \___/| |\___|\___|\__| _ _/ | _ |__/ > > > > Synopsis: The 12hr-ISBN-JPEG Project began December 30, 1994. A `round-the-clock posting of sequenced hypermodern imagery from { brad brace }. The hypermodern minimizes the familiar, the known, the recognizable; it suspends identity, relations and history. This discourse, far from determining the locus in which it speaks, is avoiding the ground on which it could find support. It is trying to operate a decentering that leaves no privilege to any center. The 12-hour ISBN JPEG Project ----------------------------- began December 30, 1994 Pointless Hypermodern Imagery... posted/mailed every 12 hours... a spectral, trajective alignment for the 00`s! A continuum of minimalist masks in the face of catastrophe; conjuring up transformative metaphors for the everyday... A poetic reversibility of exclusive events... A post-rhetorical, continuous, apparently random sequence of imagery... genuine gritty, greyscale... corruptable, compact, collectable and compelling convergence. The voluptuousness of the grey imminence: the art of making the other disappear. Continual visual impact; an optical drumming, sculpted in duration, on the endless present of the Net. An extension of the printed ISBN-Book (0-9690745) series... critically unassimilable... imagery is gradually acquired, selected and re-sequenced over time... ineluctable, vertiginous connections. The 12hr dialtone... [ see http://www.eskimo.com/~bbrace/netcom/books.txt ] KEYWORDS: >> Disconnected, disjunctive, distended, de-centered, de-composed, ambiguous, augmented, ambilavent, homogeneous, reckless... >> Multi-faceted, oblique, obsessive, obscure, obdurate... >> Promulgated, personal, permeable, prolonged, polymorphous, provocative, poetic, plural, perverse, potent, prophetic, pathological, pointless, placeholders... >> Robust, real, redundant, resplendent, revolutionary, redeeming... >> Emergent, evolving, eccentric, eclectic, egregious, eternal, exciting, entertaining, evasive, entropic, erotic, entrancing, enduring, ergodic, expansive... Every 12 hours, another!... view them, re-post `em, save `em, trade `em, print `em, even publish them... Here`s how: ~ Set www-links to -> http://www.eskimo.com/~bbrace/12hr.html -> http://bbrace.laughingsquid.net/12hr.html -> http://bbrace.net/12hr.html -> http://noemata.net/12hr/ Look for the 12-hr-icon. Heavy traffic may require you to specify files more than once! Anarchie, Fetch, CuteFTP, TurboGopher... ~ Download from -> ftp.rdrop.com /pub/users/bbrace Download from -> ftp.eskimo.com /u/b/bbrace Download from -> hotline://artlyin.ftr.va.com.au Download from -> http://kunst.noemata.net/12hr/ * Remember to set tenex or binary. Get 12hr.jpeg ~ E-mail -> If you only have access to email, then you can use FTPmail to do essentially the same thing. Send a message with a body of 'help' to the server address nearest you: * ftpmail at ccc.uba.ar ftpmail at cs.uow.edu.au ftpmail at ftp.uni-stuttgart.de ftpmail at ftp.Dartmouth.edu ftpmail at ieunet.ie ftpmail at src.doc.ic.ac.uk ftpmail at archie.inesc.pt ftpmail at ftp.sun.ac.za ftpmail at ftp.sunet.se ftpmail at ftp.luth.se ftpmail at NCTUCCCA.edu.tw ftpmail at oak.oakland.edu ftpmail at sunsite.unc.edu ftpmail at decwrl.dec.com ftpmail at census.gov bitftp at plearn.bitnet bitftp at dearn.bitnet bitftp at vm.gmd.de bitftp at plearn.edu.pl bitftp at pucc.princeton.edu bitftp at pucc.bitnet * * ~ Mirror-sites requested! Archives too! The latest new jpeg will always be named, 12hr.jpeg Average size of images is only 45K. * Perl program to mirror ftp-sites/sub-directories: src.doc.ic.ac.uk:/packages/mirror * ~ Postings to usenet newsgroups: 12hr alt.12hr alt.binaries.pictures.12hr alt.binaries.pictures.misc alt.binaries.pictures.fine-art.misc * * Ask your system's news-administrator to carry these groups! (There are also usenet image browsers: TIFNY, PluckIt, Picture Agent, PictureView, Extractor97, NewsRover, Binary News Assistant, EasyNews) ~ This interminable, relentless (online) sequence of imagery began in earnest on December 30, 1994. The basic structure of the project has been over twenty-five years in the making. While the specific sequence of photographs has been presently orchestrated for many years` worth of 12-hour postings, I will undoubtedly be tempted to tweak the ongoing publication with additional new interjected imagery. Each 12-hour image is like the turning of a page; providing ample time for reflection, interruption, and assimilation. ~ The sites listed above also contain information on other cultural projects and sources. ~ A very low-volume, moderated mailing list for announcements and occasional commentary related to this project has been established at topica.com /subscribe 12hr-isbn-jpeg -- The image was to make nothing visible but their connection with one another by space and air, yet each surrounded by the unique aura that disengages every deeply seen image from the world of irrelevant relationships and calls forth a tremor of astonishment at its fateful necessity. Thus from artworks of dead masters, over-life-size strangeness whose names we do not know and do not wish to know, look out at us enigmatically as symbols of all being. -- Big Grey Bricks: This project also serves as a rehearsal for its culmination as a series of offset-printed volumes: each 800+ full-bleed pages (5x8"_300lpi), where the full integrated rhythm of greyscale-sequence can be more intricately resolved. I'd provide all design, prepress and production. -- This project remains untainted by corrupt corporate and glib government art-subsidies. Some opportunities still exist for financially assisting the publication of editions of large (33x46") prints; perhaps (Iris giclees) inkjet duotones or extended-black quadtones. Other supporters receive rare copies of the first three web-offset printed ISBN-Books. Contributions and requests for 12hr-email-subscriptions, can also be made at http://bbrace.laughingsquid.net/buy-into.html, or by mailed cheque/check: $5/mo $50/yr. Art-institutions must pay $12K for each image retained longer than 12 hours. -- ISBN is International Standard Book Number. JPEG and GIF are types of image files. Get the text-file, 'pictures-faq' to learn how to view or translate these images. [http://www.eskimo.com/~bbrace/netcom/pictures -faq.html] -- (c) Credit appreciated. Copyleft 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 From fredrik at pythonware.com Fri Mar 6 22:52:29 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 6 Mar 2009 22:52:29 +0100 Subject: [Image-SIG] PIL and embedded ICC profiles In-Reply-To: <84D83908-E583-4AD3-9BBD-95C8933BBA02@timhatch.com> References: <576DA127-C143-4299-B9C6-E8EA0D3A1C7C@timhatch.com> <368a5cd50903061258k283ddc55jd95e3da2055a6653@mail.gmail.com> <84D83908-E583-4AD3-9BBD-95C8933BBA02@timhatch.com> Message-ID: <368a5cd50903061352y7abeddb3h6ab97a1628335f2f@mail.gmail.com> Thanks! http://bitbucket.org/effbot/pil-2009-raclette/changeset/debdde9b7862/ On Fri, Mar 6, 2009 at 10:25 PM, Tim Hatch wrote: >> Except for the JPEG hack, Florian's original patch looks pretty quite >> clean to me. > > Right, I just fixed where hunks didn't apply and adjusted to be more PEP8. > >> That diff link looks a bit strange to me, though - looks more like >> status output than diff output. ?Am I missing something, or did you >> post the wrong file? > > You're correct. ?The diff itself is up there now. > >> http://timhatch.com/ex/2009/03/pil-keep-icc-profiles.diff > > Tim > > From fredrik at pythonware.com Sat Mar 7 01:26:15 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 7 Mar 2009 01:26:15 +0100 Subject: [Image-SIG] [raclette] that JPEG CMYK thing, again Message-ID: <368a5cd50903061626y68cd64f9u1615b8ab9564081a@mail.gmail.com> Thanks to Tim and Charlie, I now have a set of nice Photoshop CMYK samples to play with. The first result is a revamp of Kevin's CMYK patch; I'm now doing the inversion at the codec levels, both when reading and writing. Also, the code *always* assumes Adobe behaviour, in both directions. The current version of the plugin is here: http://bitbucket.org/effbot/pil-2009-raclette/src/e351bc0228c4/PIL/JpegImagePlugin.py I *think* this does the right thing, but I'm not 100% sure. In other words, it would be helpful if those of you who've struggled with CMYK stuff can take this version for a test drive; it should work just fine together with a standard 1.1.6. From wichert at simplon.biz Sun Mar 8 18:09:13 2009 From: wichert at simplon.biz (Wichert Akkerman) Date: Sun, 08 Mar 2009 18:09:13 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> <49B12A13.2080406@simplon.biz> <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> Message-ID: <49B3FBB9.3090204@simplon.biz> I sent two images demonstrating the problem to Fredrik off-list. I suspect this is a fairly common problem: I have seen this error occur several when users try to upload a member portrait to a community site, and at this moment only a handful users have access to it since it is still in a closed test phase. Wichert. On 3/6/09 5:43 PM, Fredrik Lundh wrote: > Does anyone have a (preferrably) small example, or a simple way to > create a broken file on a stock Windows XP machine? An URL or an > off-list mail works fine. > > > > On Fri, Mar 6, 2009 at 4:52 PM, Howard Lightstone > wrote: > >> This LOOKS like a bug in Windows XP which creates .BMP files via DirectX >> with an incorrect bitmap header size (54 vice 40). Changing the 54 to 40 >> makes the file readable again. Most utilities seem to ignore this but >> Windows itself won't be able to 'read' it as a .BMP file. >> >> (using XP SP2 and DirectX 9.0c ... I haven't tried this on Vista yet) >> >> On Fri, Mar 6, 2009 at 5:50 AM, Wichert Akkerman >> wrote: >> >>> The first image: >>> >>> >>>>>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont.bmp")) >>>>>> i >>>>>> >>> >>> >>>>>> i.mode >>>>>> >>> 'RGB' >>> >>>>>> i.size >>>>>> >>> (290, 4294967075L) >>> >>>>>> i.tile >>>>>> >>> [('raw', (0, 0, 290, 4294967075L), 54, ('BGR', 872, -1))] >>> >>> and the second image: >>> >>> >>>>>> i=PIL.Image.open(open("/Users/wichert/Desktop/dont2.bmp")) >>>>>> i.mode >>>>>> >>> 'RGB' >>> >>>>>> i.size >>>>>> >>> (288, 4294967078L) >>> >>>>>> i.tile >>>>>> >>> [('raw', (0, 0, 288, 4294967078L), 54, ('BGR', 864, -1))] >>> >>> >>> Regards, >>> Wichert. >>> >>> On 3/5/09 6:41 PM, Fredrik Lundh wrote: >>> >>>> Can you print the following attributes for a broken file, before calling >>>> load: >>>> >>>> pil_data.mode >>>> pil_data.size >>>> pil_data.tile >>>> >>>> >>>> >>>> 2009/3/3 Wichert Akkerman: >>>> >>>> >>>>> I have a small routine which tries to verify if an uploaded file is a >>>>> valid >>>>> image. It works like this: >>>>> >>>>> image_data=StringIO(data) >>>>> try: >>>>> pil_data=PIL.Image.open(image_data) >>>>> except IOError: # PIL abuses IOError to report parsing errors >>>>> raise Invalid(self.message("bad_image", state), >>>>> value, state) >>>>> >>>>> pil_data.load() >>>>> (width,height)=pil_data.size >>>>> >>>>> For some images I get an OverflowError on the load() call: >>>>> >>>>> Module PIL.ImageFile:155 in load >>>>> >>>>> >>>>>>> self.load_prepare() >>>>>>> >>>>>>> >>>>> Module PIL.ImageFile:223 in load_prepare >>>>> >>>>> >>>>>>> self.im = Image.core.new(self.mode, self.size) >>>>>>> >>>>>>> >>>>> OverflowError: long int too large to convert to int >>>>> >>>>> I can not find any information as to what the problem might be. It seems >>>>> to >>>>> only occur for bmp files; jpeg and png appear to work correctly. >>>>> >>>>> This is using PIL 1.1.6 and Python 2.5 on a Linux system. >>>>> >>>>> Wichert. >>>>> << self.map = None >>>>> >>>>> self.load_prepare() >>>>> >>>>> # look for read/seek overrides >>>>> << if not self.im or\ >>>>> self.im.mode != self.mode or self.im.size != >>>>> self.size: >>>>> self.im = Image.core.new(self.mode, self.size) >>>>> # create palette (optional) >>>>> if self.mode == "P": >>>>> _______________________________________________ >>>>> Image-SIG maillist - Image-SIG at python.org >>>>> http://mail.python.org/mailman/listinfo/image-sig >>>>> >>>>> >>>>> >>>>> >>> _______________________________________________ >>> Image-SIG maillist - Image-SIG at python.org >>> http://mail.python.org/mailman/listinfo/image-sig >>> >>> >> >> -- >> Howard Lightstone >> hlightstone at gmail.com >> howard at eegsoftware.com >> >> From charlie at begeistert.org Sun Mar 8 19:05:09 2009 From: charlie at begeistert.org (Charlie Clark) Date: Sun, 8 Mar 2009 19:05:09 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: <49B3FBB9.3090204@simplon.biz> References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> <49B12A13.2080406@simplon.biz> <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> <49B3FBB9.3090204@simplon.biz> Message-ID: Am 08.03.2009 um 18:09 schrieb Wichert Akkerman: > I sent two images demonstrating the problem to Fredrik off-list. > > I suspect this is a fairly common problem: I have seen this error > occur several when users try to upload a member portrait to a > community site, and at this moment only a handful users have access > to it since it is still in a closed test phase. Hiya Wichert, I'm just curious as to why a .BMP is likely to be a common format - is the image coming as .BMP from some common windows control? Charlie -- Charlie Clark Helmholtzstr. 20 D?sseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 From wichert at simplon.biz Sun Mar 8 19:09:53 2009 From: wichert at simplon.biz (Wichert Akkerman) Date: Sun, 08 Mar 2009 19:09:53 +0100 Subject: [Image-SIG] OverflowError on image save In-Reply-To: References: <49AD9F41.2050604@simplon.biz> <368a5cd50903050941h2960a6c6j28eb8dbbc08866fb@mail.gmail.com> <49B12A13.2080406@simplon.biz> <29bf24a80903060752h31c2fdd4y6f3114539a178ad@mail.gmail.com> <368a5cd50903060843y1dfbdb07u89a935941b5e417@mail.gmail.com> <49B3FBB9.3090204@simplon.biz> Message-ID: <49B409F1.8080704@simplon.biz> Hi Charlie, On 3/8/09 7:05 PM, Charlie Clark wrote: > Hiya Wichert, > > I'm just curious as to why a .BMP is likely to be a common format - is > the image coming as .BMP from some common windows control? I have no idea. I just noticed that we are currently testing a new site with 50 users, and two have hit this problem. Personally I'm shocked people still use BMPs, Wichert. From fredrik at pythonware.com Mon Mar 9 18:23:12 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 9 Mar 2009 18:23:12 +0100 Subject: [Image-SIG] [raclette] PyCMS now part of PIL Message-ID: <368a5cd50903091023q36faa3dep28b3c66f6635cedd@mail.gmail.com> Kevin Cazabon has graciously donated his PyCMS library to PIL, and it landed in the "raclette" tree yesterday. The library will automatically be built if you have LittleCMS on the machine (www.littlecms.com). The Python binding is now in PIL.ImageCms. I'm still working on a tighter integration, but the module provides the procedural PyCMS API (with a few enhancements; you can e.g. read profiles from memory by passing in file objects instead of filenames). In other words, code written for pyCMS "should" still work if you just change "import pyCMS" to import PIL.ImageCms as pyCMS The internals are reworked, though, so code that rely on implementation details, the exact phrasing of error messages (the PIL version is less informative), or access to the pyCMSdll layer won't work. If you want to help out testing the integration, you can pull the current snapshot from http://bitbucket.org/effbot/pil-2009-raclette/overview/ (either as a zip/tarball via the download link, or using "hg clone"). Cheers /F From kevin at cazabon.com Tue Mar 10 00:32:10 2009 From: kevin at cazabon.com (Kevin Cazabon) Date: Mon, 9 Mar 2009 19:32:10 -0400 Subject: [Image-SIG] [raclette] PyCMS now part of PIL In-Reply-To: <368a5cd50903091023q36faa3dep28b3c66f6635cedd@mail.gmail.com> References: <368a5cd50903091023q36faa3dep28b3c66f6635cedd@mail.gmail.com> Message-ID: <4CA150B4-23CB-4BA9-A4F2-F0F8E282BA37@cazabon.com> Thanks for the hard work on upgrading and integrating this Fredrik - I've been following your changes and it seems like quite a significant amount of work on your end to clean it up and streamline things. I'm looking forward to playing with the in-memory profile reading, along with the embedded profile reading that other SIG members have been working on. Having CMS in PIL will be yet another formidable tool for PIL and adoption in high-end applications. In any case, I'm proud to contribute pyCMS - although it's really just a wrapper around Marti Maria's harder work on the LittleCMS library itself. Kevin. On 09 Mar 2009, at 13:23, Fredrik Lundh wrote: > Kevin Cazabon has graciously donated his PyCMS library to PIL, and it > landed in the "raclette" tree yesterday. The library will > automatically be built if you have LittleCMS on the machine > (www.littlecms.com). The Python binding is now in PIL.ImageCms. > > I'm still working on a tighter integration, but the module provides > the procedural PyCMS API (with a few enhancements; you can e.g. read > profiles from memory by passing in file objects instead of filenames). > In other words, code written for pyCMS "should" still work if you > just change "import pyCMS" to > > import PIL.ImageCms as pyCMS > > The internals are reworked, though, so code that rely on > implementation details, the exact phrasing of error messages (the PIL > version is less informative), or access to the pyCMSdll layer won't > work. > > If you want to help out testing the integration, you can pull the > current snapshot from > > http://bitbucket.org/effbot/pil-2009-raclette/overview/ > > (either as a zip/tarball via the download link, or using "hg clone"). > > Cheers /F > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From nikolai at netlife.no Tue Mar 10 09:09:30 2009 From: nikolai at netlife.no (Nikolai Ugelvik) Date: Tue, 10 Mar 2009 09:09:30 +0100 Subject: [Image-SIG] XVThumbImagePlugin infinite loop fix Message-ID: <49B6203A.9080509@netlife.no> I sent an email regarding a bug with this module, including a patch. Would like to have this included in 1.1.7. -Nikolai Original message: Hi. The PIL module XVThumbImagePlugin.py has an issue with XVThumb files that do not include #END_OF_COMMENTS (or a comment section at all). I'm not quite sure if the problem is an invalid file (is the comment required?), but we encountered a file like this. Anyway, the result is XVThumbImagePlugin being stuck in an infinite loop. The patch supports files without comments and/or comment sections without #END_OF_COMMENTS. Attached is a diff against XVThumbImagePlugin.py from PIL version 1.1.6. (I didn't figure out where else to send the diff.) -Nikolai -------------- next part -------------- A non-text attachment was scrubbed... Name: XVThumbImagePlugin.diff Type: text/x-patch Size: 789 bytes Desc: not available URL: From lists+Image_SIG at hoech.org Tue Mar 10 13:45:20 2009 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Tue, 10 Mar 2009 13:45:20 +0100 Subject: [Image-SIG] [raclette] PyCMS now part of PIL In-Reply-To: <368a5cd50903091023q36faa3dep28b3c66f6635cedd@mail.gmail.com> References: <368a5cd50903091023q36faa3dep28b3c66f6635cedd@mail.gmail.com> Message-ID: <49B660E0.5050400@hoech.org> Very nice - it just needs LCMS flags support so we can use black point compensation and softproofing :) See attached patches. They also fix a naming issue which could cause confusion - display profile (ImageCms wording) actually means proof profile (lcms wording), so I changed variable names and docstrings where applicable. Patches are tested under Python 2.6. Regards, Florian H?ch Fredrik Lundh schrieb: > Kevin Cazabon has graciously donated his PyCMS library to PIL, and it > landed in the "raclette" tree yesterday. The library will > automatically be built if you have LittleCMS on the machine > (www.littlecms.com). The Python binding is now in PIL.ImageCms. > > I'm still working on a tighter integration, but the module provides > the procedural PyCMS API (with a few enhancements; you can e.g. read > profiles from memory by passing in file objects instead of filenames). > In other words, code written for pyCMS "should" still work if you > just change "import pyCMS" to > > import PIL.ImageCms as pyCMS > > The internals are reworked, though, so code that rely on > implementation details, the exact phrasing of error messages (the PIL > version is less informative), or access to the pyCMSdll layer won't > work. > > If you want to help out testing the integration, you can pull the > current snapshot from > > http://bitbucket.org/effbot/pil-2009-raclette/overview/ > > (either as a zip/tarball via the download link, or using "hg clone"). > > Cheers /F > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: _imagingcms.c.diff URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ImageCms.py.diff URL: From oliver at weichhold.com Thu Mar 12 22:30:47 2009 From: oliver at weichhold.com (Oliver Weichhold) Date: Thu, 12 Mar 2009 22:30:47 +0100 Subject: [Image-SIG] Strange Truetype ImageFont rendering behavior Message-ID: The code snippet below produces the following two result images on my system: Arial: http://farm4.static.flickr.com/3658/3349324835_ecbb460afb_o.jpg TrajanPro-Bold: http://farm4.static.flickr.com/3439/3349324795_71b1c1fd48_o.jpg I am totally puzzled as to why the font size is kind of applied horizontally for Trajan Bold. I've produced the images on a freshly installed Windows XP 64 with Python 2.61 + PIL 1.1.6. Any suggestions what's going on here? from PIL import Image, ImageOps from PIL import ImageFont, ImageDraw arial = ImageFont.truetype("Arial.ttf", 24) trajan = ImageFont.truetype("TrajanPro-Bold.otf", 24) def render_msg(font, filename): im = Image.new("RGB", (200,50), "#ddd") draw = ImageDraw.Draw(im) draw.text((10,10), "Run awayyyy!", font=font, fill="red") im.save(filename) render_msg(arial, 'f1.jpg') render_msg(trajan, 'f2.jpg') -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Fri Mar 13 12:08:10 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 13 Mar 2009 12:08:10 +0100 Subject: [Image-SIG] Strange Truetype ImageFont rendering behavior In-Reply-To: References: Message-ID: <368a5cd50903130408x5b296984id99952ef1182f48d@mail.gmail.com> Seems to work for me (see attachment). However, I just realized that I have a rather old version of Freetype on this machine (2.1.10). What version are you using? 2009/3/12 Oliver Weichhold : > The code snippet below produces the following two result images on my > system: > Arial: > http://farm4.static.flickr.com/3658/3349324835_ecbb460afb_o.jpg > > TrajanPro-Bold: > http://farm4.static.flickr.com/3439/3349324795_71b1c1fd48_o.jpg > > I am totally puzzled as to why the font size is kind of applied horizontally > for Trajan Bold. I've produced the images on a freshly installed Windows XP > 64 with Python 2.61 + PIL 1.1.6. > Any suggestions what's going on here? > > from PIL import Image, ImageOps > from PIL import ImageFont, ImageDraw > arial = ImageFont.truetype("Arial.ttf", 24) > trajan = ImageFont.truetype("TrajanPro-Bold.otf", 24) > def render_msg(font, filename): > im = Image.new("RGB", (200,50), "#ddd") > draw = ImageDraw.Draw(im) > draw.text((10,10), "Run awayyyy!", font=font, fill="red") > im.save(filename) > render_msg(arial, 'f1.jpg') > render_msg(trajan, 'f2.jpg') > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -------------- next part -------------- A non-text attachment was scrubbed... Name: test.gif Type: image/gif Size: 2379 bytes Desc: not available URL: From evg.salmin at gmail.com Fri Mar 13 23:03:52 2009 From: evg.salmin at gmail.com (Evgeny Salmin) Date: Sat, 14 Mar 2009 04:03:52 +0600 Subject: [Image-SIG] Converting images to palette mode Message-ID: Hello. Recently we wrote about memory problems of PIL while converting large number of png files to 8-bit palette format. After some number of messages simple converting script (see in attach) takes all available memory from a system and produces QuantizationError. After some examinating of PIL source code we've founded that QuantizationError arrises after failed malloc. Each new image increase memory usage, whereas this script should work in fixed amount of memory (it processes image, then takes the next one). I've realized that problem can be solved by applying simple patch (see attach). After tests on huge number of png files memory consumption looks fixed and converting works correct. I'd like to know PIL author's opinion. Thank you. Evgeny -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PIL_mem_leak.diff Type: application/octet-stream Size: 348 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: to_8bit.py Type: application/octet-stream Size: 2160 bytes Desc: not available URL: From fredrik at pythonware.com Sat Mar 14 00:04:34 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 14 Mar 2009 00:04:34 +0100 Subject: [Image-SIG] Converting images to palette mode In-Reply-To: References: Message-ID: <368a5cd50903131604n323fad24qb643c0fe6b39aafb@mail.gmail.com> It's the same fix as this one, right? http://bitbucket.org/effbot/pil-2009-raclette/changeset/577ae0c2a85e/ I haven't been able to force the leak during testing (the loop can terminate in several ways, and only one of them leaks memory; none of my test images seemed to trigger this behaviour with the test program I used), but the fix is "obviously correct" so it's in. From darkgl0w at yahoo.com Fri Mar 13 22:39:36 2009 From: darkgl0w at yahoo.com (Cristi Constantin) Date: Fri, 13 Mar 2009 14:39:36 -0700 (PDT) Subject: [Image-SIG] Python 3 support Message-ID: <802770.33034.qm@web52107.mail.re2.yahoo.com> Good day. I just joined the mailing list. I want to know if PIL will ever support Python 3. I am slowly migrating my applications on Python 3 and i really need PIL. It's not good to have half of my apps in Py 2.x and the rest in Py 3.x :) Thank you in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Sat Mar 14 00:22:02 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 14 Mar 2009 00:22:02 +0100 Subject: [Image-SIG] [raclette] 1.1.7 status Message-ID: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> > It's the same fix as this one, right? By the way, here's a rough version history for the current 1.1.7 snapshot available from here: http://bitbucket.org/effbot/pil-2009-raclette/src/874f7005c34c/ Let me know if I've missed some patch that absolutely should go into 1.1.7, or some bug that absolutely needs to be fixed. cheers /F === changes in PIL 1.1.7 as of 2009-03-13 === Added version attributes to jpeg/zlib/littlecms/freetype bindings, for debugging. Added (experimental) ImageCms function for fetching the ICC profile for the current display (currently Windows only). Added HWND/HDC support to ImageCms.get_display_profile(). Added WMF renderer (Windows only). Added ImagePointHandler and ImageTransformHandler mixins; made ImageCmsTransform work with im.point. Fixed potential endless loop in the XVThumbnail reader (from Nikolai Ugelvik). Added Kevin Cazabon's pyCMS package. The C code has been moved to _imagingcms.c, the Python interface module is installed as PIL.ImageCMS. Added support for in-memory ICC profiles. Unified buildTransform and buildTransformFromOpenProfiles. The profile can now be either a filename, a profile object, or a file-like object containing an in-memory profile. Additional fixes from Florian B?ch: Very nice - it just needs LCMS flags support so we can use black point compensation and softproofing :) See attached patches. They also fix a naming issue which could cause confusion - display profile (ImageCms wording) actually means proof profile (lcms wording), so I changed variable names and docstrings where applicable. Patches are tested under Python 2.6. Improved support for layer names in PSD files (from Sylvain Baubeau) Sylvain writes: I needed to be able to retrieve the names of the layers in a PSD files. But PsdImagePlugin.py didn't do the job so I wrote this very small patch. Improved RGBA support for ImageTk for 8.4 and newer (from Con Radchenko). This replaces the slow run-length based encoding model with true compositing at the Tk level. Added support for 16- and 32-bit images to McIdas loader. Based on file samples and stand-alone reader code provided by Craig Swank. Added ImagePalette support to putpalette. Fixed problem with incremental parsing of PNG files. Make selftest.py report non-zero status on failure (from Mark Sienkiewicz) Add big endian save support and multipage infrastructure to the TIFF writer (from Sebastian Haase). Added zTXT support (from Andrew Kuchling via Lowell Alleman). Fixed potential infinite loop bug in ImageFont (from Guilherme Polo). Added sample ICC profiles (from Kevin Cazabon) Fixed array interface for I, F, and RGBA/RGBX images. Added Chroma subsampling support for JPEG (from Justin Huff). Justin writes: Attached is a patch (against PIL 1.1.6) to provide control over the chroma subsampling done by the JPEG encoder. This is often useful for reducing compression artifacts around edges of clipart and text. Added USM/Gaussian Blur code from Kevin Cazabon. Fixed bug w. uninitialized image data when cropping outside the source image. Use ImageShow to implement the Image.show method. Most notably, this picks the 'display' utility when available. It also allows application code to register new display utilities via the ImageShow registry. Release the GIL in the PNG compressor (from Michael van Tellingen). Revised JPEG CMYK handling. Always assume Adobe behaviour, both when reading and writing (based on a patch by Kevin Cazabon, and test data by Tim V. and Charlie Clark). Support for preserving ICC profiles (by Florian B?ch via Tim Hatch). Florian writes: It's a beta, so still needs some testing, but should allow you to: - retain embedded ICC profiles when saving from/to JPEG, PNG, TIFF. Existing code doesn't need to be changed. - access embedded profiles in JPEG, PNG, PSD, TIFF. It also includes patches for TIFF to retain IPTC, Photoshop and XMP metadata when saving as TIFF again, read/write TIFF resolution information correctly, and to correct inverted CMYK JPEG files. Fixed potential memory leak in median cut quantizer (from Evgeny Salmin). Fixed OverflowError when reading upside-down BMP images. Added resolution save option for PDF files. Andreas Kostyrka writes: I've included a patched PdfImagePlugin.py based on 1.1.6 as included in Ubuntu, that supports a "resolution" save option. Not great, but it makes the PDF saving more useful by allowing PDFs that are not exactly 72dpi. Look for Tcl/Tk include files in version-specific include directory (from Encolpe Degoute). Fixed grayscale rounding error in ImageColor.getcolor (from Tim Hatch). Fixed truetype positioning when first character has a negative left bearing (from Ned Batchelder): Ned writes: In PIL 1.1.6, ImageDraw.text will position the string incorrectly if the first character has a negative left bearing. To see the problem, show a string like "///" in an italic font. The first slash will be clipped at the left, and the string will be mis-positioned. Fixed resolution unit bug in tiff reader/writer (from Florian H?ch, Gary Bloom, and others). Added simple transparency support for RGB images (reported by Sebastian Spaeth). Added support for Unicode filenames in ImageFont.truetype (from Donn Ingle). Fixed potential crash in ImageFont.getname method (from Donn Ingle). Fixed encoding issue in PIL/WalImageFile (from Santiago M. Mola). === end === From cannon.el at gmail.com Sat Mar 14 01:49:05 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Fri, 13 Mar 2009 17:49:05 -0700 Subject: [Image-SIG] perspective method Message-ID: A while back a read about, and even used, an experimental feature in PIL 1.1.16 it was a new feature to the im.transform() method. as I recall it was im.transform(size, PERSPECTIVE, data, filter) where data was the transformation matrix. I was wondering what the status of this feature was. It worked fine for me, and I wondered if it was still considered experimental or if we could now consider it stable and add it to the documentation. Edward From lists+Image_SIG at hoech.org Sat Mar 14 09:53:16 2009 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Sat, 14 Mar 2009 09:53:16 +0100 Subject: [Image-SIG] [raclette] 1.1.7 status In-Reply-To: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> References: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> Message-ID: <49BB707C.3030506@hoech.org> I wrote a patch for CMYK undercolor removal for the "dumb" (non-ICC) conversion a while ago, but I think I never posted it anywhere - so here goes (it works flawlessly as far as I can tell, but I as I'm no seasoned C-programmer the code is maybe not very efficient). Only drawback I can think of is that the results are of course inconsistent with previous PIL versions, but you gain the benefit that the conversion can be easily inverted. Something else I'd like to see is 16-bits-per-channel support for image types that can do it (hmm, TIFF, PSD?), but I have no idea how much work that'd be, so maybe not for 1.1.7. Regards, Florian H?ch Fredrik Lundh wrote: > By the way, here's a rough version history for the current 1.1.7 > snapshot available from here: > > http://bitbucket.org/effbot/pil-2009-raclette/src/874f7005c34c/ > > Let me know if I've missed some patch that absolutely should go into > 1.1.7, or some bug that absolutely needs to be fixed. > > cheers /F -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Convert.c.diff URL: From v+python at g.nevcal.com Sat Mar 14 17:20:25 2009 From: v+python at g.nevcal.com (Glenn Linderman) Date: Sat, 14 Mar 2009 09:20:25 -0700 Subject: [Image-SIG] [raclette] 1.1.7 status In-Reply-To: <49BB707C.3030506@hoech.org> References: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> <49BB707C.3030506@hoech.org> Message-ID: <49BBD949.7050506@g.nevcal.com> On approximately 3/14/2009 1:53 AM, came the following characters from the keyboard of Florian H?ch: > Something else I'd like to see is 16-bits-per-channel support for > image types that can do it (hmm, TIFF, PSD?), but I have no idea how > much work that'd be, so maybe not for 1.1.7. And I'd like 1-bit-per-1-channel support (bitonal) for TIFF and Group4 compression on writing.... guess we do different stuff, eh? -- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking From lists+Image_SIG at hoech.org Sat Mar 14 17:28:33 2009 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Sat, 14 Mar 2009 17:28:33 +0100 Subject: [Image-SIG] [raclette] 1.1.7 status In-Reply-To: <49BBD949.7050506@g.nevcal.com> References: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> <49BB707C.3030506@hoech.org> <49BBD949.7050506@g.nevcal.com> Message-ID: <49BBDB31.9060504@hoech.org> Maybe you shouldn't have mentioned it - now I'd like to have that too ;) Regards, Florian H?ch Glenn Linderman wrote: > And I'd like 1-bit-per-1-channel support (bitonal) for TIFF and Group4 > compression on writing.... guess we do different stuff, eh? From evg.salmin at gmail.com Sat Mar 14 11:10:29 2009 From: evg.salmin at gmail.com (Evgeny Salmin) Date: Sat, 14 Mar 2009 16:10:29 +0600 Subject: [Image-SIG] Converting images to palette mode In-Reply-To: <368a5cd50903131604n323fad24qb643c0fe6b39aafb@mail.gmail.com> References: <368a5cd50903131604n323fad24qb643c0fe6b39aafb@mail.gmail.com> Message-ID: Hello Fredrik. Yes, it's the same fix. I just did't know that you've added fix from my previous post into a repository. Is it official PIL repo? 2009/3/14 Fredrik Lundh > It's the same fix as this one, right? > > http://bitbucket.org/effbot/pil-2009-raclette/changeset/577ae0c2a85e/ > > I haven't been able to force the leak during testing (the loop can > terminate in several ways, and only one of them leaks memory; none of > my test images seemed to trigger this behaviour with the test program > I used), but the fix is "obviously correct" so it's in. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.wendell at gmail.com Sun Mar 15 18:15:08 2009 From: mark.wendell at gmail.com (Mark Wendell) Date: Sun, 15 Mar 2009 11:15:08 -0600 Subject: [Image-SIG] ImageMath power-function error Message-ID: Hey all, I can't seem to use the power ("**") operator in the ImageMath module. For example, multiplying an L-mode image by a factor of 2.0 works fine: >>> out = ImageMath.eval( "convert( ( a*val ), 'L')", a=im, val=2.0) (no errors) However, raising the same image by a power of 2.0 generates a bad operand type error: >>> out = ImageMath.eval( "convert( ( a**val ), 'L')", a=im, val=2.0) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 203, in eval out =__builtin__.eval(expression, args) File "", line 1, in File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 119, in __pow__ return self.apply("pow", self, other) File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 82, in apply raise TypeError, "bad operand type for '%s'" % op TypeError: bad operand type for 'pow' Am I making a silly mistake? thanks in advance, Mark Ubuntu 8.10 linux, python 2.5.2, Pil 1.1.6 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pander at users.sourceforge.net Mon Mar 16 11:21:56 2009 From: pander at users.sourceforge.net (Pander) Date: Mon, 16 Mar 2009 11:21:56 +0100 Subject: [Image-SIG] Version 0.3 of ImageText.py Message-ID: <49BE2844.4080708@users.sourceforge.net> Hi all, Here is version 0.3 of ImageText.py. I hope it can find a way into the releases of PIL or contribute to PIL uses one wa or the other. This version has lots of improvements suggested by PyLint and Python 2.6. Have fun with it. Regards, Pander -------------- next part -------------- A non-text attachment was scrubbed... Name: ImageText.py Type: text/x-python Size: 15551 bytes Desc: not available URL: From fredrik at pythonware.com Mon Mar 16 15:01:48 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 16 Mar 2009 15:01:48 +0100 Subject: [Image-SIG] Converting images to palette mode In-Reply-To: References: <368a5cd50903131604n323fad24qb643c0fe6b39aafb@mail.gmail.com> Message-ID: <368a5cd50903160701r51a9b589i5715f7662a91cd97@mail.gmail.com> Official for the 1.1.7 release, at least. Not sure what we'll do beyond that (and whatever we do, the finished release will be available from svn.effbot.org for svn:externals users, as usual). On Sat, Mar 14, 2009 at 11:10 AM, Evgeny Salmin wrote: > Hello Fredrik. > > Yes, it's the same fix. I just did't know that you've added fix from my > previous post into a repository. Is it official PIL repo? From fredrik at pythonware.com Mon Mar 16 15:05:33 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 16 Mar 2009 15:05:33 +0100 Subject: [Image-SIG] ImageMath power-function error In-Reply-To: References: Message-ID: <368a5cd50903160705u6477a226vba79e40f0e6cf420@mail.gmail.com> No time to double-check, but I suspect the 1.1.6 version doesn't support ** - it's mentioned in the documentation, but I don't see any sign of it in the source code. It's on my list of things to fix for 1.1.7. 2009/3/15 Mark Wendell : > Hey all, > > I can't seem to use the power ("**") operator in the ImageMath module. > > > For example, multiplying an L-mode image by a factor of 2.0 works fine: > >>>> out = ImageMath.eval( "convert( ( a*val ), 'L')", a=im, val=2.0) > (no errors) > > However, raising the same image by a power of 2.0 generates a bad operand > type error: > >>>> out = ImageMath.eval( "convert( ( a**val ), 'L')", a=im, val=2.0) > Traceback (most recent call last): > ? File "", line 1, in > ? File "/usr/lib/python2.5/site- > packages/PIL/ImageMath.py", line 203, in eval > ??? out =__builtin__.eval(expression, args) > ? File "", line 1, in > ? File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 119, in > __pow__ > ??? return self.apply("pow", self, other) > ? File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 82, in > apply > ??? raise TypeError, "bad operand type for '%s'" % op > TypeError: bad operand type for 'pow' > > > Am I making a silly mistake? > > thanks in advance, > Mark > > Ubuntu 8.10 linux, python 2.5.2, Pil 1.1.6 > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From cfp at centeris2009.eiswatch.org Mon Mar 16 14:01:58 2009 From: cfp at centeris2009.eiswatch.org (CENTERIS'2009 - Conference on ENTERprise Information Systems) Date: Mon, 16 Mar 2009 13:01:58 +0000 Subject: [Image-SIG] 2nd Call for Papers | Extended deadline: April 07 | CENTERIS'2009 - Conference on ENTERprise Information Systems | 2nd Call for Papers Message-ID: <20090316141853.D98101E4002@bag.python.org> ------------- Please consider contributing to and/or forwarding to the appropriate groups and peers the following call for papers. (please excuse us if you received this call more than once) ------------- You are receiving this email because of your research activities on the conference topic. To unsubscribe please send an email to secretariat at centeris.eiswatch.org with the subject "Unsubscribe image-sig at python.org" ------------- ------------- CENTERIS?2009 | Call for Papers ------------- Conference on ENTERprise Information Systems ------------- Ofir, Portugal, 07-09 October 2009 http://centeris.eiswatch.org extended submission deadline (full paper): April 07, 2009 ------------- Dear Sirs, It is our great pleasure to invite you to the CENTERIS?2009 - Conference on ENTERprise Information Systems ? aligning technology, organizations and people, to be held in Ofir, Portugal, organized by the Polytechnic Institute of C?vado and Ave and the University of Tr?s-os-Montes e Alto Douro. This is the place where, from 07 to 09 October 2009, under the leitmotiv of Enterprise Information Systems, academics, scientists, IT/IS professionals, managers and solution providers from all over the world will have the opportunity to share experiences, bring new ideas, debate issues, introduce the latest developments in the field. CENTERIS?2009 is an international conference that will address the largely multidisciplinary field embraced by the Enterprise Information Systems (EIS), from the social, organizational and technological perspectives. The 3-day conference follows an innovative format, previewing scientific sessions, tutorial and technical sessions, and simultaneously exhibitions by solutions providers and product presentations. There will also be a social program that will enable participants to get to know each other and informally exchange information, contacts and experiences, discuss projects, and incubate partnerships. ------------- ------------- Submission and Publications Submissions will be reviewed on a double-blind review basis. Only original contributions will be accepted. All accepted papers will be published in the Conference Proceedings Book (full texts) with ISBN and on a CD-ROM to be distributed during the conference. Authors of a selection of around 25 papers will be invited for enhancing and extending their papers for inclusion in a book to be published by IGI-Global, to be released by early 2010. Depending on the number of high quality papers accepted, the Organization can consider the edition of two books, instead of one. According to the Scientific Committee recommendations, authors of selected papers will be invited to enhance the paper for publication in: - A Special Issue of the Information Resources Management Journal (IRMJ); - The International Journal of Enterprise Information Systems (IJEIS); - Journal of Theoretical and Applied Electronic Commerce Research (JTAER); - International Journal of Information Technologies and Systems Approach (IJITSA); - The emerging ?Information and Communication Technologies for the Advanced Enterprise: an international journal? (ICT'ae). At the end of this message you will find the composition of the Editorial Board. ------------- ------------- Hotel and travel arrangements The Conference will take place at AXIS OFIR Beach Resort Hotel in Ofir, Esposende, Portugal, a 4-star Hotel located in one of the most beautiful landscapes in the North of Portugal. The Atlantic coast of Esposende is part of the Natural Park of the North Coast, a protected area of great beauty. Ofir is located in a wonderful historic and cultural region with three locations/zones proclaimed as UNESCO cultural World Heritage within 100 km: Historic Centre of Guimaraes (50Km), Historic Centre of Porto (40Km) and Alto Douro Wine Region. The Hotel Axis Ofir is located 35 km north of the Oporto International Airport ?Francisco Sa Carneiro?. It is connected by the highway A28. We suggest getting a taxi which cost would be around 35 Euros (one way), taking less than 30 min to the Hotel. ------------- For more detailed information, please visit http://centeris.eiswatch.org We hope to see you in Ofir. Best wishes, Manuela Cunha Lu?s Amaral Jo?o Varaj?o ------------- General Chair Maria Manuela Cruz-Cunha (mcunha at ipca.pt) Polytechnic Institute of C?vado and Ave, Portugal ------------- Program Chair Lu?s Amaral (amaral at dsi.uminho.pt) University of Minho, Portugal ------------- Organization Chair Jo?o Eduardo Varaj?o (jvarajao at utad.pt) University of Tr?s-os-Montes e Alto Douro, Portugal ------------- Secretariat secretariat at centeris.eiswatch.org ------------- ------------- Editorial Board (This list is not complete as the invitation process is still going on) Adamantios Koumpis, Research Programmes Division, ALTEC S.A, Grece Adolfo Vanti, Universidade do Vale do Rio dos Sinos, Brasil Albert Boonstra, University of Groningen, The Netherlands Alberto Arroyo, Orienta, Spain Alexandra Klen, Universidade Federal de Santa Catarina, Brazil ?lvaro Rocha, University Fernando Pessoa, Portugal Ana Maria Fermoso Garcia, Pontifical University of Salamanca, Spain Anca Draghici, Politehnica University of Timisoara, Romania Andr?a Paiva, Universidade de S?o Paulo, Brazil Angappa Gunasekaran, University of Massachusetts Dartmouth, USA Antonio Guevara, University of Malaga, Spain Antonio Jos? Balloni, CTI, Brasil Ant?nio Trigo, Polytechnic Institute of Coimbra, Portugal Aysin Rahimifard, Loughborough University, UK Bart H.M. Gerritsen, TNO N. Org. for App. Scientific Research, The Netherlands Calin Gurau, GSCM ? Montpellier Business School, France Carlos Ferr?s Sexto, Universidad de Santiago de Compostela, Spain Carlos Machado-Santos, University of Tr?s-os-Montes e Alto, Portugal Carmen de Pablos, Rey Juan Carlos University, Spain Carola Jones, Universidad Nacional de C?rdoba, Argentina Carrillo Verd?n, Universidad Polit?cnica de Madrid, Spain Cesar Alexandre de Souza, University of Sao Paulo, Brazil Chad Lin, Curtin University of Technology, Australia Daniel L?bke, Leibniz University Hannover, Germany Dimitrios Koufopoulos, Brunel University, UK Dirk Schaefer, Georgia Institute of Technology Savannah, USA Dirk Werth, Institut f?r Wirtschaftsinformatik, Germany Dulce Domingos, University of Lisbon, Portugal Duminda Wijesekera, George Mason University, USA Edson Luiz Riccio, University of Sao Paulo, Brasil Efrem Mallach, University of Massachusetts Dartmouth, USA Eitel Lauria, Marist College, USA Enrique Paniagua Ar?s, Universidad de Murcia, Spain Ercan Oztemel, Marmara University, Turkey Esra Kurt Tekez, Sakarya University, Turkey Fahd Alizai, Victoria University Australia, Australia Filomena Lopes, Universidade Portucalense, Portugal Gabor Hosszu, Budpest University of Technology and Economics, Hungary George Ioannou, Athens Faculty of Economics and Business, Greece George Leal Jamil, FUMEC/BH, Brasil Giorgio Bruno, Politecnico di Torino, Italy Goran Putnik, University of Minho, Portugal Heiko Duin, BIBA Bremer Institut f?r Produktion und Logistik GmbH, Germany Henrique O?Neill, ISCTE, Portugal Igor Perko, University of Maribor, Slovenia llan Oshri, Rotterdam School of Management, The Netherlands Isabel Ramos, University of Minho, Portugal Ivanilde Eyng, UEPG/UNAM, Brasil Jaideep Motwani, Grand Valley State University, USA Jaime Munoz, Autonomous University of Aguascalientes, Mexico Jens Eschenb?cher, BIBA Bremer Institut f?r Produktion und Logistik, Germany Jerzy Kisielnicki, University of Warsaw, Poland Joao Barroso, University of Tr?s-os-Montes e Alto Douro, Portugal Joao Varajao, University of Tr?s-os-Montes e Alto Douro, Portugal Jorge Marx G?mez, Oldenburg University, Germany Jos? Bulas Cruz, University of Tr?s-os-Montes e Alto Douro, Portugal Jos? Carlos Metr?lho, Polytechnic Institute of Castelo Branco, Portugal Jos? L. Caro, University of Malaga, Spain Jos? L. Leiva, University of Malaga, Spain Jos? Luis Mota Pereira, University of Minho, Portugal Kam Hou Vat, University of Macau, Macau Klara Antlova, Technical university of Liberec, Czech republic Leonardo Soto, University of Guadalajara, Mexico Leonel Santos, University of Minho, Portugal Lorna Uden, Staffordshire University, UK Lu?s Amaral, University of Minho, Portugal Lu?s Borges Gouveia, University Fernando Pessoa, Portugal Mahesh S. Raisinghani, Texas Woman's University, USA Malihe Tabatabaie, University of York, UK Manuel Filipe Santos, University of Minho, Portugal Manuel Jo?o Pereira, Universidade Cat?lica, Portugal Manuel Mora, Autonomous University of Aguascalientes, Mexico Manuel P?rez Cota, Universidad de Vigo, Spain Maria Argyropoulou, Brunel University, UK Maria Manuela Cruz-Cunha, Polytechnic Institute of C?vado and Ave, Portugal Marco Kuhrmann, Technische Universit?t M?nchen, Germany Marilisa Oliveira, UEPG/UNAM, Brazil Marko Kolakovic, University of Zagreb, Croatia M?rio Caldeira, Technical University of Lisbon, Portugal Mayumi Hori, Hakuoh University, Japan Michal ?emlicka, Charles University, Czech Republic Mirjana Stojanovic, University of Belgrade, Serbia Narciso Cerpa, University of Talca, Chile Ovsei Gelman, CCADET-UNAM, Mexico ?zalp Vayvay, Faculty of Engineering Marmara University, Turkey Ozden Ustun, Dumlupinar University, Turkey Patr?cia Gon?alves, Polytechnic Institute of C?vado and Ave, Portugal Paulo Martins, University of Tr?s-os-Montes e Alto Douro, Portugal Paula Morais, Universidade Portucalense, Portugal Paulo Rupino, University of Coimbra, Portugal Paulo Tom?, Polytechnic Institute of Viseu, Portugal Pedro Ara?jo, University of Beira Interior, Portugal Pedro Campos, University of Porto, Portugal Pedro Quelhas de Brito, University of Porto, Portugal Pedro Ribeiro, University of Minho, Portugal Pedro Soto Acosta, Universidad de Murcia, Spain Polo, University of Sao Paulo, Brasil Protogeros Nicolaos, University of Macedonia Economic and Social Scs., Greece Ramiro Gon?alves, University of Tr?s-os-Montes e Alto Douro, Portugal Ricardo Colomo Palacios, University Carlos III of Madrid, Spain Ricardo Gon?alves, Universidade Nova de Lisboa, Portugal Ricardo Simoes, Polytechnic Institute of C?vado and Ave, Portugal Richard Burkhard, San Jose State University, USA Rinaldo Michelini, PMAR Lab of the University of Genova, Italy Roberto Razzoli, PMAR Lab of the University of Genova, Italy Rui Dinis Sousa, University of Minho, Portugal Rui Pedro Rijo, Polytechnic Institute of Leiria, Portugal Samo Bobek, University of Maribor, Slovenia Sanja Vranes, The Mihajlo Pupin Institute, Serbia Simona Sternad, University of Maribor, Slovenia Snezana Pantelic, The Mihajlo Pupin Institute, Serbia Subhasish Dasgupta, George Washington University, USA Tahinakis Panayiotis, University of Macedonia Economic and Social Scs., Greece Valentina Janev, The Mihajlo Pupin Institute, Serbia Vladanka Acimovic-Raspopovic, University of Belgrade, Serbia Vitor Basto Fernandes, Polytechnic Institute of Leiria, Portugal V?tor Carvalho, Polytechnic Institute of C?vado and Ave, Portugal V?tor Santos, Microsoft, Portugal Vladim?r Modr?k, Technical University of Kosice, Slovakia Vojko Potocan, University of Maribor, Slovenia Wai Ming Cheung, University of Bath, UK From mark.wendell at gmail.com Mon Mar 16 15:09:48 2009 From: mark.wendell at gmail.com (Mark Wendell) Date: Mon, 16 Mar 2009 08:09:48 -0600 Subject: [Image-SIG] ImageMath power-function error In-Reply-To: <368a5cd50903160705u6477a226vba79e40f0e6cf420@mail.gmail.com> References: <368a5cd50903160705u6477a226vba79e40f0e6cf420@mail.gmail.com> Message-ID: Hmm. The 1.1.6 docs for the ImageMath module say "The module also supports unary minus (-), modulo (%), and power (**) operators." Still, if not, looking forward to having the functionality in 1.1.7. thanks Mark On Mon, Mar 16, 2009 at 8:05 AM, Fredrik Lundh wrote: > No time to double-check, but I suspect the 1.1.6 version doesn't > support ** - it's mentioned in the documentation, but I don't see any > sign of it in the source code. It's on my list of things to fix for > 1.1.7. > > > > 2009/3/15 Mark Wendell : > > Hey all, > > > > I can't seem to use the power ("**") operator in the ImageMath module. > > > > > > For example, multiplying an L-mode image by a factor of 2.0 works fine: > > > >>>> out = ImageMath.eval( "convert( ( a*val ), 'L')", a=im, val=2.0) > > (no errors) > > > > However, raising the same image by a power of 2.0 generates a bad operand > > type error: > > > >>>> out = ImageMath.eval( "convert( ( a**val ), 'L')", a=im, val=2.0) > > Traceback (most recent call last): > > File "", line 1, in > > File "/usr/lib/python2.5/site- > > packages/PIL/ImageMath.py", line 203, in eval > > out =__builtin__.eval(expression, args) > > File "", line 1, in > > File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 119, in > > __pow__ > > return self.apply("pow", self, other) > > File "/usr/lib/python2.5/site-packages/PIL/ImageMath.py", line 82, in > > apply > > raise TypeError, "bad operand type for '%s'" % op > > TypeError: bad operand type for 'pow' > > > > > > Am I making a silly mistake? > > > > thanks in advance, > > Mark > > > > Ubuntu 8.10 linux, python 2.5.2, Pil 1.1.6 > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > > > -- -- Mark Wendell mark.wendell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From irgendetwas at charlie.at Tue Mar 17 09:00:03 2009 From: irgendetwas at charlie.at (charlie) Date: Tue, 17 Mar 2009 09:00:03 +0100 Subject: [Image-SIG] [raclette] 1.1.7 status In-Reply-To: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> References: <368a5cd50903131622s698b57duafbca79ba5483863@mail.gmail.com> Message-ID: <37554e120903170100r211c0090qe4a05734d9a5a2f3@mail.gmail.com> Hi Fredrik, would you consider Eric's patch: http://mail.python.org/pipermail/image-sig/2007-March/004359.html for supporting multiple instances of a tag in the iptc info (ie 2:25 keywords) thanks in advance charlie On Sat, Mar 14, 2009 at 12:22 AM, Fredrik Lundh wrote: >> It's the same fix as this one, right? > > By the way, here's a rough version history for the current 1.1.7 > snapshot available from here: > > ? ?http://bitbucket.org/effbot/pil-2009-raclette/src/874f7005c34c/ > > Let me know if I've missed some patch that absolutely should go into > 1.1.7, or some bug that absolutely needs to be fixed. > > cheers /F > > === changes in PIL 1.1.7 as of 2009-03-13 === > > Added version attributes to jpeg/zlib/littlecms/freetype bindings, for > debugging. > > Added (experimental) ImageCms function for fetching the ICC profile > for the current display (currently Windows only). > > ?Added HWND/HDC support to ImageCms.get_display_profile(). > > Added WMF renderer (Windows only). > > Added ImagePointHandler and ImageTransformHandler mixins; made > ImageCmsTransform work with im.point. > > Fixed potential endless loop in the XVThumbnail reader (from Nikolai > Ugelvik). > > Added Kevin Cazabon's pyCMS package. > > ?The C code has been moved to _imagingcms.c, the Python interface > ?module is installed as PIL.ImageCMS. > > ?Added support for in-memory ICC profiles. > > ?Unified buildTransform and buildTransformFromOpenProfiles. > > ?The profile can now be either a filename, a profile object, or a > ?file-like object containing an in-memory profile. > > ?Additional fixes from Florian B?ch: > > ? ?Very nice - it just needs LCMS flags support so we can use black > ? ?point compensation and softproofing :) See attached patches. ?They > ? ?also fix a naming issue which could cause confusion - display > ? ?profile (ImageCms wording) actually means proof profile (lcms > ? ?wording), so I changed variable names and docstrings where > ? ?applicable. Patches are tested under Python 2.6. > > Improved support for layer names in PSD files (from Sylvain Baubeau) > > ?Sylvain writes: I needed to be able to retrieve the names of the > ?layers in a PSD files. But PsdImagePlugin.py didn't do the job so I > ?wrote this very small patch. > > Improved RGBA support for ImageTk for 8.4 and newer (from Con Radchenko). > > ?This replaces the slow run-length based encoding model with true > ?compositing at the Tk level. > > Added support for 16- and 32-bit images to McIdas loader. > > ?Based on file samples and stand-alone reader code provided by Craig > ?Swank. > > Added ImagePalette support to putpalette. > > Fixed problem with incremental parsing of PNG files. > > Make selftest.py report non-zero status on failure (from Mark Sienkiewicz) > > Add big endian save support and multipage infrastructure to the TIFF > writer (from Sebastian Haase). > > Added zTXT support (from Andrew Kuchling via Lowell Alleman). > > Fixed potential infinite loop bug in ImageFont (from Guilherme Polo). > > Added sample ICC profiles (from Kevin Cazabon) > > Fixed array interface for I, F, and RGBA/RGBX images. > > Added Chroma subsampling support for JPEG (from Justin Huff). > > ?Justin writes: Attached is a patch (against PIL 1.1.6) to provide > ?control over the chroma subsampling done by the JPEG encoder. ?This > ?is often useful for reducing compression artifacts around edges of > ?clipart and text. > > Added USM/Gaussian Blur code from Kevin Cazabon. > > Fixed bug w. uninitialized image data when cropping outside the source image. > > Use ImageShow to implement the Image.show method. > > ?Most notably, this picks the 'display' utility when available. ?It > ?also allows application code to register new display utilities via > ?the ImageShow registry. > > Release the GIL in the PNG compressor (from Michael van Tellingen). > > Revised JPEG CMYK handling. > > ?Always assume Adobe behaviour, both when reading and writing (based on > ?a patch by Kevin Cazabon, and test data by Tim V. and Charlie Clark). > > Support for preserving ICC profiles (by Florian B?ch via Tim Hatch). > > ?Florian writes: > > ?It's a beta, so still needs some testing, but should allow you to: > ?- retain embedded ICC profiles when saving from/to JPEG, PNG, TIFF. > ? ? Existing code doesn't need to be changed. > ?- access embedded profiles in JPEG, PNG, PSD, TIFF. > > ?It also includes patches for TIFF to retain IPTC, Photoshop and XMP > ?metadata when saving as TIFF again, read/write TIFF resolution > ?information correctly, and to correct inverted CMYK JPEG files. > > Fixed potential memory leak in median cut quantizer (from Evgeny Salmin). > > Fixed OverflowError when reading upside-down BMP images. > > Added resolution save option for PDF files. > > ?Andreas Kostyrka writes: I've included a patched PdfImagePlugin.py > ?based on 1.1.6 as included in Ubuntu, that supports a "resolution" > ?save option. Not great, but it makes the PDF saving more useful by > ?allowing PDFs that are not exactly 72dpi. > > Look for Tcl/Tk include files in version-specific include directory > (from Encolpe Degoute). > > Fixed grayscale rounding error in ImageColor.getcolor (from Tim > Hatch). > > Fixed truetype positioning when first character has a negative left > bearing (from Ned Batchelder): > > ?Ned writes: In PIL 1.1.6, ImageDraw.text will position the string > ?incorrectly if the first character has a negative left bearing. ?To > ?see the problem, show a string like "///" in an italic font. ?The > ?first slash will be clipped at the left, and the string will be > ?mis-positioned. > > Fixed resolution unit bug in tiff reader/writer (from Florian H?ch, > Gary Bloom, and others). > > Added simple transparency support for RGB images (reported by > Sebastian Spaeth). > > Added support for Unicode filenames in ImageFont.truetype (from Donn > Ingle). > > Fixed potential crash in ImageFont.getname method (from Donn Ingle). > > Fixed encoding issue in PIL/WalImageFile (from Santiago M. Mola). > > === end === > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From Chris.Barker at noaa.gov Tue Mar 17 17:28:42 2009 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 17 Mar 2009 09:28:42 -0700 Subject: [Image-SIG] ImageMath power-function error In-Reply-To: References: <368a5cd50903160705u6477a226vba79e40f0e6cf420@mail.gmail.com> Message-ID: <49BFCFBA.1000407@noaa.gov> Mark Wendell wrote: > Still, if not, looking forward to having the functionality in 1.1.7. Another option is to convert to a numpy array, and do your math there -- you'll get full featured math that way. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From fredrik at pythonware.com Tue Mar 17 22:22:01 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 17 Mar 2009 22:22:01 +0100 Subject: [Image-SIG] ANN: PIL 1.1.7 alpha 1 (March 17, 2009) Message-ID: <368a5cd50903171422n79229f9dpf76fa19e772bbcd9@mail.gmail.com> The first official alpha of PIL 1.1.7 is now available; you can get source archives from http://bitbucket.org/effbot/pil-2009-raclette/src/pil-117-20090317 (use the download >> menu in the right corner). Alternatively, you can check out the alpha using Mercurial: $ hg clone -r pil-117-20090317 http://bitbucket.org/effbot/pil-2009-raclette/ or Subversion: $ svn co http://svn.effbot.org/public/tags/pil-1.1.7a1-20090317/ (note that the main HG repo contains a few odd heads and most likely a bunch of changes done after the alpha was cut) I hope to have (some) Windows builds available early next week, at the latest. From ktenney at gmail.com Wed Mar 18 14:43:02 2009 From: ktenney at gmail.com (Kent Tenney) Date: Wed, 18 Mar 2009 08:43:02 -0500 Subject: [Image-SIG] png.save() and tEXt chunks Message-ID: Howdy, I work with png's which have tEXt chunks containing metadata. PIL discards them upon open .. save. Might it be desirable for core save() to check for extra chunks and preserve them if found? Thanks, Kent From fetchinson at googlemail.com Thu Mar 19 02:39:12 2009 From: fetchinson at googlemail.com (Daniel Fetchinson) Date: Wed, 18 Mar 2009 18:39:12 -0700 Subject: [Image-SIG] Python 3 support In-Reply-To: <802770.33034.qm@web52107.mail.re2.yahoo.com> References: <802770.33034.qm@web52107.mail.re2.yahoo.com> Message-ID: > I just joined the mailing list. > > I want to know if PIL will ever support Python 3. I am slowly migrating my > applications on Python 3 and i really need PIL. > It's not good to have half of my apps in Py 2.x and the rest in Py 3.x :) > > Thank you in advance. Please see the thread http://mail.python.org/pipermail/python-dev/2009-March/087317.html HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown From fredrik at pythonware.com Thu Mar 19 09:31:32 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 19 Mar 2009 09:31:32 +0100 Subject: [Image-SIG] Python 3 support In-Reply-To: <802770.33034.qm@web52107.mail.re2.yahoo.com> References: <802770.33034.qm@web52107.mail.re2.yahoo.com> Message-ID: <368a5cd50903190131x76071323tf3f1fdf1c3a3eca4@mail.gmail.com> The plan is to get 1.1.7 out of the door (early april) and then make a version of that available for 3.x. There's also a preliminary port of 1.1.6 available from a third party; see the mailing list archives for pointers. Cheers /F On Mar 14, 2009 12:06 AM, "Cristi Constantin" wrote: Good day. I just joined the mailing list. I want to know if PIL will ever support Python 3. I am slowly migrating my applications on Python 3 and i really need PIL. It's not good to have half of my apps in Py 2.x and the rest in Py 3.x :) Thank you in advance. _______________________________________________ Image-SIG maillist - Image-SIG at python.org http://mail.python.org/mailman/listinfo/image-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Thu Mar 19 09:40:08 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 19 Mar 2009 09:40:08 +0100 Subject: [Image-SIG] png.save() and tEXt chunks In-Reply-To: References: Message-ID: <368a5cd50903190140o7c44c489n8b7c0305b299a392@mail.gmail.com> The current driver stores the tags in the info dictionary which is just a collection of random stuff found by the format driver. Since that can contain anything, including properties that depend on the image size or contents, it's not preserved by internal operations, and not used by default when saving an image. The upcoming 1.1.7 release will improve things a bit; data from text chunks are now mirrored in a separate dictionary, and I will add a text option to the save method. On Mar 18, 2009 2:43 PM, "Kent Tenney" wrote: Howdy, I work with png's which have tEXt chunks containing metadata. PIL discards them upon open .. save. Might it be desirable for core save() to check for extra chunks and preserve them if found? Thanks, Kent _______________________________________________ Image-SIG maillist - Image-SIG at python.org http://mail.python.org/mailman/listinfo/image-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggpolo at gmail.com Thu Mar 19 12:20:21 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Thu, 19 Mar 2009 08:20:21 -0300 Subject: [Image-SIG] Python 3 support In-Reply-To: <368a5cd50903190131x76071323tf3f1fdf1c3a3eca4@mail.gmail.com> References: <802770.33034.qm@web52107.mail.re2.yahoo.com> <368a5cd50903190131x76071323tf3f1fdf1c3a3eca4@mail.gmail.com> Message-ID: 2009/3/19 Fredrik Lundh : > The plan is to get 1.1.7 out of the door (early april) and then make a > version of that available for 3.x. There's also a preliminary port of 1.1.6 > available from a third party; see the mailing list archives for pointers. > I hope to not cause even more confusion by replying here. I believe the preliminary port to 1.1.6 Fredrik is talking about is the one I provide. The link Cristi pointed also ends up pointing to my port, where he said that cloning the git repo fails for him. So I moved the git repo from my home to github today, you can clone it by doing: git clone git://github.com/gpolo/pil-py3k.git and to see the repo online you can visit: http://github.com/gpolo/pil-py3k Hopefully this makes easier for you all to use, test and make it perfect (:)) > Cheers /F > Regards, -- -- Guilherme H. Polo Goncalves From darkgl0w at yahoo.com Thu Mar 19 19:28:46 2009 From: darkgl0w at yahoo.com (Cristi Constantin) Date: Thu, 19 Mar 2009 11:28:46 -0700 (PDT) Subject: [Image-SIG] Python 3 support Message-ID: <97281.95224.qm@web52103.mail.re2.yahoo.com> Thank you very much for your answers. I will wait for PIL 1.1.7 quietly. :) Have a nice day. -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie at begeistert.org Thu Mar 19 20:50:47 2009 From: charlie at begeistert.org (Charlie Clark) Date: Thu, 19 Mar 2009 20:50:47 +0100 Subject: [Image-SIG] Python 3 support In-Reply-To: <97281.95224.qm@web52103.mail.re2.yahoo.com> References: <97281.95224.qm@web52103.mail.re2.yahoo.com> Message-ID: <538483ED-D576-4633-8B36-F0555C7920DF@begeistert.org> Am 19.03.2009 um 19:28 schrieb Cristi Constantin: > Thank you very much for your answers. > I will wait for PIL 1.1.7 quietly. :) While I think a lot of people would love to see a rapid migration to Python 3, it is a lot of work for many libraries (anything written in C) and, therefore, for the people who maintain them. In the meantime I think it is reasonable to expect users to target Python 2.6 which should encourage more Python 3.0 stuff without breaking important aspects of backward compatability for many projects. Charlie -- Charlie Clark Helmholtzstr. 20 D?sseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 From ggpolo at gmail.com Thu Mar 19 21:31:15 2009 From: ggpolo at gmail.com (Guilherme Polo) Date: Thu, 19 Mar 2009 17:31:15 -0300 Subject: [Image-SIG] Python 3 support In-Reply-To: <538483ED-D576-4633-8B36-F0555C7920DF@begeistert.org> References: <97281.95224.qm@web52103.mail.re2.yahoo.com> <538483ED-D576-4633-8B36-F0555C7920DF@begeistert.org> Message-ID: On Thu, Mar 19, 2009 at 4:50 PM, Charlie Clark wrote: > > Am 19.03.2009 um 19:28 schrieb Cristi Constantin: > >> Thank you very much for your answers. >> I will wait for PIL 1.1.7 quietly. :) > > > While I think a lot of people would love to see a rapid migration to Python > 3, it is a lot of work for many libraries (anything written in C) I see the issue other way around, it is more troublesome to update pure python code to 3.x than to port the C part. > and, > therefore, for the people who maintain them. In the meantime I think it is > reasonable to expect users to target Python 2.6 which should encourage more > Python 3.0 stuff without breaking important aspects of backward > compatability for many projects. > > Charlie > -- > Charlie Clark > Helmholtzstr. 20 > D?sseldorf > D- 40215 > Tel: +49-211-938-5360 > GSM: +49-178-782-6226 > > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- -- Guilherme H. Polo Goncalves From fetchinson at googlemail.com Thu Mar 19 21:43:37 2009 From: fetchinson at googlemail.com (Daniel Fetchinson) Date: Thu, 19 Mar 2009 13:43:37 -0700 Subject: [Image-SIG] Python 3 support In-Reply-To: References: <802770.33034.qm@web52107.mail.re2.yahoo.com> <368a5cd50903190131x76071323tf3f1fdf1c3a3eca4@mail.gmail.com> Message-ID: >> The plan is to get 1.1.7 out of the door (early april) and then make a >> version of that available for 3.x. There's also a preliminary port of >> 1.1.6 >> available from a third party; see the mailing list archives for pointers. >> > > I hope to not cause even more confusion by replying here. > > I believe the preliminary port to 1.1.6 Fredrik is talking about is > the one I provide. The link Cristi pointed also ends up pointing to my > port, where he said that cloning the git repo fails for him. So I > moved the git repo from my home to github today, you can clone it by > doing: git clone git://github.com/gpolo/pil-py3k.git and to see the > repo online you can visit: http://github.com/gpolo/pil-py3k Actually, it turns out that the reason I could not check out your port from the previous repo had to do with my laptop connection, proxies, firewall, or what not. I could not check out from github either, but when trying from another computer it all worked, so maybe your previous repo would have worked either. Sorry about that. Anyway, now I got the code and will start testing it over the weekend. Cheers, Daniel > Hopefully this makes easier for you all to use, test and make it perfect > (:)) > >> Cheers /F -- Psss, psss, put it down! - http://www.cafepress.com/putitdown From michaelvantellingen at gmail.com Tue Mar 24 09:54:07 2009 From: michaelvantellingen at gmail.com (Michael van Tellingen) Date: Tue, 24 Mar 2009 09:54:07 +0100 Subject: [Image-SIG] [raclette] that JPEG CMYK thing, again In-Reply-To: <368a5cd50903061626y68cd64f9u1615b8ab9564081a@mail.gmail.com> References: <368a5cd50903061626y68cd64f9u1615b8ab9564081a@mail.gmail.com> Message-ID: On Sat, Mar 7, 2009 at 01:26, Fredrik Lundh wrote: > Thanks to Tim and Charlie, I now have a set of nice Photoshop CMYK > samples to play with. The first result is a revamp of Kevin's CMYK > patch; I'm now doing the inversion at the codec levels, both when > reading and writing. Also, the code *always* assumes Adobe behaviour, > in both directions. The current version of the plugin is here: > > > http://bitbucket.org/effbot/pil-2009-raclette/src/e351bc0228c4/PIL/JpegImagePlugin.py > > I *think* this does the right thing, but I'm not 100% sure. In other > words, it would be helpful if those of you who've struggled with CMYK > stuff can take this version for a test drive; it should work just fine > together with a standard 1.1.6. > Hi Fredrik, I've just tested my application with the PIL 1.1.7 tip and latest alpha and still have problems with the conversion from CMYK jpeg to RGB. The test images mailed earlier on this mailinglist (black background with the text 'RED') somehow become yellow on my system (python 2.5 / osx leopard). (this worked fine with the earlier patches I used for 1.1.6 from Kevin Cazabon) The output of the pil setup summary: -------------------------------------------------------------------- PIL 1.1.7a0 SETUP SUMMARY -------------------------------------------------------------------- version 1.1.7a0 platform darwin 2.5.1 (r251:54863, Jan 13 2009, 10:26:13) [GCC 4.0.1 (Apple Inc. build 5465)] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available --- LITTLECMS support available -------------------------------------------------------------------- I have a couple of photos with which i have the problems. I could mail you these directly if you want. Thanks, Michael > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan at hideawaystudios.com Tue Mar 24 17:15:18 2009 From: bryan at hideawaystudios.com (Bryan Jeal) Date: Tue, 24 Mar 2009 10:15:18 -0600 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file Message-ID: <1175B076-BA92-40F4-AF2A-BA5AC98887DA@hideawaystudios.com> Hello, GOAL: Have a website built on the Django framework running under Windows Server 2003 (Apache with mod_python and MySQL) be able to upload pictures and then create a tinted thumbnail using PIL. I have all the code working and I have everything (python, PIL, django, apache and MySQL) setup and working on a linux machine; however, I HAVE to get it working on Windows. PROBLEM: PIL with Jpeg support on Windows... After much fighting with the Jpeg Library and PIL here is what I have accomplished: Step 1: From Windows: Install python-2.5.4.msi with default settings, install Mingw32 and install Cygwin Step 2: Start Cygwin and extract, './configure --enable-shared -- enable-static CC="gcc -mno-cygwin" CXX="gcc -mno-cygwin"', make, make - n install, make -n install-lib for jpeg-6b and extract, ./configure, make, make install for zlib Step 3: From Windows: extract Imaging-1.1.6.tar.gz and edit setup.py to point to jpeg-6b and zlib library locations (ex. JPEG_ROOT = "C:\ \cygwin\\usr\\local\\src\\jpeg-6b\\.libs") Step 4: From Windows: 'python setup.py build -c mingw32 install' the Imaging 1.1.6 package Step 5: From Windows: 'python selftest.py' (NOTE: When building Imaging 1.1.6 jpeg and zlib support are OK) 57 tests passed for Imaging 1.1.6 package Step 6: From Windows: 'python' then: >>> import Image >>> im = Image.open('c:/temp/testimage.jpg') >>> im.size[0] (result: 932) >>> tmpFile = open('C:/temp/temp_win.jpg', 'w') >>> im.save(tmpFile, 'JPEG', quality=90) (result: See Below) Traceback (most recent call last): File "", line 1, in File "C:\Python25\lib\site-packages\PIL\Image.py", line 1405, in save save_handler(self, fp, filename) File "C:\Python25\lib\site-packages\PIL\JpegImagePlugin.py", line 409, in _save ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) File "C:\Python25\lib\site-packages\PIL\ImageFile.py", line 491, in _save s = e.encode_to_file(fh, bufsize) IOError: [Errno 0] Error After finally getting over the _imaging C module is not installed (even though an _imaging.dll existed - Python2.5 seems to only like _imaging.pyd) and successfully opening and reading a JPEG (I had numerous other errors when I tried to get this working before) file I am so very lost. Please help! Sincerely, Bryan From cannon.el at gmail.com Tue Mar 24 18:13:25 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Tue, 24 Mar 2009 10:13:25 -0700 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <1175B076-BA92-40F4-AF2A-BA5AC98887DA@hideawaystudios.com> References: <1175B076-BA92-40F4-AF2A-BA5AC98887DA@hideawaystudios.com> Message-ID: there are windows binary packages for both python and PIL available (http://www.pythonware.com/products/pil/) and I have used these on XP and Vista for years with 0 problem. I don't need Cygwin or Mingw32 or anything else, just install the python and then install the binary. I do jpeg all the time. On Tue, Mar 24, 2009 at 9:15 AM, Bryan Jeal wrote: > Hello, > > GOAL: Have a website built on the Django framework running under Windows > Server 2003 (Apache with mod_python and MySQL) be able to upload pictures > and then create a tinted thumbnail using PIL. I have all the code working > and I have everything (python, PIL, django, apache and MySQL) setup and > working on a linux machine; however, I HAVE to get it working on Windows. > > PROBLEM: PIL with Jpeg support on Windows... > > After much fighting with the Jpeg Library and PIL here is what I have > accomplished: > > Step 1: From Windows: Install python-2.5.4.msi with default settings, > install Mingw32 and install Cygwin > > Step 2: Start Cygwin and extract, './configure --enable-shared > --enable-static CC="gcc -mno-cygwin" CXX="gcc -mno-cygwin"', make, make -n > install, make -n install-lib for jpeg-6b and extract, ./configure, make, > make install for zlib > > Step 3: From Windows: extract Imaging-1.1.6.tar.gz and edit setup.py to > point to jpeg-6b and zlib library locations (ex. JPEG_ROOT = > "C:\\cygwin\\usr\\local\\src\\jpeg-6b\\.libs") > > Step 4: From Windows: 'python setup.py build -c mingw32 install' the Imaging > 1.1.6 package > > Step 5: From Windows: 'python selftest.py' (NOTE: When building Imaging > 1.1.6 jpeg and zlib support are OK) 57 tests passed for Imaging 1.1.6 > package > > Step 6: From Windows: 'python' then: > ?>>> import Image > ?>>> im = Image.open('c:/temp/testimage.jpg') > ?>>> im.size[0] > ? ? ? ? ? ? (result: 932) > ?>>> tmpFile = open('C:/temp/temp_win.jpg', 'w') > ?>>> im.save(tmpFile, 'JPEG', quality=90) ? ? ? ? ? ? ? ? ? ? ? (result: See > Below) > Traceback (most recent call last): > ?File "", line 1, in > ?File "C:\Python25\lib\site-packages\PIL\Image.py", line 1405, in save > ? ?save_handler(self, fp, filename) > ?File "C:\Python25\lib\site-packages\PIL\JpegImagePlugin.py", line 409, in > _save > ? ?ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) > ?File "C:\Python25\lib\site-packages\PIL\ImageFile.py", line 491, in _save > ? ?s = e.encode_to_file(fh, bufsize) > IOError: [Errno 0] Error > > After finally getting over the _imaging C module is not installed (even > though an _imaging.dll existed - Python2.5 seems to only like _imaging.pyd) > and successfully opening and reading a JPEG (I had numerous other errors > when I tried to get this working before) file I am so very lost. Please > help! > > Sincerely, > > Bryan > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From Scott.Daniels at Acm.Org Tue Mar 24 19:00:12 2009 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Tue, 24 Mar 2009 11:00:12 -0700 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <1175B076-BA92-40F4-AF2A-BA5AC98887DA@hideawaystudios.com> References: <1175B076-BA92-40F4-AF2A-BA5AC98887DA@hideawaystudios.com> Message-ID: Bryan Jeal wrote: ... > After finally getting over the _imaging C module is not installed (even > though an _imaging.dll existed - Python2.5 seems to only like > _imaging.pyd) and successfully opening and reading a JPEG (I had > numerous other errors when I tried to get this working before) file I am > so very lost. Please help! Laura & Edward Cannon told you the simplest way in general. However, if you rename you _imaging.dll to be _imaging.pyd, your troubles may also be over. Because Microsoft has been trying to increase their security by changing the rules about when dlls can be loaded (no doubt due to some exciting virii), Python has switched to using .pyd for the name of python dlls. --Scott David Daniels Scott.Daniels at Acm.Org From fredrik at pythonware.com Tue Mar 24 19:40:04 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 24 Mar 2009 19:40:04 +0100 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: References: <1175B076-BA92-40F4-AF2A-BA5AC98887DA@hideawaystudios.com> Message-ID: <368a5cd50903241140t5ba8de3cr6fb10c128540670c@mail.gmail.com> Footnote: I'm pretty sure that the main reason for the renaming was that we ended up with things like a binding called "zlib.dll" to a low-level library named "zlib.dll". See e.g. this excerpt from a ten-year old copy of PC/readme.txt that I had lying around: /.../ The output file should be called "spam.dll" or "spam.pyd" (the latter is supported to avoid confusion with a system library "spam.dll" to which your module could be a Python interface) in Release mode, or spam_d.dll or spam_d.pyd in Debug mode. Recent versions of Python no longer support importing DLL:s directly; you can use imp.get_suffixes() to see what extensions a specific build supports; here's Python 2.5: >>> import imp >>> imp.get_suffixes() [('.pyd', 'rb', 3), ('.py', 'U', 1), ('.pyw', 'U', 1), ('.pyc', 'rb', 2)] >>> On Tue, Mar 24, 2009 at 7:00 PM, Scott David Daniels wrote: > Bryan Jeal wrote: > ... >> >> After finally getting over the _imaging C module is not installed (even >> though an _imaging.dll existed - Python2.5 seems to only like _imaging.pyd) >> and successfully opening and reading a JPEG (I had numerous other errors >> when I tried to get this working before) file I am so very lost. Please >> help! > > Laura & Edward Cannon told you the simplest way in general. > However, if you rename you _imaging.dll to be _imaging.pyd, your > troubles may also be over. ?Because Microsoft has been trying to > increase their security by changing the rules about when dlls can > be loaded (no doubt due to some exciting virii), Python has > switched to using .pyd for the name of python dlls. > > --Scott David Daniels > Scott.Daniels at Acm.Org > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From fredrik at pythonware.com Wed Mar 25 01:09:53 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 25 Mar 2009 01:09:53 +0100 Subject: [Image-SIG] [raclette] that JPEG CMYK thing, again In-Reply-To: References: <368a5cd50903061626y68cd64f9u1615b8ab9564081a@mail.gmail.com> Message-ID: <368a5cd50903241709l345917e3l49b38e030ed6dd22@mail.gmail.com> On Tue, Mar 24, 2009 at 9:54 AM, Michael van Tellingen wrote: > I've just tested my application with the PIL 1.1.7 tip and latest alpha and > still have problems with the conversion from CMYK jpeg to RGB. > The test images mailed earlier on this mailinglist (black background with > the text 'RED') somehow become yellow on my system (python 2.5 / osx > leopard). Yeah, I completely messed this one up. One crucial change didn't make it into the library, and embarrasingly enough, I then went on to make the JPEG regression test look for the broken behaviour... Here's the missing patch: $ hg diff libImaging/JpegDecode.c diff -r f17d08c18ab3 libImaging/JpegDecode.c --- a/libImaging/JpegDecode.c Mon Mar 23 12:51:13 2009 +0100 +++ b/libImaging/JpegDecode.c Wed Mar 25 01:04:59 2009 +0100 @@ -189,7 +189,8 @@ context->cinfo.out_color_space = JCS_GRAYSCALE; else if (strcmp(context->rawmode, "RGB") == 0) context->cinfo.out_color_space = JCS_RGB; - else if (strcmp(context->rawmode, "CMYK") == 0) + else if (strcmp(context->rawmode, "CMYK") == 0 || + strcmp(context->rawmode, "CMYK;I") == 0) context->cinfo.out_color_space = JCS_CMYK; else if (strcmp(context->rawmode, "YCbCr") == 0) context->cinfo.out_color_space = JCS_YCbCr; Thanks /F From wgl0960 at hotmail.com Wed Mar 25 05:11:52 2009 From: wgl0960 at hotmail.com (frankwong) Date: Wed, 25 Mar 2009 04:11:52 +0000 Subject: [Image-SIG] I really need help for converting several still PNG images to an animated GIF.. Message-ID: I really need help for converting several still PNG images to an animated GIF.. Hello everyone, I need to convert several PNG images to an animated GIF. I searched a lot on the internet. And I found the script: gifmaker.py(http://svn.effbot.org/public/pil/Scripts/gifmaker.py) But I can not use it .. I drew several images for programming:(http://cid-a499a3cc7eaad0ae.skydrive.live.com/browse.aspx/HI%7C_PYTHON) There are 8 still PNG files and 1 animated GIF made by another software. Could anyone help me to convert these 8 still PNG images to animated GIF by PYTHON SCRIPT? Thank you.. I really need help. Thank you. BTW, My English is not good.. Frank wong.. _________________________________________________________________ MSN??????????????????MSN??? http://im.live.cn/safe/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan at hideawaystudios.com Wed Mar 25 16:30:08 2009 From: bryan at hideawaystudios.com (Bryan Jeal) Date: Wed, 25 Mar 2009 09:30:08 -0600 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file Message-ID: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> Here is an update: 1. I removed Python and PIL from the system and reinstalled them (for PIL I used PIL-1.1.6.win32-py2.5.exe); however, it isn't working correctly... The image I have loaded, resized and saved using PIL-1.1.6.win32- py2.5.exe. Has this error when viewing the JPEG: Corrupt JPEG data: 3 extraneous bytes before marker 0xdb Images and code are here: http://test.hideawaystudios.com/testing/index.html 2. I then removed Python and PIL again and installed python and built PIL from source. I then renamed _imaging.dll to _imaging.pyd and below is the error. >>> import _imaging Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: The specified module could not be found. Basically I am still lost... Any other ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Wed Mar 25 16:38:34 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 25 Mar 2009 16:38:34 +0100 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> References: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> Message-ID: <368a5cd50903250838m16372eaem21c751727f8f4fa4@mail.gmail.com> 2009/3/25 Bryan Jeal : > Here is an update: > > 1. > I removed Python and PIL from the system and reinstalled them (for PIL I > used PIL-1.1.6.win32-py2.5.exe); however, it isn't working correctly... I'm not sure why you think you need to open the output file yourself, but if you do, you need to tell Python that it's a binary file. Changing tmpFile = open('C:/temp/temp_win.jpg', 'w') to tmpFile = open('C:/temp/temp_win.jpg', 'wb') or, easier, changing the save call to im.save("c/temp/temp_win.jpg", 'JPEG', quality=90) will fix this. From cannon.el at gmail.com Wed Mar 25 16:45:44 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Wed, 25 Mar 2009 08:45:44 -0700 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <368a5cd50903250838m16372eaem21c751727f8f4fa4@mail.gmail.com> References: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> <368a5cd50903250838m16372eaem21c751727f8f4fa4@mail.gmail.com> Message-ID: This is correct, windows makes a distinction between text and binary files, and linux does not, I have had quite a bit of trouble in that regard, especially as I switched from linux to windows. Edward On Wed, Mar 25, 2009 at 8:38 AM, Fredrik Lundh wrote: > 2009/3/25 Bryan Jeal : >> Here is an update: >> >> 1. >> I removed Python and PIL from the system and reinstalled them (for PIL I >> used PIL-1.1.6.win32-py2.5.exe); however, it isn't working correctly... > > I'm not sure why you think you need to open the output file yourself, > but if you do, you need to tell Python that it's a binary file. > Changing > > ? ?tmpFile = open('C:/temp/temp_win.jpg', 'w') > > to > > ? ?tmpFile = open('C:/temp/temp_win.jpg', 'wb') > > or, easier, changing the save call to > > ? ?im.save("c/temp/temp_win.jpg", 'JPEG', quality=90) > > will fix this. > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From fredrik at pythonware.com Wed Mar 25 16:56:01 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 25 Mar 2009 16:56:01 +0100 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <368a5cd50903250838m16372eaem21c751727f8f4fa4@mail.gmail.com> References: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> <368a5cd50903250838m16372eaem21c751727f8f4fa4@mail.gmail.com> Message-ID: <368a5cd50903250856r12c16ce8l82f82cc0879aa197@mail.gmail.com> > or, easier, changing the save call to > > ? ?im.save("c/temp/temp_win.jpg", 'JPEG', quality=90) or, more likely to work: im.save("c:/temp/temp_win.jpg", 'JPEG', quality=90) From Scott.Daniels at Acm.Org Wed Mar 25 17:07:39 2009 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Wed, 25 Mar 2009 09:07:39 -0700 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> References: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> Message-ID: Bryan Jeal wrote: > ... > >>> import _imaging > Traceback (most recent call last): > File "", line 1, in > ImportError: DLL load failed: The specified module could not be found. > > Basically I am still lost... Any other ideas? When you run youtr python application with the command line: python -v prog.py ... or even: python -vv prog.py ... rather than your normal: python prog.py ... You will get a lot of output on stdout showing what imports are tried and what files are being looked for. this output can be a source of clues about where the issue lies. This is only general advice about how to debug import problems. If you do ask again, please include in your question the output of: import sys, platform print (sys.version) print (platform.platform()) as sometimes versions are quite important to the diagnosis. --Scott David Daniels Scott.Daniels at Acm.Org From bryan at hideawaystudios.com Wed Mar 25 17:34:24 2009 From: bryan at hideawaystudios.com (Bryan Jeal) Date: Wed, 25 Mar 2009 10:34:24 -0600 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: References: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> Message-ID: <5D5D549D-106F-4852-BFC1-6E9B8F782178@hideawaystudios.com> I would like to thank everyone for their help - you all are amazing! It was a problem with not opening a file in binary mode - which as soon as I read that I smacked my head very hard and had a Homer moment. I apologize for not including sys.version and platform.platform() information when I posted errors; however, I was running python -v for each of the tests I was running. Everything is working perfectly and I hope I will get to help someone as you have helped me. Thank you very much for your time and knowledge. Sincerely, Bryan From fredrik at pythonware.com Wed Mar 25 18:14:41 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 25 Mar 2009 18:14:41 +0100 Subject: [Image-SIG] PIL with JPEG support on Windows: Error Writing JPEG file In-Reply-To: <5D5D549D-106F-4852-BFC1-6E9B8F782178@hideawaystudios.com> References: <9E47D490-6CF7-4D18-8E04-3124DA908955@hideawaystudios.com> <5D5D549D-106F-4852-BFC1-6E9B8F782178@hideawaystudios.com> Message-ID: <368a5cd50903251014y3301270cl8ec37e99ce8207ce@mail.gmail.com> On Wed, Mar 25, 2009 at 5:34 PM, Bryan Jeal wrote: > I would like to thank everyone for their help - you all are amazing! > > It was a problem with not opening a file in binary mode - which as soon as I > read that I smacked my head very hard and had a Homer moment. I hope you realize that the reason some of us identify that kind of mistakes very quickly is that we make them ourselves, all the time ;-) From michaelvantellingen at gmail.com Fri Mar 27 09:19:05 2009 From: michaelvantellingen at gmail.com (Michael van Tellingen) Date: Fri, 27 Mar 2009 09:19:05 +0100 Subject: [Image-SIG] [raclette] that JPEG CMYK thing, again In-Reply-To: <368a5cd50903241709l345917e3l49b38e030ed6dd22@mail.gmail.com> References: <368a5cd50903061626y68cd64f9u1615b8ab9564081a@mail.gmail.com> <368a5cd50903241709l345917e3l49b38e030ed6dd22@mail.gmail.com> Message-ID: Works perfectly now! Thanks, Michael On Wed, Mar 25, 2009 at 01:09, Fredrik Lundh wrote: > On Tue, Mar 24, 2009 at 9:54 AM, Michael van Tellingen > wrote: > > > I've just tested my application with the PIL 1.1.7 tip and latest alpha > and > > still have problems with the conversion from CMYK jpeg to RGB. > > The test images mailed earlier on this mailinglist (black background with > > the text 'RED') somehow become yellow on my system (python 2.5 / osx > > leopard). > > Yeah, I completely messed this one up. One crucial change didn't make > it into the library, and embarrasingly enough, I then went on to make > the JPEG regression test look for the broken behaviour... > > Here's the missing patch: > > $ hg diff libImaging/JpegDecode.c > diff -r f17d08c18ab3 libImaging/JpegDecode.c > --- a/libImaging/JpegDecode.c Mon Mar 23 12:51:13 2009 +0100 > +++ b/libImaging/JpegDecode.c Wed Mar 25 01:04:59 2009 +0100 > @@ -189,7 +189,8 @@ > context->cinfo.out_color_space = JCS_GRAYSCALE; > else if (strcmp(context->rawmode, "RGB") == 0) > context->cinfo.out_color_space = JCS_RGB; > - else if (strcmp(context->rawmode, "CMYK") == 0) > + else if (strcmp(context->rawmode, "CMYK") == 0 || > + strcmp(context->rawmode, "CMYK;I") == 0) > context->cinfo.out_color_space = JCS_CMYK; > else if (strcmp(context->rawmode, "YCbCr") == 0) > context->cinfo.out_color_space = JCS_YCbCr; > > Thanks /F > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Sat Mar 28 14:42:19 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 28 Mar 2009 14:42:19 +0100 Subject: [Image-SIG] ANN: PIL 1.1.7 alpha 2 (March 28, 2009) Message-ID: <368a5cd50903280642r4357c87bl9536f15d0d54a2e7@mail.gmail.com> PIL 1.1.7 alpha 2 for Python 2.X is now available. Source code can be downloaded using Subversion or Mercurial: http://svn.effbot.org/public/tags/pil-1.1.7a2-20090328/ http://hg.effbot.org/pil-2009-raclette/src/pil-117a2-20090328/ Windows binaries for Python 2.4, 2.5, and 2.6 can be found here: http://effbot.org/downloads/#pil I will post a standard tarball and Windows builds for 2.2 and 2.3 shortly. I've done some basic testing with earlier versions; the kit should build under 2.1, and will probably be possible to build also under earlier versions with some light tweaking. This release can be considered as "pretty much feature complete"; what remains is some internal cleanup work, which probably won't affect the public API (but I still reserve the right to tweak things, hence the alpha label). Many thanks to everyone who's helped testing alpha 2 in various configurations. From fredrik at pythonware.com Sat Mar 28 17:36:27 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 28 Mar 2009 17:36:27 +0100 Subject: [Image-SIG] ANN: PIL 1.1.7 alpha 2 (March 28, 2009) In-Reply-To: <368a5cd50903280642r4357c87bl9536f15d0d54a2e7@mail.gmail.com> References: <368a5cd50903280642r4357c87bl9536f15d0d54a2e7@mail.gmail.com> Message-ID: <368a5cd50903280936y707223a9lfacd36b36a3d29d8@mail.gmail.com> On Sat, Mar 28, 2009 at 2:42 PM, Fredrik Lundh wrote: > PIL 1.1.7 alpha 2 for Python 2.X is now available. ?Source code can be > downloaded using Subversion or Mercurial: > > ? ?http://svn.effbot.org/public/tags/pil-1.1.7a2-20090328/ > ? ?http://hg.effbot.org/pil-2009-raclette/src/pil-117a2-20090328/ > > Windows binaries for Python 2.4, 2.5, and 2.6 can be found here: > > ? ?http://effbot.org/downloads/#pil Binaries for 2.1 (!), 2.2, and 2.3 are now available from the same location. The a2 source kit doesn't build out of the box under 2.1; if you need this, apply this patch: http://hg.effbot.org/pil-2009-raclette/changeset/526317446775/ From joeoettinger at gmail.com Sat Mar 28 20:33:58 2009 From: joeoettinger at gmail.com (joe oettinger) Date: Sat, 28 Mar 2009 15:33:58 -0400 Subject: [Image-SIG] PIL for Python3 Message-ID: Sure could use PIL for Python3. Anybody know if/when it'll be done? I imagine there are a few other programmers interested. If there is an burdensome number of e-mails like this, it might be useful to post the answer on the image-sig web page. Thanks in advance for any news. Joe Oettinger -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Sat Mar 28 21:15:26 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 28 Mar 2009 21:15:26 +0100 Subject: [Image-SIG] PIL for Python3 In-Reply-To: References: Message-ID: <368a5cd50903281315q47d9cdc6h418da058440af4ae@mail.gmail.com> Checking recent posts can sometimes be helpful: http://mail.python.org/pipermail/image-sig/2009-March/005498.html 2009/3/28 joe oettinger : > Sure could use PIL for Python3. Anybody know if/when it'll be done? > I imagine there are a few other programmers interested. If there is an > burdensome number of e-mails like this, it might be useful to post the > answer on the image-sig web page. > Thanks in advance for any news. > Joe Oettinger > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From cannon.el at gmail.com Sun Mar 29 05:15:14 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Sat, 28 Mar 2009 20:15:14 -0700 Subject: [Image-SIG] autodetecting fonts Message-ID: using PIL is there a good way to autodetect what fonts a user has installed? This would be useful for applications that wanted to let a user select a font, that way no assumptions have to be made about the fonts on a particular computer and the user would have access to the widest range of fonts possible. Edward From spe.stani.be at gmail.com Sun Mar 29 13:58:03 2009 From: spe.stani.be at gmail.com (Stani) Date: Sun, 29 Mar 2009 13:58:03 +0200 Subject: [Image-SIG] autodetecting fonts In-Reply-To: References: Message-ID: <1238327883.14930.12.camel@blue> Unfortunately this not possible at the moment as far as I know. For Phatch I developed this module: http://bazaar.launchpad.net/~stani/phatch/dev/annotate/head% 3A/phatch/core/lib//fonts.py It is far from ideal, but it works. You can see it in action when you run phatch (http://photobatch.stani.be) and add a text action. Stani Op zaterdag 28-03-2009 om 20:15 uur [tijdzone -0700], schreef Laura & Edward Cannon: > using PIL is there a good way to autodetect what fonts a user has installed? > This would be useful for applications that wanted to let a user select > a font, that way no assumptions have to be made about the fonts on a > particular computer and the user would have access to the widest range > of fonts possible. > Edward > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig