From sven.hohage@zeitspringer.de Mon Mar 12 14:02:10 2001 From: sven.hohage@zeitspringer.de (Sven Hohage) Date: Mon, 12 Mar 2001 15:02:10 +0100 Subject: [Image-SIG] Zope and PIL(file-system) Message-ID: <3AACD6E2.F5E05E7F@zeitspringer.de> Hello, I'm using PIL to convert bmp and tiff-images to jpeg. After conversion they are added to Zope. My problem is that for conversion, I think, I have to safe them on the filesystem. Zope's security policy doesn't allow me to delete files with an external method. Am I forced to do a cron-job? Isn't it possible to change the format in another way?? Thanks very much!! Sven From odeckmyn.list@teaser.fr Mon Mar 12 14:16:27 2001 From: odeckmyn.list@teaser.fr (Olivier Deckmyn) Date: Mon, 12 Mar 2001 15:16:27 +0100 Subject: [Image-SIG] Zope and PIL(file-system) References: <3AACD6E2.F5E05E7F@zeitspringer.de> Message-ID: <01e101c0aaff$06d998c0$0d00000a@ODECKMYN2K> Why do you store images on filesystem ? You can handle as stream (=string) anywhere, isn't it ? This is what I do with Zope. my 0.02$ Olivier ----- Original Message ----- From: "Sven Hohage" To: Sent: Monday, March 12, 2001 3:02 PM Subject: [Image-SIG] Zope and PIL(file-system) > Hello, > I'm using PIL to convert bmp and tiff-images to jpeg. > After conversion they are added to Zope. > My problem is that for conversion, I think, I have to > safe them on the filesystem. > Zope's security policy doesn't allow me to delete > files with an external method. > Am I forced to do a cron-job? > Isn't it possible to change the format in another way?? > Thanks very much!! > Sven > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig From joelg@alum.mit.edu Mon Mar 12 18:44:23 2001 From: joelg@alum.mit.edu (Joel Gould) Date: Mon, 12 Mar 2001 13:44:23 -0500 Subject: [Image-SIG] Need help with PhotoImage (PIL), Tkinter and large JPGs - (it crashes) Message-ID: I also posted this problem to the comp.lang.python newsgroup. I am sorry for the double posting. I am having trouble developing a simple JPG manipulation program in Python using PIL (Python Imaging Library) and Tkinter. Any advice would be appreciated. When I try to display JPG images, I run into two problems: (1) With large images I just crash, and (2) With smaller images, I see image corruption. Joel Gould joelg@alum.mit.edu ========== Here is the crash details =============== If I load a 3.3 megapixel JPG file into a PIL (Python Image Library) PhotoImage object and then draw that on a Tkinter.Canvas object, Python crashes with an access violation (under Windows 98). I have attached the code that fails. You can get a suitable image from this link: http://www.gouldhome.com/Travel/StThomas00/images/001229_1106_charlotteAmali e3.jpg I have tried this using the latest py20 distribution (Python 2.0, PIL 1.1.1, etc.) from Secret Labs. I also tried it using the PythonWorks Testdrive 1.1 (which uses Python 1.5.2) also from Secret Labs. I am using Windows 98 SE on a Pentium III with 256MB of RAM. Can anyone tell me why this is failing? P.S. I know the image is very big and I can make it smaller before displaying it. I just do not think it should GPF in this case. ----- snip ---- import Tkinter import Image import ImageTk class MainDialog: def __init__(self, parent): self.canvas = Tkinter.Canvas(parent,width=700,height=500) self.canvas.pack() self.image = Image.open("001229_1106_charlotteAmalie3.jpg") self.tkim = ImageTk.PhotoImage(self.image) self.item = self.canvas.create_image( 0,0,image=self.tkim,anchor='nw') if __name__ == '__main__': root = Tkinter.Tk() dialog = MainDialog(root) root.mainloop() ========== Here is the corruption details =============== I have noticed corruption of displayed imaged when using the PhotoImage object from PIL (Python Image Library) under Tkinter. I am using Windows 98 SE with 256 MB or RAM. I see the effect under Python 2.0 (using the latest Py20 Windows binaries). I have attached a sample program which fails for me. The failure symptom is that the lower 10% of some of the images is corrupted with noise as you cycle through the images (pressing the button). Not every image is corrupted and the corruption pattern changes even when you get back to the same image. You can get the images from: http://www.gouldhome.com/Travel/StThomas00/images/001229_1106_charlotteAmali e1.jpg http://www.gouldhome.com/Travel/StThomas00/images/001229_1106_charlotteAmali e2.jpg http://www.gouldhome.com/Travel/StThomas00/images/001229_1106_charlotteAmali e3.jpg http://www.gouldhome.com/Travel/StThomas00/images/001229_1106_charlotteAmali e4.jpg Attached is the code sample. I would appreciate it if anyone could tell me what is wrong. ----- snip ----- import Tkinter import Image import ImageTk imageList = [ "001229_1106_charlotteAmalie1.jpg", "001229_1106_charlotteAmalie2.jpg", "001229_1106_charlotteAmalie3.jpg", "001229_1106_charlotteAmalie4.jpg", ] class MainDialog: def __init__(self, parent): self.canvas = Tkinter.Canvas(parent,width=800,height=600) self.canvas.pack() self.images = [] for name in imageList: image = Image.open(name) image.thumbnail( (800,600) ) self.images.append(image) self.currentImage = 0 self.tkim = ImageTk.PhotoImage(self.images[self.currentImage]) self.item = self.canvas.create_image( 0,0,image=self.tkim,anchor='nw') button = Tkinter.Button(parent, text='Next Image', command=self.onNewImage) button.pack() def onNewImage(self): self.currentImage = self.currentImage + 1 if self.currentImage >= len(self.images): self.currentImage = 0 self.tkim = ImageTk.PhotoImage(self.images[self.currentImage]) self.item = self.canvas.create_image( 0,0,image=self.tkim,anchor='nw') if __name__ == '__main__': root = Tkinter.Tk() dialog = MainDialog(root) root.mainloop() From gillet@scripps.edu Wed Mar 14 01:24:08 2001 From: gillet@scripps.edu (Alexandre Gillet) Date: Tue, 13 Mar 2001 17:24:08 -0800 Subject: [Image-SIG] libImaging on solaris 2.7 Message-ID: <3AAEC838.92A5EE39@scripps.edu> Hi, I am trying to compile libimaging (from Imaging1.1.1)under solaris 2.7 using SUNWspro-5.0 c compiler. I got the following error when it compile Draw.c. cc -I../. -I/usr/local/include -DHAVE_CONFIG_H -c ../Draw.c "../Draw.c", line 53: undefined or not a type: inline "../Draw.c", line 55: parameter not in identifier list: point8 Is there any compilation options that I missing? What should I do to make it work on Sun Solaris 2.7? Any help welcome. Alex -- ********************************** Alexandre Gillet The Scripps Research Institute, tel: (858) 784-9557 Dept. Molecular Biology, MB-5, fax: (858) 784-2860 10550 North Torrey Pines Road, email: gillet@scripps.edu La Jolla, CA 92037-1000, USA. From fredrik@pythonware.com Wed Mar 14 08:14:18 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 14 Mar 2001 09:14:18 +0100 Subject: [Image-SIG] libImaging on solaris 2.7 References: <3AAEC838.92A5EE39@scripps.edu> Message-ID: <010a01c0ac5e$c5de5700$e46940d5@hagrid> Alexandre Gillet wrote:> I am trying to compile libimaging (from Imaging1.1.1)under solaris 2.7 > using SUNWspro-5.0 c compiler. > I got the following error when it compile Draw.c. > > cc -I../. -I/usr/local/include -DHAVE_CONFIG_H -c ../Draw.c > "../Draw.c", line 53: undefined or not a type: inline > "../Draw.c", line 55: parameter not in identifier list: point8 > > Is there any compilation options that I missing? try removing config.cache, and run ./configure again before rebuilding everything. if configure complains about cross-compiling, or zero-sized data types, check the config.log file. (if you get stuck, post the configure output and config.log) Cheers /F From gillet@scripps.edu Wed Mar 14 21:21:58 2001 From: gillet@scripps.edu (Alexandre Gillet) Date: Wed, 14 Mar 2001 13:21:58 -0800 Subject: [Image-SIG] libImaging on solaris 2.7 References: <3AAEC838.92A5EE39@scripps.edu> <010a01c0ac5e$c5de5700$e46940d5@hagrid> Message-ID: <3AAFE0F6.CF6DB2B9@scripps.edu> This is a multi-part message in MIME format. --------------627F849C54B58F2B3BF31EC3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I did what you told me to do but I still can't get it to compile. the problem seems to come from "inline" as you can see in the output.configure and config.log. I attach the config.log file and the output of configure. Should I try to use gcc compiler? Alex Fredrik Lundh wrote: > > Alexandre Gillet wrote:> I am trying to compile libimaging (from Imaging1.1.1)under solaris 2.7 > > using SUNWspro-5.0 c compiler. > > I got the following error when it compile Draw.c. > > > > cc -I../. -I/usr/local/include -DHAVE_CONFIG_H -c ../Draw.c > > "../Draw.c", line 53: undefined or not a type: inline > > "../Draw.c", line 55: parameter not in identifier list: point8 > > > > Is there any compilation options that I missing? > > try removing config.cache, and run ./configure again before > rebuilding everything. > > if configure complains about cross-compiling, or zero-sized data > types, check the config.log file. > > (if you get stuck, post the configure output and config.log) > > Cheers /F -- ********************************** Alexandre Gillet The Scripps Research Institute, tel: (858) 784-9557 Dept. Molecular Biology, MB-5, fax: (858) 784-2860 10550 North Torrey Pines Road, email: gillet@scripps.edu La Jolla, CA 92037-1000, USA. --------------627F849C54B58F2B3BF31EC3 Content-Type: text/plain; charset=us-ascii; name="output.configure" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="output.configure" creating cache ./config.cache checking for --without-gcc... no checking for gcc... no checking for cc... cc checking whether the C compiler (cc ) works... yes checking whether the C compiler (cc ) is a cross-compiler... no checking whether we are using GNU C... no checking for ranlib... ranlib checking for ar... ar checking MACHDEP... sunos5 checking for jpeg_destroy_compress in -ljpeg... yes checking for deflate in -lz... yes checking how to run the C preprocessor... cc -E checking for ANSI C header files... yes checking for inline... no checking whether byte ordering is bigendian... yes checking size of char... 1 checking size of short... 2 checking size of int... 4 checking size of long... 4 checking size of float... 4 checking size of double... 8 checking for working const... yes checking for prototypes... yes checking for unistd.h... yes checking for getpagesize... yes checking for working mmap... yes updating cache ./config.cache creating ./config.status creating Makefile creating ImConfig.h --------------627F849C54B58F2B3BF31EC3 Content-Type: text/plain; charset=us-ascii; name="config.log" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config.log" This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. configure:558: checking for --without-gcc configure:588: checking for gcc configure:617: checking for cc configure:665: checking whether the C compiler (cc ) works configure:679: cc -o conftest conftest.c 1>&5 configure:699: checking whether the C compiler (cc ) is a cross-compiler configure:704: checking whether we are using GNU C configure:713: cc -E conftest.c configure:758: checking for ranlib configure:790: checking for ar configure:829: checking MACHDEP configure:857: checking for jpeg_destroy_compress in -ljpeg configure:876: cc -o conftest -g conftest.c -ljpeg 1>&5 configure:920: checking for deflate in -lz configure:939: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:969: checking how to run the C preprocessor configure:990: cc -E conftest.c >/dev/null 2>conftest.out configure:1030: checking for ANSI C header files configure:1043: cc -E conftest.c >/dev/null 2>conftest.out configure:1110: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1136: checking for inline configure:1150: cc -c -g conftest.c 1>&5 "configure", line 1146: undefined or not a type: inline "configure", line 1146: syntax error before or at: foo cc: acomp failed for conftest.c configure: failed program was: #line 1143 "configure" #include "confdefs.h" int main() { } inline foo() { ; return 0; } configure:1150: cc -c -g conftest.c 1>&5 "configure", line 1146: undefined or not a type: __inline__ "configure", line 1146: syntax error before or at: foo cc: acomp failed for conftest.c configure: failed program was: #line 1143 "configure" #include "confdefs.h" int main() { } __inline__ foo() { ; return 0; } configure:1150: cc -c -g conftest.c 1>&5 "configure", line 1146: undefined or not a type: __inline "configure", line 1146: syntax error before or at: foo cc: acomp failed for conftest.c configure: failed program was: #line 1143 "configure" #include "confdefs.h" int main() { } __inline foo() { ; return 0; } configure:1177: checking whether byte ordering is bigendian configure:1195: cc -c -g conftest.c 1>&5 "configure", line 1190: undefined symbol: bogus "configure", line 1190: syntax error before or at: endian cc: acomp failed for conftest.c configure: failed program was: #line 1184 "configure" #include "confdefs.h" #include #include int main() { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } configure:1243: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure: failed program was: #line 1230 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } configure:1268: checking size of char configure:1287: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1307: checking size of short configure:1326: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1346: checking size of int configure:1365: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1385: checking size of long configure:1404: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1425: checking size of float configure:1444: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1464: checking size of double configure:1483: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1504: checking for working const configure:1558: cc -c -g conftest.c 1>&5 configure:1581: checking for prototypes configure:1590: cc -c -g conftest.c 1>&5 "configure", line 1587: warning: statement not reached configure:1608: checking for unistd.h configure:1618: cc -E conftest.c >/dev/null 2>conftest.out configure:1647: checking for getpagesize configure:1675: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 configure:1700: checking for working mmap configure:1848: cc -o conftest -g conftest.c -lz -ljpeg 1>&5 --------------627F849C54B58F2B3BF31EC3-- From schorsch@schorsch.com Wed Mar 14 21:46:32 2001 From: schorsch@schorsch.com (Georg Mischler) Date: Wed, 14 Mar 2001 16:46:32 -0500 (EST) Subject: [Image-SIG] libImaging on solaris 2.7 In-Reply-To: <3AAFE0F6.CF6DB2B9@scripps.edu> Message-ID: Alexandre Gillet wrote: > I did what you told me to do but I still can't get it to compile. > the problem seems to come from "inline" as you can see in the > output.configure and config.log. > I attach the config.log file and the output of configure. > > Should I try to use gcc compiler? Your compiler doesn't seem to support the "inline" directive. The easiest thing is to define an empty macro of that name, by adding the line "#define inline" to Imaging.h. Would be nice if autoconf could check for this... Or maybe there is a compiler flag somewhere in SUNWspro-5.0 to enable (or at least ignore) inline directives. I'm not sure if supporting this is required by the standards. Have fun! -schorsch > Fredrik Lundh wrote: > > > > Alexandre Gillet wrote:> I am trying to compile libimaging (from Imaging1.1.1)under solaris 2.7 > > > using SUNWspro-5.0 c compiler. > > > I got the following error when it compile Draw.c. > > > > > > cc -I../. -I/usr/local/include -DHAVE_CONFIG_H -c ../Draw.c > > > "../Draw.c", line 53: undefined or not a type: inline > > > "../Draw.c", line 55: parameter not in identifier list: point8 > > > > > > Is there any compilation options that I missing? > > > > try removing config.cache, and run ./configure again before > > rebuilding everything. > > > > if configure complains about cross-compiling, or zero-sized data > > types, check the config.log file. > > > > (if you get stuck, post the configure output and config.log) > > > > Cheers /F > > -- Georg Mischler -- simulations developer -- schorsch at schorsch.com +schorsch.com+ -- lighting design tools -- http://www.schorsch.com/ From fredrik@pythonware.com Wed Mar 14 22:09:09 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 14 Mar 2001 23:09:09 +0100 Subject: [Image-SIG] libImaging on solaris 2.7 References: <3AAEC838.92A5EE39@scripps.edu> <010a01c0ac5e$c5de5700$e46940d5@hagrid> <3AAFE0F6.CF6DB2B9@scripps.edu> Message-ID: <017e01c0acd3$665a1330$e46940d5@hagrid> Alexandre Gillet wrote: > I did what you told me to do but I still can't get it to compile. > the problem seems to come from "inline" as you can see in the > output.configure and config.log. your compiler obviously doesn't support the non-standard "inline" directive -- but the configure stuff is supposed to deal with that. strange. to fix this, you can edit the ImConfig.h file by hand. look for the inline define/undef and change it to: /* Define as __inline if that's what the C compiler calls it. */ #define inline (and let me know what it looked like before you changed it) Cheers /F From gillet@scripps.edu Wed Mar 14 23:10:21 2001 From: gillet@scripps.edu (Alexandre Gillet) Date: Wed, 14 Mar 2001 15:10:21 -0800 Subject: [Image-SIG] libImaging on solaris 2.7 References: <3AAEC838.92A5EE39@scripps.edu> <010a01c0ac5e$c5de5700$e46940d5@hagrid> <3AAFE0F6.CF6DB2B9@scripps.edu> <017e01c0acd3$665a1330$e46940d5@hagrid> Message-ID: <3AAFFA5D.F821A9F0@scripps.edu> I successfully built libImaging and the python package. I use gcc to compile the library instead of the other C compiler on Sun Solaris2.7. And it works fine Thanks for your help Alex -- ********************************** Alexandre Gillet The Scripps Research Institute, tel: (858) 784-9557 Dept. Molecular Biology, MB-5, fax: (858) 784-2860 10550 North Torrey Pines Road, email: gillet@scripps.edu La Jolla, CA 92037-1000, USA. From kevin_cazabon@hotmail.com Thu Mar 15 04:45:24 2001 From: kevin_cazabon@hotmail.com (Kevin Hotmail) Date: Wed, 14 Mar 2001 21:45:24 -0700 Subject: [Image-SIG] PIL fonts Message-ID: I've recieved a few emails lately from people looking for the PIL fonts that I created a while back. Unfortunately the mirror site that Piers Lauder put up doesn't seem to have them there any more. However, I've posted them all on my new site: http://www.cazabon.com/PIL_fonts/ There are many MANY fonts there, in different resolutions ranging from 72dpi up to 406dpi. (a few of the largest fonts are corrupt, sorry... problems with my TTF to BDF conversion program). I'll be posting some more in the near future, broken up into font family ZIP files. I wish we could convince Fred to include at least a few of these with PIL... q:] Kevin Cazabon. ---------------------------------------------------------------- Quidquid latine dictum sit, altum viditur. (Whatever is said in Latin sounds profound.) From too@pk.highway.ne.jp Thu Mar 15 10:56:23 2001 From: too@pk.highway.ne.jp (Takekun Sato) Date: Thu, 15 Mar 2001 05:56:23 -0500 Subject: [Image-SIG] Convert Function and Palette Mode Message-ID: It seems that 'im.convert("P")' always converts an image with 'Web-Color'. So, resultant image is surely made up of 216 colors such as #333333,#336699,#3366CC,... How can I change the behavior to make the 'convert()' to use appropriate color palette other than 'Web-Color'? From walter@livinglogic.de Thu Mar 15 16:41:54 2001 From: walter@livinglogic.de (=?us-ascii?Q?=22Walter_D=F6rwald=22?=) Date: Thu, 15 Mar 2001 17:41:54 +0100 Subject: [Image-SIG] Convert Function and Palette Mode In-Reply-To: References: Message-ID: <200103151741540375.013F921E@mail.livinglogic.de> On 15.03.01 at 05:56 Takekun Sato wrote: > It seems that 'im.convert("P")' always converts > an image with 'Web-Color'. > > So, resultant image is surely made up of 216 colors > such as #333333,#336699,#3366CC,... > > How can I change the behavior to make the 'convert()' > to use appropriate color palette other than 'Web-Color'? Try im.convert("P", colors=3D32, palette=3DImage.ADAPTIVE) or something like that. Bye, Walter D=F6rwald -- Walter D=F6rwald =B7 LivingLogic AG =B7 Bayreuth, Germany =B7 www.livinglogic.de From too@pk.highway.ne.jp Thu Mar 15 18:20:22 2001 From: too@pk.highway.ne.jp (Takekun Sato) Date: Fri, 16 Mar 2001 03:20:22 +0900 Subject: [Image-SIG] Convert Function and Palette Mode References: <200103151741540375.013F921E@mail.livinglogic.de> Message-ID: <3AB107E6.476D092@pk.highway.ne.jp> Thanks Walter ! I appreciate your advice. Images converted to "PaletteMode" using keyword arguments("palette=Image.ADAPTIVE") are greatly enhanced than those images produced without such palette option. Now, another question came into my mind. Is there anyway to set a palette which is used to convert an image to "PaletteMode" ? I mean, is it possible to convert images not with automatically generated palette but with my private color palette ? "Walter Dörwald" wrote: > On 15.03.01 at 05:56 Takekun Sato wrote: > > > It seems that 'im.convert("P")' always converts > > an image with 'Web-Color'. > > > > So, resultant image is surely made up of 216 colors > > such as #333333,#336699,#3366CC,... > > > > How can I change the behavior to make the 'convert()' > > to use appropriate color palette other than 'Web-Color'? > > Try im.convert("P", colors=32, palette=Image.ADAPTIVE) > or something like that. From pett@cgl.ucsf.EDU Thu Mar 15 23:08:36 2001 From: pett@cgl.ucsf.EDU (Eric Pettersen) Date: Thu, 15 Mar 2001 15:08:36 -0800 Subject: [Image-SIG] patch to Tk/tkImaging.c (transparency problem) [PIL 1.1.1] Message-ID: <200103152308.PAA01322@homer.cgl.ucsf.EDU> Tk/tkImaging.c does not fully initialize the structure used to control the copying of an alpha-containing image, which leads to possibly spurious behavior (compiler/linker-dependent). Here is a context diff: *** tkImaging.c 2001/03/15 19:21:12 1.1 --- tkImaging.c 2001/03/15 23:02:44 *************** *** 142,147 **** --- 142,148 ---- run.offset[0] = 0; run.offset[1] = 1; run.offset[2] = 2; + run.offset[3] = 3; /* Copy opaque runs to photo image */ for (y = 0; y < block.height; y++) { --- Eric Pettersen UCSF Computer Graphics Lab pett@cgl.ucsf.edu http://www.cgl.ucsf.edu From nelson@crynwr.com Thu Mar 15 23:21:15 2001 From: nelson@crynwr.com (Russell Nelson) Date: Thu, 15 Mar 2001 18:21:15 -0500 (EST) Subject: [Image-SIG] GeoTIFF? Message-ID: <15025.19997.282754.576204@desk.crynwr.com> I need to read some proprietary TIFF tags out of a TIFF file (GeoTIFF tags, which give the registration of the image relative to the Universal Mercator Transform). I see no obvious way to do this in the source code? I'm not on the mailing list; please cc me. -- -russ nelson http://russnelson.com Crynwr sells support for free software | PGPok | Watch out! He's got an 521 Pleasant Valley Rd. | +1 315 268 1925 voice | opinion, and he's not Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | afraid to share it! From Kevin.Cazabon@gretag.com Thu Mar 15 23:47:42 2001 From: Kevin.Cazabon@gretag.com (Kevin.Cazabon@gretag.com) Date: Thu, 15 Mar 2001 16:47:42 -0700 Subject: [Image-SIG] GeoTIFF? Message-ID: PIL can read the tag data in a TIFF file as follows: if "a" is a TIFF image file that has JUST been opened, with no actions performed on it, "a.tag.tags" is a dicitonary of tagnumber:value pairs which can be assigned to or read. So, if your tag is numbered "344", you simply call "a.tag.tags[344]" to get the value. You can also assign to this. \ HOWEVER: as soon as you perform any processing on "a", you lose all TIFF-specific information... PIL does not remember that it "was" a TIFF file, and therefore does not retain the TIFF tag dictionary. I believe that you can simply make a copy of "a.tag" when you open the file, and assign it back to the image just before saving, but I'm not 100% sure off hand. I know I've successfully done this to include the X and Y resolution in the image file personally... I added the following around line 567 of TiffImagePlugin to insert the resolution data into the image during save: # HACK to let the user specify X and Y Resolution Tags for saving # simply create an im.RES or (im.XRES, im.YRES) attribute, with the # pixels per inch that you wish before saving # # alternatively, if your image was loaded from a TIFF file, it will # preserve the original PPI of the file unless you specify an im.RES, # im.XRES, or im.YRES value. # by Kevin Cazabon, Sept 2000 kcazabon@home.com if ("XRES" in dir(im) and "YRES" in dir(im)) or "RES" in dir(im): if "RES" in dir(im): ifd[282] = int(im.RES + 0.5) ifd[283] = int(im.RES + 0.5) if "XRES" in dir(im): ifd[282] = int(im.XRES + 0.5) if "YRES" in dir(im): ifd[283] = int(im.YRES + 0.5) elif "tag" in dir(im): #meaning that it was loaded as a TIFF file already if im.tag.tagdata.has_key(282): ifd[282] = im.tag.tagdata.get(282) if im.tag.tagdata.has_key(283): ifd[283] = im.tag.tagdata.get(283) Kevin Cazabon Product Manager, Software Applications and Systems Gretag, Lab Systems Group kevin.cazabon@gretag.com 303-754-0200 x289 Russell Nelson To: image-sig@python.org Subject: [Image-SIG] GeoTIFF? 03/15/2001 04:21 PM I need to read some proprietary TIFF tags out of a TIFF file (GeoTIFF tags, which give the registration of the image relative to the Universal Mercator Transform). I see no obvious way to do this in the source code? I'm not on the mailing list; please cc me. -- -russ nelson http://russnelson.com Crynwr sells support for free software | PGPok | Watch out! He's got an 521 Pleasant Valley Rd. | +1 315 268 1925 voice | opinion, and he's not Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | afraid to share it! _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig From David.Ransier@digital2me.com Sat Mar 17 00:36:07 2001 From: David.Ransier@digital2me.com (David Ransier) Date: Fri, 16 Mar 2001 16:36:07 -0800 Subject: [Image-SIG] Python and Video????? Message-ID: <013412396741D411879900D0B73C35920D3903@xchg-pdx-01.digital2me.com> Has anyone tried to display video (mpeg, avi, etc.,) from Python? I'm new to Python, but not scripting. I'm just starting a crash course this weekend, but I have lots of Perl, C++, etc., experience, so I'm not expecting many problems with the core language. The video question is because I need to prototype some TV SetTop Box stuff and I'd like to use Python for the task. I don't necessarily need real video, I could just sequence though a bunch of jpegs and watch 1-frame/sec video. My real task is to create the OSD layer on top of the video. This would be totally cool if Python would allow me to show my OSD features on top of a running video file. I am developing on Windows. Thanks, David R ____________________________________________ David Ransier David.Ransier@digital2me.com Office: 503-416-3812 111 SW 5th Ave. Fax: 503-416-3801 Suite 2200 Mobile: 360-921-5584 Portland, OR 97204 From joelg@alum.mit.edu Sat Mar 17 12:59:39 2001 From: joelg@alum.mit.edu (Joel Gould) Date: Sat, 17 Mar 2001 07:59:39 -0500 Subject: [Image-SIG] Tkinter / Pmw shutdown crash - please help Message-ID: I have attached a very simple Tkinter program. When I run this on my Windows 98 SE machine, a crash occurs when the program exits. Without the MainDialog class it works OK. Without the Pmw initialization call it works OK. But as written it will crash around 75% of the time. (1) run the program (2) press the Test Button (3) click Cancel in the file open dialog (you do not need to select a file) (4) click the close button in the upper right corner --> Boom Does anyone else see this behavior using Python 2.0, Py20 from Pythonware and Pmw 0.8.4 on Windows 98? Thanks, Joel Gould ----------------------------------------------------- import Tkinter import tkFileDialog import Pmw def action(): tkFileDialog.askopenfilename(filetypes=[('All','*')]) class MainDialog: def __init__(self,parent): Tkinter.Button(parent,text='Test Button',command=action).pack() root = Pmw.initialise() dialog = MainDialog(root) root.mainloop() From russianspy@visto.com Sun Mar 18 03:33:14 2001 From: russianspy@visto.com (Russian Spy) Date: Sat, 17 Mar 2001 19:33:14 -0800 Subject: [Image-SIG] Buffer Object Message-ID: Hello.. I've got a problem (actually two of them, but I hope to solve both of the= m using Buffer Objects). First of all, I need to transfer large quantity= of data between C-code and Python. I'd like to make it as easy as I can= =2E The best way would be to have a string in Python and a char* pointer= and an integer representing size in C. I think Buffer Objects would be = great for that. Quick Setup: I'm using Python2.0, Swig, PIL, NumPy and Numerical Recepies= on the C side. (I was thinking about adding PyOpenGL, but let's no go t= oo far ;-) ) The String object will contain 0 bytes (ie NULL bytes) and that causes a = bit of a problem. =20 First Problem: I'm still working it out on the Swig side, but can I creat= e a function that takes 2 arguments on Python side and 3 on C side? (ie. = I add the size?) Second Problem: How do I access the Buffer Object. I have some code tha= t generates a Buffer Object, but I have been unable to find any examples = of accessing the information. I think the write function in Python sourc= e code has it. Sorry, I have not been able to look at it yet. If anyone = has an example without me going through pages of code that would be great= ! Thanx a lot, Grzegorz Dostatni _________________________________________________________________________= __ Visit http://www.visto.com/info, your free web-based communications cente= r. Visto.com. Life on the Dot. From kevin" I was wondering if anyone has a better matrix for converting RGB to CMYK... the default conversion maps RGB directly to CMY, but does nothing with the black channel, leaving images very flat. I know you can provide a matrix to the Image.convert function, but my matrix algebra isn't too good... q:] >From Fred's manual: ---------------------------------------------------- Example: Convert RGB to XYZ rgb2xyz = ( 0.412453, 0.357580, 0.180423, 0, 0.212671, 0.715160, 0.072169, 0, 0.019334, 0.119193, 0.950227, 0 ) out = im.convert("RGB", rgb2xyz) ----------------------------------------------------- Does anyone have a suitable matrix for converting using UCR or GCR, or something similar? (It would make sense to implement such a matrix for the default conversion... straight RGB->CMY conversion is not very useful) Thanks! Kevin Cazabon. ---------------------------------------------------------------- Quidquid latine dictum sit, altum viditur. (Whatever is said in Latin sounds profound.) From fredrik@pythonware.com Sun Mar 18 20:41:23 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Sun, 18 Mar 2001 21:41:23 +0100 Subject: [Image-SIG] patch to Tk/tkImaging.c (transparency problem) [PIL 1.1.1] References: <200103152308.PAA01322@homer.cgl.ucsf.EDU> Message-ID: <00a501c0afeb$cceb1e30$e46940d5@hagrid> Eric Pettersen wrote: > Tk/tkImaging.c does not fully initialize the structure used to control the > copying of an alpha-containing image, which leads to possibly spurious > behavior (compiler/linker-dependent). Ouch. Looks like the Tk folks changed the API between 8.2.3 and 8.3.0, without adding the usual "*** POTENTIAL INCOMPATIBILITY ***" warning to the CHANGES file... > + run.offset[3] = 3; The fix works, but it's not optimal: to get 8.2-compatible behaviour, you should set it to zero (same goes for block.offset[3] in the RGB mode case). But 8.3's PutBlock handles RGBA images all by itself, so the right thing would be to ifdef on TK_VERSION (etc), and skip the image scanning code under 8.3 and later. I'll look into this for 1.1.2. Cheers /F From fredrik@pythonware.com Sun Mar 18 21:23:47 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Sun, 18 Mar 2001 22:23:47 +0100 Subject: [Image-SIG] RGB to CMYK color conversion References: <000901c0afe5$784da560$2b0aa8c0@den.co.bbnow.net> Message-ID: <00de01c0aff1$ba6193b0$e46940d5@hagrid> Kevin wrote: > I was wondering if anyone has a better matrix for converting RGB to CMYK... > the default conversion maps RGB directly to CMY, but does nothing with the > black channel, leaving images very flat. I'm not sure you can get much further without more drastic measures. something like (from memory, untested, pseudo- code): cyan = 255 - red magenta = 255 - green yellow = 255 - blue black = max(cyan, magenta, yellow) * scale1 cyan = clip(cyan * scale2 - black) magenta = clip(magenta * scale2 - black) yellow = clip(yellow * scale2 - black) black = clip(black) might work a bit better. (scale1 controls how much black to add, scale2 how much colour to add. scale1 should usually be slightly higher than scale2). this still doesn't take dot gain, ink characteristics, and all the other intricacies of real-life colour printing into account, of course. Cheers /F From walter@livinglogic.de Tue Mar 20 11:30:04 2001 From: walter@livinglogic.de (=?us-ascii?Q?=22Walter_D=F6rwald=22?=) Date: Tue, 20 Mar 2001 12:30:04 +0100 Subject: [Image-SIG] Convert Function and Palette Mode In-Reply-To: <3AB107E6.476D092@pk.highway.ne.jp> References: <200103151741540375.013F921E@mail.livinglogic.de> <3AB107E6.476D092@pk.highway.ne.jp> Message-ID: <200103201230040062.0016EB7E@mail.livinglogic.de> On 16.03.01 at 03:20 Takekun Sato wrote: > Thanks Walter ! > > I appreciate your advice. > > Images converted to "PaletteMode" using > keyword arguments("palette=3DImage.ADAPTIVE") > are greatly enhanced than those images produced > without such palette option. > > Now, another question came into my mind. > > Is there anyway to set a palette which is used > to convert an image to "PaletteMode" ? > > I mean, is it possible to convert images not with > automatically generated palette but with my private color palette ? I don't think there is such a function or parameter, but Fredrik can probably tell us more. Bye, Walter D=F6rwald -- Walter D=F6rwald =B7 LivingLogic AG =B7 Bayreuth, Germany =B7 www.livinglogic.de From fredrik@pythonware.com Tue Mar 20 11:36:27 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 20 Mar 2001 12:36:27 +0100 Subject: [Image-SIG] Convert Function and Palette Mode References: <200103151741540375.013F921E@mail.livinglogic.de><3AB107E6.476D092@pk.highway.ne.jp> <200103201230040062.0016EB7E@mail.livinglogic.de> Message-ID: <04d601c0b132$00c2a010$0900a8c0@SPIFF> walter wrote: > > Is there anyway to set a palette which is used > > to convert an image to "PaletteMode" ? > > I don't think there is such a function or parameter, > but Fredrik can probably tell us more. it's all hidden on the C API level. Bill Jansen recently posted patches to make this available via the Python API: I've completed some work on extending PIL 1.1.1 to support raw Palm image quantization and output. You can find a gzipped tar file containing a patch and a new ImagePlugin at ftp://ftp.parc.xerox.com/transient/janssen/PILpalm.tgz. The README in that file explains how to apply the support to a vanilla PIL 1.1.1 source distribution. The most interesting thing to you, I think, is the extension of the quantize method, via a new keyword, to support quantizing the colors of an image to a specified palette. That palette is specified by passing an image containing the desired palette. There were a number of ways to add this functionality; this seemed to be the approach that involved the minimal change to PIL. my plan is to get (some variation of) Bill's patches into 1.1.2 (soonish). Cheers /F From kent@springfed.com Tue Mar 20 13:39:57 2001 From: kent@springfed.com (Kent Tenney) Date: Tue, 20 Mar 2001 07:39:57 -0600 Subject: [Image-SIG] Want to read/write .jpg comments Message-ID: <200103201441.IAA25686@zealot.baysat.net> Howdy, I recently discovered that jpeg files can have textual comments in their headers. Can PIL read/write these fields? If not, does anyone know of other tools to do this? Where is a good source of info on the jpeg file format? Thanks, Kent From gpb_gt@yahoo.com Wed Mar 21 23:10:28 2001 From: gpb_gt@yahoo.com (George P Burdell) Date: Wed, 21 Mar 2001 15:10:28 -0800 (PST) Subject: [Image-SIG] sane->PIL->image problems Message-ID: <20010321231029.28595.qmail@web5203.mail.yahoo.com> I have an HP SCANJET and I can't seem to get scanning in Python to work. Here is code that I am using: >>> import sane >>> s = sane.open('hp:/dev/scanner') >>> s.start() >>> im = s.snap() >>> im.save('pyscan.tiff') >>> This creates a file that is 8M. When I open the file up for viewing, the file appears to repeat the same image 8 times and bottom of the document is B&W. Any ideas? I can use xsane which produces good images from scans. I have Python1.5.2 (which I must use), PIL1.1.1 and Sane-1.03 __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ From Barrett@stsci.edu Thu Mar 22 13:53:13 2001 From: Barrett@stsci.edu (Paul Barrett) Date: Thu, 22 Mar 2001 08:53:13 -0500 (EST) Subject: [Image-SIG] sane->PIL->image problems In-Reply-To: <20010321231029.28595.qmail@web5203.mail.yahoo.com> References: <20010321231029.28595.qmail@web5203.mail.yahoo.com> Message-ID: <15034.760.636123.886884@nem-srvr.stsci.edu> George P Burdell writes: With a name like George P. Burdell, do you really expect someone to reply to this message? :-) > I have an HP SCANJET and I can't seem to get scanning > in Python to work. > > Here is code that I am using: > > >>> import sane > >>> s = sane.open('hp:/dev/scanner') > >>> s.start() > >>> im = s.snap() > >>> im.save('pyscan.tiff') > >>> > > This creates a file that is 8M. When I open the file > up for viewing, the file appears to repeat the same > image 8 times and bottom of the document is B&W. Any > ideas? I can use xsane which produces good images > from > scans. > > I have Python1.5.2 (which I must use), PIL1.1.1 and > Sane-1.03 > -- Dr. Paul Barrett Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Group FAX: 410-338-4767 Baltimore, MD 21218 From jhauser@ifm.uni-kiel.de Thu Mar 22 14:19:45 2001 From: jhauser@ifm.uni-kiel.de (Janko Hauser) Date: Thu, 22 Mar 2001 15:19:45 +0100 (CET) Subject: [Image-SIG] sane->PIL->image problems In-Reply-To: <15034.760.636123.886884@nem-srvr.stsci.edu> References: <20010321231029.28595.qmail@web5203.mail.yahoo.com> <15034.760.636123.886884@nem-srvr.stsci.edu> Message-ID: <20010322141945.32434.qmail@lisboa.ifm.uni-kiel.de> Paul Barrett writes: > George P Burdell writes: > > With a name like George P. Burdell, do you really expect someone to > reply to this message? :-) > Do you mean this George? http://cyberbuzz.gatech.edu/nique/issues/fall1997/nov14/campuslife3.html Well, with so many bots in the Python community, such a good educated George can make life only more colorful. __Janko PS: Sorry George, I can not answer your question and apologize the joke. From akuchlin@mems-exchange.org Thu Mar 22 15:12:18 2001 From: akuchlin@mems-exchange.org (Andrew Kuchling) Date: Thu, 22 Mar 2001 10:12:18 -0500 Subject: [Image-SIG] sane->PIL->image problems In-Reply-To: <20010321231029.28595.qmail@web5203.mail.yahoo.com>; from gpb_gt@yahoo.com on Wed, Mar 21, 2001 at 03:10:28PM -0800 References: <20010321231029.28595.qmail@web5203.mail.yahoo.com> Message-ID: <20010322101218.A17254@ute.cnri.reston.va.us> On Wed, Mar 21, 2001 at 03:10:28PM -0800, George P Burdell wrote: >This creates a file that is 8M. When I open the file >up for viewing, the file appears to repeat the same >image 8 times and bottom of the document is B&W. Any >ideas? I can use xsane which produces good images >from scans. I'm responsible for writing the SANE module. It's quite possible there's a bug in the code that turns SANE's output into a PIL image (the SaneDev_snap() function in _sanemodule.c), but I don't know of any such bugs at this point in time. Are you comfortable working with C code? Do you want to help debug this problem? --amk From russianspy@visto.com Fri Mar 23 00:31:41 2001 From: russianspy@visto.com (Russian Spy) Date: Thu, 22 Mar 2001 16:31:41 -0800 Subject: [Image-SIG] Buffer Object Message-ID: Sorry about being a nag... I've posted a message about buffer objects a f= ew days ago... Is there any way anyone can help me? Is there a better wa= y to transfer large quantity of binary information between Python and C c= ode (using SWIG) ? Can anyone point me to an example of how to use a Buf= fer Object? I know that you guys might be offended by me using a free account on vist= o. I get waaay too much spam as it is. I'm trying to keep my work accou= nts (university really) just for work and school... Any kind of a reply would be appreciated (just to know that someone has r= ead it!). Recap: I need to transfer large quantity of binary information (like an image= ) from Python to my C code and back. I'm using SWIG. String object gets= truncated at the first binary zero. Found Buffer Objects. A) is there a better way? B) How do I use them? Thanx a LOT! Grzegorz Dostatni _________________________________________________________________________= __ Visit http://www.visto.com/info, your free web-based communications cente= r. Visto.com. Life on the Dot. From Barrett@stsci.edu Fri Mar 23 14:06:58 2001 From: Barrett@stsci.edu (Paul Barrett) Date: Fri, 23 Mar 2001 09:06:58 -0500 (EST) Subject: [Image-SIG] Buffer Object In-Reply-To: References: Message-ID: <15035.21188.201655.996077@nem-srvr.stsci.edu> Russian Spy writes: > Sorry about being a nag... I've posted a message about buffer > objects a few days ago... Is there any way anyone can help me? Is > there a better way to transfer large quantity of binary information > between Python and C code (using SWIG) ? Can anyone point me to an > example of how to use a Buffer Object? Buffer objects are deprecated in Python, but not the buffer API, which is probable what you want to use anyway. The string object implements the buffer API so you should be able to load your data into it and then access its contents in C via the buffer API. Take a look here: http://www.python.org/doc/current/api/buffer-structs.html for information about the API and get back to me if you have any further questions. I think we still need some type of fundamental buffer object which all objects use to access and possibly export a block of memory. I know that such an object would improve the implementation of PEP 209: Multi-Dimensional Arrays, make it easier to interchange data between Numeric arrays and PIL images, and discourage the use of the string object for such purposes. The plan is to create a memory object whose interface and features are similar to a memory-mapped object, e.g. setting the buffer to read-only in string objects, etc. When I find the time, I'll prepare and submit a PEP describing this idea. Cheers, Paul -- Dr. Paul Barrett Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Group FAX: 410-338-4767 Baltimore, MD 21218 From Aureli.Soria_Frisch@ipk.fhg.de Fri Mar 23 17:54:19 2001 From: Aureli.Soria_Frisch@ipk.fhg.de (Aureli Soria Frisch) Date: Fri, 23 Mar 2001 18:54:19 +0100 Subject: [Image-SIG] Bug in TiffImagePlugin? In-Reply-To: <00de01c0aff1$ba6193b0$e46940d5@hagrid> References: <000901c0afe5$784da560$2b0aa8c0@den.co.bbnow.net> Message-ID: Hallo, When trying to save an image in tif format under Python2.0 an error is prompted: File "macintosh hd:compiler:python 2.0:extensions:imaging:pil:TiffImagePlugin.py", line 329, in save append(tag, typ, len(value), data + (4-len(data))*"\0", "") TypeError: append requires exactly 1 argument; 5 given Regards, Aureli ################################# Aureli Soria Frisch Fraunhofer IPK Dept. Pattern Recognition post: Pascalstr. 8-9, 10587 Berlin, Germany e-mail:aureli@ipk.fhg.de fon: +49 30 39 00 61 50 fax: +49 30 39 17 517 ################################# From garyo@oberbrunner.com Sat Mar 24 04:00:39 2001 From: garyo@oberbrunner.com (Gary Oberbrunner) Date: Fri, 23 Mar 2001 23:00:39 -0500 Subject: [Image-SIG] ActiveState Python PIL on Win32 needs "jpeg62.dll" Message-ID: Hi PIL folks. I hope this is the right place to ask this. I'm a PIL newbie; I just downloaded the ActiveState Python binaries onto my Win98 machine and everything seems fine, except PIL doesn't run. When I do >>> import _imaging I get an error about a missing DLL (of course it doesn't say what it is). Firing up FileMon to see what it is, it seems that it's looking along sys.path for a file called "jpeg62.dll" which I don't have anywhere on my system. Is this because (a) I should have jpeg62.dll? Where should I get it? (b) _imaging.pyd is looking for it mistakenly? How can I fix it? or (c) I'm an idiot, and just have to adjust some config file somewhere? Any ideas would be appreciated, thanks, -- Gary Oberbrunner (garyo@oberbrunner.com) From rtrocca@libero.it Sat Mar 24 09:29:07 2001 From: rtrocca@libero.it (Riccardo Trocca) Date: Sat, 24 Mar 2001 10:29:07 +0100 Subject: [Image-SIG] ActiveState Python PIL on Win32 needs "jpeg62.dll" In-Reply-To: References: Message-ID: >Hi PIL folks. I hope this is the right place to ask this. I'm a PIL >newbie; I just downloaded the ActiveState Python binaries onto my Win98 >machine and everything seems fine, except PIL doesn't run. When I do >>>> import _imaging >I get an error about a missing DLL (of course it doesn't say what it is). > >Firing up FileMon to see what it is, it seems that it's looking along >sys.path for a file called "jpeg62.dll" which I don't have anywhere on my >system. Is this because (a) I should have jpeg62.dll? Where should I get >it? (b) _imaging.pyd is looking for it mistakenly? How can I fix it? or >(c) I'm an idiot, and just have to adjust some config file somewhere? > >Any ideas would be appreciated, > >thanks, > >-- Gary Oberbrunner (garyo@oberbrunner.com) > > >_______________________________________________ >Image-SIG maillist - Image-SIG@python.org >http://mail.python.org/mailman/listinfo/image-sig I didn't have so much time to use ActivePython, but the first time I installed it with PIL I noticed that it was not working. Instead of spending time trying to fix it I simply downloaded a precompiled version of PIL with some patch for Win32 in the Download section of piddle.sourceforge.net. I just substituted the original PIL dir with the new one and everything worked smoothly, or, at least, I could run the demo scripts of PIL. A short note: the PIL binary on the piddle website, doesn't contain the demo scripts, but you can use those included in the original PIL dir that comes with ActivePython. Not the most elegant solution, but it worked for me without any problem. If there is something better let me know. -- Riccardo Trocca rtrocca@libero.it Laboratory of Musical Informatics DIST University of Genoa From fredrik@pythonware.com Sat Mar 24 11:16:31 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Sat, 24 Mar 2001 12:16:31 +0100 Subject: [Image-SIG] ActiveState Python PIL on Win32 needs "jpeg62.dll" References: Message-ID: <00e401c0b453$e387b1a0$e46940d5@hagrid> gary wrote: > Firing up FileMon to see what it is, it seems that it's looking along > sys.path for a file called "jpeg62.dll" which I don't have anywhere on my > system. Is this because (a) I should have jpeg62.dll? Where should I get > it? (b) _imaging.pyd is looking for it mistakenly? How can I fix it? or > (c) I'm an idiot, and just have to adjust some config file somewhere? (d) your PIL vendor needs to be spanked ;-) see: http://www.pythonware.com/products/pil/faq.htm official builds are available from: http://www.pythonware.com/products/pil/index.htm Cheers /F From fredrik@pythonware.com Sat Mar 24 11:21:51 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Sat, 24 Mar 2001 12:21:51 +0100 Subject: [Image-SIG] Bug in TiffImagePlugin? References: <000901c0afe5$784da560$2b0aa8c0@den.co.bbnow.net> Message-ID: <018d01c0b456$6677d390$e46940d5@hagrid> Aureli Soria Frisch wrote: > When trying to save an image in tif format under Python2.0 an error is > prompted: > > File "macintosh hd:compiler:python > 2.0:extensions:imaging:pil:TiffImagePlugin.py", line 329, in save > append(tag, typ, len(value), data + (4-len(data))*"\0", "") > TypeError: append requires exactly 1 argument; 5 given this is fixed in the latest PIL version (1.1.1). if you're using 1.1.0, you can upgrade by simply copying all PY-files from the PIL directory to the imaging:pil directory in your Python installation. the current sources are available from: http://www.pythonware.com/products/pil/index.htm Cheers /F From garyo@oberbrunner.com Sat Mar 24 14:03:03 2001 From: garyo@oberbrunner.com (Gary Oberbrunner) Date: Sat, 24 Mar 2001 09:03:03 -0500 Subject: [Image-SIG] ActiveState Python PIL on Win32 needs "jpeg62.dll" In-Reply-To: Message-ID: Thanks -- that worked perfectly! -- Gary O -----Original Message----- From: Riccardo Trocca [mailto:rtrocca@libero.it] I didn't have so much time to use ActivePython, but the first time I installed it with PIL I noticed that it was not working. Instead of spending time trying to fix it I simply downloaded a precompiled version of PIL with some patch for Win32 in the Download section of piddle.sourceforge.net. I just substituted the original PIL dir with the new one and everything worked smoothly, or, at least, I could run the demo scripts of PIL. From Aureli.Soria_Frisch@ipk.fhg.de Mon Mar 26 09:44:30 2001 From: Aureli.Soria_Frisch@ipk.fhg.de (Aureli Soria Frisch) Date: Mon, 26 Mar 2001 11:44:30 +0200 Subject: [Image-SIG] Bug in TiffImagePlugin? In-Reply-To: <018d01c0b456$6677d390$e46940d5@hagrid> References: <000901c0afe5$784da560$2b0aa8c0@den.co.bbnow.net> Message-ID: At 12:21 Uhr +0100 24.03.2001, Fredrik Lundh wrote: >Aureli Soria Frisch wrote: >> When trying to save an image in tif format under Python2.0 an error is >> prompted: >> >> File "macintosh hd:compiler:python >> 2.0:extensions:imaging:pil:TiffImagePlugin.py", line 329, in save >> append(tag, typ, len(value), data + (4-len(data))*"\0", "") >> TypeError: append requires exactly 1 argument; 5 given > >this is fixed in the latest PIL version (1.1.1). if you're using >1.1.0, you can upgrade by simply copying all PY-files from >the PIL directory to the imaging:pil directory in your Python >installation. > >the current sources are available from: > > http://www.pythonware.com/products/pil/index.htm > I am using MacPython and does not seem to be PIL 1.1.1. for that plattform. is taht right? Thanks, regards ################################# Aureli Soria Frisch Fraunhofer IPK Dept. Pattern Recognition post: Pascalstr. 8-9, 10587 Berlin, Germany e-mail:aureli@ipk.fhg.de fon: +49 30 39 00 61 50 fax: +49 30 39 17 517 ################################# From walter.pleyer@euromarketing.at Mon Mar 26 13:55:19 2001 From: walter.pleyer@euromarketing.at (walter.pleyer@euromarketing.at) Date: Mon, 26 Mar 2001 13:55:19 -0000 Subject: [Image-SIG] Setup PIL and FTDraw Message-ID: <99nho7+2gqc@eGroups.com> Hi folks! Attention, this is a rookie-question! I tried to install PIL to use it with Zope (version 2.2.2 on Red Hat Linux). After playing around with PIL for awhile it seems that PIL is installed properly, but FTDraw, which is required is not. I installed FTDraw according to the README file, but Python is unable to import it. What do I have to pay special attention to? What could I have done wrong? Any input is appreciated. Walter From walter.pleyer@euromarketing.at Mon Mar 26 15:10:32 2001 From: walter.pleyer@euromarketing.at (walter.pleyer@euromarketing.at) Date: Mon, 26 Mar 2001 15:10:32 -0000 Subject: [Image-SIG] TextImage and FTDraw Message-ID: <99nm58+n68d@eGroups.com> Hi folks! I'm trying to install TextImage for Zope (v 2.2.2) on our Server (Red Hat Linux). One of the Pyhon modules required is FTDraw. Somehow I just can't seem to get it right, Python keeps on telling me:"No module named FTDraw". What could I have done wrong, what do I need to pay special attention to? Any input is appreciated. Thanx Walter From fredrik@pythonware.com Tue Mar 27 10:13:28 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 27 Mar 2001 12:13:28 +0200 Subject: [Image-SIG] TextImage and FTDraw References: <99nm58+n68d@eGroups.com> Message-ID: <02bd01c0b6a6$925934c0$0900a8c0@SPIFF> Walter wrote: > I'm trying to install TextImage for Zope (v 2.2.2) on our Server > (Red Hat Linux). One of the Pyhon modules required is FTDraw. > > Somehow I just can't seem to get it right, Python keeps on telling > me:"No module named FTDraw". whatever FTDraw is, it's not part of PIL itself. have you checked with the TextImage author(s)? Cheers /F From abulka@netspace.net.au Tue Mar 27 20:58:58 2001 From: abulka@netspace.net.au (Andy Bulka) Date: Wed, 28 Mar 2001 06:58:58 +1000 Subject: [Image-SIG] drag and drop boxes.. The Python Imaging Library Message-ID: Is there a good library for diagramming - can The Python Imaging Library do it? E.g. I want to build a UML tool for Python. where I can drag and drop boxes.... thanks for any tips, please reply to my email From echuck@mindspring.com Tue Mar 27 21:07:46 2001 From: echuck@mindspring.com (Chuck Esterbrook) Date: Tue, 27 Mar 2001 16:07:46 -0500 Subject: [Image-SIG] drag and drop boxes.. The Python Imaging Library In-Reply-To: Message-ID: <5.0.2.1.0.20010327160527.021e1ec0@mail.mindspring.com> Maybe you should look at Sketch which is oriented towards vectors rather than bitmaps. This is more likely the type of drawing that a UML tool would do (as opposed to bitmap manipulation). http://sketch.sourceforge.net/ -Chuck At 06:58 AM 3/28/2001 +1000, Andy Bulka wrote: >Is there a good library for diagramming - can The Python Imaging Library do >it? >E.g. I want to build a UML tool for Python. where I can drag and drop >boxes.... > >thanks for any tips, >please reply to my email > > >_______________________________________________ >Image-SIG maillist - Image-SIG@python.org >http://mail.python.org/mailman/listinfo/image-sig From jonathan.gilligan@vanderbilt.edu Wed Mar 28 06:53:37 2001 From: jonathan.gilligan@vanderbilt.edu (Jonathan M. Gilligan) Date: Wed, 28 Mar 2001 00:53:37 -0600 Subject: [Image-SIG] drag and drop boxes.. The Python Imaging Library Message-ID: <3AC35758@webgate1.mail.vanderbilt.edu> You may want to look at wxPython (http://www.wxpython.org) and its Object Graphics Library (OGL), which is intended for diagramming "network diagrams, business process modelling, decision trees, visual programming, Petri nets, OOAD, mindmaps, among many others." You can read the OGL manual at http://wxwindows.org/contrib/ogl/ogl.htm. I would also ask whether the world needs another UML tool. Would you do better to contribute to the open-source ArgoUML at http://www.argouml.org than to reinvent the wheel in Python? ArgoUML is written in Java and has the benefit of many years' work already put into it. >===== Original Message From ===== >Is there a good library for diagramming - can The Python Imaging Library do >it? >E.g. I want to build a UML tool for Python. where I can drag and drop >boxes.... Jonathan M. Gilligan jonathan.gilligan@vanderbilt.edu The Robert T. Lagemann Assistant Professor Office: 615-343-6252 of Living State Physics Lab (FEL) 343-7580 Dept. of Physics and Astronomy Fax: 343-7263 6823 Stevenson Center Vanderbilt University, Nashville TN 37235 Dep't Office 322-2828 From Aureli.Soria_Frisch@ipk.fhg.de Wed Mar 28 15:22:58 2001 From: Aureli.Soria_Frisch@ipk.fhg.de (Aureli Soria Frisch) Date: Wed, 28 Mar 2001 17:22:58 +0200 Subject: [Image-SIG] OGL In-Reply-To: <3AC35758@webgate1.mail.vanderbilt.edu> Message-ID: At 0:53 Uhr -0600 28.03.2001, Jonathan M. Gilligan wrote: >You may want to look at wxPython (http://www.wxpython.org) and its Object >Graphics Library (OGL), which is intended for diagramming "network diagrams, >business process modelling, decision trees, visual programming, Petri nets, >OOAD, mindmaps, among many others." You can read the OGL manual at >http://wxwindows.org/contrib/ogl/ogl.htm. > Is there a similar tool for the Mac (wxPython seem to be not so evolved under MacOS)? Thanks, Aureli ################################# Aureli Soria Frisch Fraunhofer IPK Dept. Pattern Recognition post: Pascalstr. 8-9, 10587 Berlin, Germany e-mail:aureli@ipk.fhg.de fon: +49 30 39 00 61 50 fax: +49 30 39 17 517 ################################# From fredrik@effbot.org Wed Mar 28 16:15:52 2001 From: fredrik@effbot.org (Fredrik Lundh) Date: Wed, 28 Mar 2001 18:15:52 +0200 Subject: [Image-SIG] PATCH: transform(EXTENT) doesn't work for negative x offsets Message-ID: <008f01c0b7a2$5cef3760$e46940d5@hagrid> the transform(EXTENT) and transform(AFFINE) methods can produce bogus results under certain circumstances. for EXTENT, this can happen if you're using NEAREST resampling, and x0 in the (x0, y0, x1, y1) bounding box is negative. I've attached a patch. Cheers /F --- libImaging\Geometry.c~ Thu Feb 08 22:10:57 2001 +++ libImaging\Geometry.c Wed Mar 28 17:26:05 2001 @@ -595,7 +596,7 @@ if (yi >= 0 && yi < imIn->ysize) {\ in = imIn->image[yi];\ for (x = xmin; x < xmax; x++)\ - *out++ = in[xintab[x]];\ + out[x] = in[xintab[x]];\ }\ yo += a[5];\ }