From edi at agharta.de Wed Oct 1 11:28:27 2008 From: edi at agharta.de (Edi Weitz) Date: Wed, 01 Oct 2008 13:28:27 +0200 Subject: [cl-gd-devel] Re: CL-GD: Documentation error for COLOR-COMPONENT In-Reply-To: <20080928201322.GA24228@synthetic-forms.thoughtcrime.us> (J. P. Larocque's message of "Sun, 28 Sep 2008 13:13:25 -0700") References: <20080928201322.GA24228@synthetic-forms.thoughtcrime.us> Message-ID: On Sun, 28 Sep 2008 13:13:25 -0700, "J\.P\. Larocque" wrote: > The documentation for CL-GD seems to be wrong for the > COLOR-COMPONENT function: > > [Function] > color-component color component &key image => component > > Returns the specified color component of color. component can > be one of :RED, :GREEN, :BLUE, and :ALPHA. > > The color and component parameters should be swapped: > > [Function] > color-component component color &key image => component > > This seems to reflect the state of CL-GD 0.5.6, and the example for > COLOR-COMPONENT in the documentation. Thanks for catching that. Will be fixed in the next release. > Thanks for yet another great library, You're welcome... :) From lispercat at gmail.com Wed Oct 1 22:49:30 2008 From: lispercat at gmail.com (Andrei Stebakov) Date: Wed, 1 Oct 2008 18:49:30 -0400 Subject: [cl-gd-devel] PNG compression Message-ID: I was experimenting with write-png-to-stream trying :compression-level from -1 to 9 but it doesn't change the size of the image. For jpeg quality level works though. What can I check for PNG compression to work? Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans at huebner.org Wed Oct 1 22:53:13 2008 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Wed, 1 Oct 2008 18:53:13 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: 2008/10/1 Andrei Stebakov : > I was experimenting with write-png-to-stream trying :compression-level from > -1 to 9 but it doesn't change the size of the image. > For jpeg quality level works though. > What can I check for PNG compression to work? Are you sure that libgd supports compressing PNGs? If so, it may be a fixable API problem. Please verify that libgd itself supports compression, then let us know. Thanks, Hans From lispercat at gmail.com Wed Oct 1 23:03:01 2008 From: lispercat at gmail.com (Andrei Stebakov) Date: Wed, 1 Oct 2008 19:03:01 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: On the site http://www.libgd.org/GdHistory they say: That "the PNG compression level can now be specified when writing PNG images. See the new gdImagePngEx, gdImagePngEx, gdImagePngCtxEx, and gdImagePngPtrEx functions.". This feature starts from version 2.0.12. I have 2.0.35, so yes, libgd should support it. Thank you, Andrew On Wed, Oct 1, 2008 at 6:53 PM, Hans H?bner wrote: > 2008/10/1 Andrei Stebakov : > > I was experimenting with write-png-to-stream trying :compression-level > from > > -1 to 9 but it doesn't change the size of the image. > > For jpeg quality level works though. > > What can I check for PNG compression to work? > > Are you sure that libgd supports compressing PNGs? If so, it may be a > fixable API problem. Please verify that libgd itself supports > compression, then let us know. > > Thanks, > Hans > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans at huebner.org Wed Oct 1 23:24:36 2008 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Wed, 1 Oct 2008 19:24:36 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: Works for me: GD-TEST> (with-open-file (f "/tmp/test.png") (file-length f)) 3005915 GD-TEST> (with-image* (1000 1000 t) (write-image-to-file "/tmp/test.png" :compression-level 1 :if-exists :supersede)) #S(CL-GD::IMAGE :IMG #) GD-TEST> (with-open-file (f "/tmp/test.png") (file-length f)) 13178 GD-TEST> (with-image* (1000 1000 t) (write-image-to-file "/tmp/test.png" :compression-level 9 :if-exists :supersede)) #S(CL-GD::IMAGE :IMG #) GD-TEST> (with-open-file (f "/tmp/test.png") (file-length f)) 2987 FreeBSD, cl-gd 0.5.6, gd-2.0.35 What are your results for this test? -Hans 2008/10/1 Andrei Stebakov : > On the site http://www.libgd.org/GdHistory they say: > That "the PNG compression level can now be specified when writing PNG > images. See the new gdImagePngEx, gdImagePngEx, gdImagePngCtxEx, and > gdImagePngPtrEx functions.". > This feature starts from version 2.0.12. > I have 2.0.35, so yes, libgd should support it. > > Thank you, > Andrew > > On Wed, Oct 1, 2008 at 6:53 PM, Hans H?bner wrote: >> >> 2008/10/1 Andrei Stebakov : >> > I was experimenting with write-png-to-stream trying :compression-level >> > from >> > -1 to 9 but it doesn't change the size of the image. >> > For jpeg quality level works though. >> > What can I check for PNG compression to work? >> >> Are you sure that libgd supports compressing PNGs? If so, it may be a >> fixable API problem. Please verify that libgd itself supports >> compression, then let us know. >> >> Thanks, >> Hans >> _______________________________________________ >> cl-gd-devel site list >> cl-gd-devel at common-lisp.net >> http://common-lisp.net/mailman/listinfo/cl-gd-devel > > > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel > From hans at huebner.org Wed Oct 1 23:25:38 2008 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Wed, 1 Oct 2008 19:25:38 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: On Wed, Oct 1, 2008 at 19:24, Hans H?bner wrote: > Works for me: Obviously, I made a copy and paste error. This: > GD-TEST> (with-open-file (f "/tmp/test.png") > (file-length f)) > 3005915 is for :compression-level 0, obviously. -Hans From lispercat at gmail.com Thu Oct 2 15:22:29 2008 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 2 Oct 2008 11:22:29 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: Yes, it works. The scenario that I have is like this: I am trying to down-size a png image so I 1. open it with with-image-from-file 2. copy resized image (copy-image old-image new-image ....) 3. save it (write-image-to-file new-image-file-name :image new-image :compression-level 5) In my case :compression-level doesn't change the size of the output image. Probably it happens because the original file that I am trying to re-size is already compressed to the maximum. Thank you, Andrew On Wed, Oct 1, 2008 at 7:25 PM, Hans H?bner wrote: > On Wed, Oct 1, 2008 at 19:24, Hans H?bner wrote: > > Works for me: > > Obviously, I made a copy and paste error. This: > > > GD-TEST> (with-open-file (f "/tmp/test.png") > > (file-length f)) > > 3005915 > > is for :compression-level 0, obviously. > > -Hans > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans at huebner.org Thu Oct 2 15:28:16 2008 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Thu, 2 Oct 2008 11:28:16 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: 2008/10/2 Andrei Stebakov : > Yes, it works. > The scenario that I have is like this: > I am trying to down-size a png image so I > > open it with with-image-from-file > copy resized image (copy-image old-image new-image ....) > save it (write-image-to-file new-image-file-name :image new-image > :compression-level 5) > > In my case :compression-level doesn't change the size of the output image. > Probably it happens because the original file that I am trying to re-size is > already compressed to the maximum. I fear I don't know enough about PNG compression to say anything profound here. I do suspect that it is a general GD issue rather than a cl-gd problem, so maybe asking on some GD support channel would be helpful? You'd propably need to supply the image in question to have someone comment on what compression you can expect. -Hans From lispercat at gmail.com Thu Oct 2 15:44:06 2008 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 2 Oct 2008 11:44:06 -0400 Subject: [cl-gd-devel] PNG compression In-Reply-To: References: Message-ID: Thank you, Hans. Looks like I need to contact libgd folks to learn more about this type of operation. Andrew On Thu, Oct 2, 2008 at 11:28 AM, Hans H?bner wrote: > 2008/10/2 Andrei Stebakov : > > Yes, it works. > > The scenario that I have is like this: > > I am trying to down-size a png image so I > > > > open it with with-image-from-file > > copy resized image (copy-image old-image new-image ....) > > save it (write-image-to-file new-image-file-name :image new-image > > :compression-level 5) > > > > In my case :compression-level doesn't change the size of the output > image. > > Probably it happens because the original file that I am trying to re-size > is > > already compressed to the maximum. > > I fear I don't know enough about PNG compression to say anything > profound here. I do suspect that it is a general GD issue rather than > a cl-gd problem, so maybe asking on some GD support channel would be > helpful? You'd propably need to supply the image in question to have > someone comment on what compression you can expect. > > -Hans > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffrey at cunningham.net Fri Oct 17 03:57:48 2008 From: jeffrey at cunningham.net (Jeff Cunningham) Date: Thu, 16 Oct 2008 20:57:48 -0700 Subject: [cl-gd-devel] problem compiling cl-gd-glue.c on 64-bit sytem Message-ID: <48F80D3C.5000201@cunningham.net> Has anyone had a problem compiling the cl-gd-glue.c into the shared library on a 64-bit system? It's never given me any problem on 32-bit systems, and I could swear I've done it on a 64-bit AMD Debian system before, but I just tried it on a new one and got this error: make gcc -I/usr/local/include -fPIC -c cl-gd-glue.c ld -shared -lgd -lz -lpng -ljpeg -lfreetype -liconv -lm -lc cl-gd-glue.o -o cl-gd-glue.so -L/usr/local/lib ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value make: *** [cl-gd-glue.so] Error 1 I'm trying to install cl-gd-0.5.6 straight from Edi's site. gd-2.0.35 is installed, along with the other dependencies. This is puzzling. Jeff From jeffrey at cunningham.net Fri Oct 17 15:55:00 2008 From: jeffrey at cunningham.net (Jeff Cunningham) Date: Fri, 17 Oct 2008 08:55:00 -0700 Subject: [cl-gd-devel] problem compiling cl-gd-glue.c on 64-bit sytem In-Reply-To: <48F80D3C.5000201@cunningham.net> References: <48F80D3C.5000201@cunningham.net> Message-ID: <48F8B554.9030200@cunningham.net> Jeff Cunningham wrote: > Has anyone had a problem compiling the cl-gd-glue.c into the shared > library on a 64-bit system? It's never given me any problem on 32-bit > systems, and I could swear I've done it on a 64-bit AMD Debian system > before, but I just tried it on a new one and got this error: > > make > gcc -I/usr/local/include -fPIC -c cl-gd-glue.c > ld -shared -lgd -lz -lpng -ljpeg -lfreetype -liconv -lm -lc cl-gd-glue.o > -o cl-gd-glue.so -L/usr/local/lib > ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a > local symbol' can not be used when making a shared object; recompile > with -fPIC > /usr/local/lib/libz.a: could not read symbols: Bad value > make: *** [cl-gd-glue.so] Error 1 > > I'm trying to install cl-gd-0.5.6 straight from Edi's site. gd-2.0.35 is > installed, along with the other dependencies. This is puzzling. > > Jeff > > Well, I have a solution, but its a hack (for the benefit of anyone else faced with a similar problem). Clearly, the linker is prefering to use the static library libz.a instead of the dynamic one libz.so. Why, I don't know. It works when I modify the Makefile to this: cl-gd-glue.so: gcc -I/usr/local/include -fPIC -c cl-gd-glue.c ld -shared -lgd /usr/lib/libz.so -lpng -ljpeg -lfreetype -liconv -lm -lc cl-gd-glue.o -o cl-gd-glue.so -L/usr/local/lib rm cl-gd-glue.o Jeff