From paul.thirumalai at gmail.com Thu Mar 1 19:37:48 2007 From: paul.thirumalai at gmail.com (Paul Thirumalai) Date: Thu, 1 Mar 2007 11:37:48 -0800 Subject: [cl-gd-devel] controling brightness, intensity, contrast of an image. Message-ID: <900c9adf0703011137v6cb7c343t9400de616bcb68c5@mail.gmail.com> Hi I just wanted to know if there is a way to control/modify the contrast, brightness, intensity of an image using CL-GD. If there is some sample code that would be awesome. Thanks Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Thu Mar 1 22:56:19 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 01 Mar 2007 23:56:19 +0100 Subject: [cl-gd-devel] controling brightness, intensity, contrast of an image. In-Reply-To: <900c9adf0703011137v6cb7c343t9400de616bcb68c5@mail.gmail.com> (Paul Thirumalai's message of "Thu, 1 Mar 2007 11:37:48 -0800") References: <900c9adf0703011137v6cb7c343t9400de616bcb68c5@mail.gmail.com> Message-ID: On Thu, 1 Mar 2007 11:37:48 -0800, "Paul Thirumalai" wrote: > I just wanted to know if there is a way to control/modify the > contrast, brightness, intensity of an image using CL-GD. I don't think there is. Note that CL-GD only supports what GD has to offer, and I'm pretty sure this surpasses GD's forces. Sounds like a task for something like ImageMagick. Cheers, Edi. From paul.thirumalai at gmail.com Fri Mar 2 01:02:41 2007 From: paul.thirumalai at gmail.com (Paul Thirumalai) Date: Thu, 1 Mar 2007 17:02:41 -0800 Subject: [cl-gd-devel] controling brightness, intensity, contrast of an image. In-Reply-To: References: <900c9adf0703011137v6cb7c343t9400de616bcb68c5@mail.gmail.com> Message-ID: <900c9adf0703011702w21e47270y63738d3dcd1de789@mail.gmail.com> Does the cl-imagemagick work with cmucl. Do you know? On 3/1/07, Edi Weitz wrote: > > On Thu, 1 Mar 2007 11:37:48 -0800, "Paul Thirumalai" < > paul.thirumalai at gmail.com> wrote: > > > I just wanted to know if there is a way to control/modify the > > contrast, brightness, intensity of an image using CL-GD. > > I don't think there is. Note that CL-GD only supports what GD has to > offer, and I'm pretty sure this surpasses GD's forces. Sounds like a > task for something like ImageMagick. > > Cheers, > Edi. > _______________________________________________ > 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 edi at agharta.de Fri Mar 2 06:35:07 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 02 Mar 2007 07:35:07 +0100 Subject: [cl-gd-devel] controling brightness, intensity, contrast of an image. In-Reply-To: <900c9adf0703011702w21e47270y63738d3dcd1de789@mail.gmail.com> (Paul Thirumalai's message of "Thu, 1 Mar 2007 17:02:41 -0800") References: <900c9adf0703011137v6cb7c343t9400de616bcb68c5@mail.gmail.com> <900c9adf0703011702w21e47270y63738d3dcd1de789@mail.gmail.com> Message-ID: On Thu, 1 Mar 2007 17:02:41 -0800, "Paul Thirumalai" wrote: > Does the cl-imagemagick work with cmucl. Do you know? Nope, never tried it. From edi at agharta.de Sun Mar 11 01:10:52 2007 From: edi at agharta.de (Edi Weitz) Date: Sun, 11 Mar 2007 02:10:52 +0100 Subject: [cl-gd-devel] Re: CL-GD on OS X In-Reply-To: <2EAF9754-D230-4C05-B584-D81BCBE7FB6A@gmail.com> (Chhi'med Kunzang's message of "Sat, 10 Mar 2007 10:17:19 -0700") References: <2EAF9754-D230-4C05-B584-D81BCBE7FB6A@gmail.com> Message-ID: On Sat, 10 Mar 2007 10:17:19 -0700, "Chhi'med Kunzang" wrote: > I just joined the list, so sorry if this has been covered. It's probably more appropriate to continue this discussion on the CL-GD mailing list. I've put the list on Cc, but you'll have to subscribe to post something there. > Has anyone installed CL-GD on on OS X. I'm using Lispworks 5. I > compiled CL-GD-GLUE fine, and it seems to load, but I get a series > of errors when I run the test. > > I'm sure it's a stupid configuration problem, but maybe someone else > has worked through it before? I don't have a Mac, so I can't confirm that CL-GD runs on OS X, but I think that there's nothing specific in the code that prevents it from running there. > "_gdImageCreate". The underline shouldn't be there. The C function is called "gdImageCreate" (unless this is some name mangling convention on OS X that I'm not aware of). Where did you get the GD library from and where is it located? From lispercat at gmail.com Tue Mar 13 03:40:54 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Mon, 12 Mar 2007 22:40:54 -0500 Subject: [cl-gd-devel] Problems with (cl-gd-test:test) Message-ID: Hi, I've installed the libgd on my linux box (it's in /usr/local/lib/libgd.so). I've installed the bindings and now when I compile it it complained about not being able to find gdImageCreate and gdSmallFont. When I try to (cl-gd-test:test) (after (asdf:oos 'asdf:load-op :cl-gd-test)) it give me following output: Test 1 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 2 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 3 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 4 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 5 failed with the following error: Error in function CL-GD:CREATE-IMAGE-FROM-FILE: File #P"/home/andrews/systems/cl-gd-0.5.2/test/one-pixel.png" could not be found Test 6 failed with the following error: Error in function CL-GD:CREATE-IMAGE-FROM-FILE: File #P"/home/andrews/systems/cl-gd-0.5.2/test/one-pixel.png" could not be found Test 7 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 8 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 9 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 10 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE-FROM-JPEG-FILE is undefined. Test 11 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 12 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 13 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 14 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 15 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 16 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE-TRUE-COLOR is undefined. Test 17 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 18 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE is undefined. Test 19 failed with the following error: Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function CL-GD::GD-IMAGE-CREATE-TRUE-COLOR is undefined. Done. I checked the libgd.so, looks like the gdImageCreate and the rest of the functions are there. What could be causing the problem? Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Tue Mar 13 10:21:18 2007 From: edi at agharta.de (Edi Weitz) Date: Tue, 13 Mar 2007 11:21:18 +0100 Subject: [cl-gd-devel] Problems with (cl-gd-test:test) In-Reply-To: (Andrei Stebakov's message of "Mon, 12 Mar 2007 22:40:54 -0500") References: Message-ID: On Mon, 12 Mar 2007 22:40:54 -0500, "Andrei Stebakov" wrote: > I've installed the libgd on my linux box (it's in > /usr/local/lib/libgd.so). I've installed the bindings and now when > I compile it it complained about not being able to find > gdImageCreate and gdSmallFont. > > [snip] > > I checked the libgd.so, looks like the gdImageCreate and the rest of > the functions are there. What could be causing the problem? CL-GD loads libgd.so indirectly through cl-gd-glue.so, so the OS has to be able to find it. How did you compile cl-gd-glue.so? Did you get any error messages? Does the OS look into /usr/local/lib? Does it work if you put the library into /usr/lib? Which Lisp are you using? From lispercat at gmail.com Tue Mar 13 16:39:21 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 13 Mar 2007 12:39:21 -0400 Subject: [cl-gd-devel] Problems with (cl-gd-test:test) In-Reply-To: References: Message-ID: I missed the cl-gd-glue.so. Now in order to compile it I had to install the libiconv. So I rebuilt the libgd with it and I put cl-gd-glue.so in both /usr/lib and /usr/local/lib. The problem is still the same, when I (asdf:oos 'asdf:compile-op :cl-gd) it gives me 2 errors: Undefined foreign symbol: "gdImageCreate" [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR] Restarts: 0: [CONTINUE] Return NIL from load of #P"/home/andrews/systems/cl-gd-0.5.2 /gd-uffi.x86f". 1: [RETRY] Retry performing # on #. 2: [ACCEPT] Continue, treating # on # as having been successful. 3: [ABORT] Return to SLIME's top level. 4: [ABORT] Return to Top-Level. Backtrace: 0: (KERNEL:UNDEFINED-FOREIGN-SYMBOL-ERROR-HANDLER "" #.(SYSTEM:INT-SAP #x3FFFBB3C) # (16)) 1: (KERNEL::INTERNAL-ERROR #.(SYSTEM:INT-SAP #x3FFFB7B4) #) 2: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") 3: ("funcall2+#x2C [#x80553EE] /usr/bin/cmucl") 4: ("interrupt_internal_error+#xC3 [#x80506F1] /usr/bin/cmucl") 5: ("sigtrap_handler+#x187 [#x8055260] /usr/bin/cmucl") 6: ("Foreign function call land") 7: ("os_link_one_symbol+#xC3 [#x8056603] /usr/bin/cmucl") 8: (LISP::ADD-FOREIGN-LINKAGE "gdImageCreate" :CODE #("resolve_linkage_tramp" 1 NIL "undefined_tramp" 1 ...) # ...) 9: (LISP::FOREIGN-SYMBOL-ADDRESS-AUX "gdImageCreate" :CODE) 10: (LISP::FOP-FOREIGN-FIXUP) 11: (LISP::LOAD-GROUP #) 12: (LISP::FASLOAD #) 13: (LISP::INTERNAL-LOAD #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" :ERROR :BINARY) 14: (LISP::INTERNAL-LOAD #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" :ERROR NIL) 15: (LOAD #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" :VERBOSE NIL :PRINT ...) 16: ((METHOD ASDF:PERFORM NIL (ASDF:LOAD-OP ASDF:CL-SOURCE-FILE)) (#() . #(#)) # # #) 17: ("LAMBDA (G1558 G1559 G1560)" #<#1=unused-arg> #<#1#> # #) 18: ((FLET #:G0 ASDF:OPERATE)) 19: (ASDF:OPERATE ASDF:COMPILE-OP :CL-GD) 20: (ASDF:OPERATE 2 ASDF:COMPILE-OP :CL-GD)[:EXTERNAL] 21: ("DEFSLIMEFUN INTERACTIVE-EVAL") 22: (SWANK::CALL-WITH-BUFFER-SYNTAX #) 23: ("DEFUN EVAL-FOR-EMACS") 24: ("DEFINTERFACE CALL-WITH-DEBUGGER-HOOK" # #) 25: ("DEFUN HANDLE-REQUEST") 26: ("DEFINTERFACE CALL-WITH-DEBUGGER-HOOK" # #) 27: (SWANK::CALL-WITH-REDIRECTED-IO # #) 28: (SWANK::CALL-WITH-CONNECTION # #) 29: (SWANK::HANDLE-REQUEST #) 30: (SWANK::PROCESS-AVAILABLE-INPUT # #) 31: ((FLET SWANK::HANDLER SWANK::INSTALL-SIGIO-HANDLER)) 32: (SWANK-BACKEND::SIGIO-HANDLER #<#1=unused-arg> #<#1#> #<#1#>) 33: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") 34: ("funcall3+#x32 [#x8055422] /usr/bin/cmucl") 35: ("interrupt_handle_now+#x105 [#x8050940] /usr/bin/cmucl") 36: ("NIL+#x8050E07 [#x8050E07] /usr/bin/cmucl") 37: ("Foreign function call land") 38: (SYSTEM:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL) 39: (LISP::DO-INPUT #) 40: (LISP::INPUT-CHARACTER # NIL (LISP::*EOF*)) 41: (LISP::SYNONYM-IN # NIL (LISP::*EOF*)) 42: (LISP::TWO-WAY-IN #, Output = #> NIL (LISP::*EOF*)) 43: (READ-CHAR #, Output = #> And Undefined foreign symbol: "gdFontSmall" [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR] Restarts: 0: [CONTINUE] Return NIL from load of #P"/home/andrews/systems/cl-gd-0.5.2 /strings.x86f". 1: [RETRY] Retry performing # on #. 2: [ACCEPT] Continue, treating # on # as having been successful. 3: [ABORT] Return to SLIME's top level. 4: [ABORT] Return to Top-Level. Backtrace: 0: (KERNEL:UNDEFINED-FOREIGN-SYMBOL-ERROR-HANDLER "" #.(SYSTEM:INT-SAP #x3FFFBB3C) # (16)) 1: (KERNEL::INTERNAL-ERROR #.(SYSTEM:INT-SAP #x3FFFB7B4) #) 2: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") 3: ("funcall2+#x2C [#x80553EE] /usr/bin/cmucl") 4: ("interrupt_internal_error+#xC3 [#x80506F1] /usr/bin/cmucl") 5: ("sigtrap_handler+#x187 [#x8055260] /usr/bin/cmucl") 6: ("Foreign function call land") 7: ("os_link_one_symbol+#xC3 [#x8056603] /usr/bin/cmucl") 8: (LISP::ADD-FOREIGN-LINKAGE "gdFontSmall" :DATA #("resolve_linkage_tramp" 1 NIL "undefined_tramp" 1 ...) # ...) 9: (LISP::FOREIGN-SYMBOL-ADDRESS-AUX "gdFontSmall" :DATA) 10: (LISP::FOP-FOREIGN-DATA-FIXUP) 11: (LISP::LOAD-GROUP #) 12: (LISP::FASLOAD #) 13: (LISP::INTERNAL-LOAD #P"/home/andrews/systems/cl-gd-0.5.2/strings.x86f" #P"/home/andrews/systems/cl-gd-0.5.2/strings.x86f" :ERROR :BINARY) I am using debian linux (sarge), cmucl 19d. Thank you, Andrew On 3/13/07, Edi Weitz wrote: > > On Mon, 12 Mar 2007 22:40:54 -0500, "Andrei Stebakov" > wrote: > > > I've installed the libgd on my linux box (it's in > > /usr/local/lib/libgd.so). I've installed the bindings and now when > > I compile it it complained about not being able to find > > gdImageCreate and gdSmallFont. > > > > [snip] > > > > I checked the libgd.so, looks like the gdImageCreate and the rest of > > the functions are there. What could be causing the problem? > > CL-GD loads libgd.so indirectly through cl-gd-glue.so, so the OS has > to be able to find it. How did you compile cl-gd-glue.so? Did you > get any error messages? Does the OS look into /usr/local/lib? Does > it work if you put the library into /usr/lib? Which Lisp are you > using? > _______________________________________________ > 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 lispercat at gmail.com Tue Mar 13 18:20:31 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Tue, 13 Mar 2007 14:20:31 -0400 Subject: [cl-gd-devel] Problems with (cl-gd-test:test) In-Reply-To: References: Message-ID: I installed debian package, and now test works, thank you! Andrew On 3/13/07, Andrei Stebakov wrote: > > I missed the cl-gd-glue.so. Now in order to compile it I had to install > the libiconv. So I rebuilt the libgd with it and I put cl-gd-glue.so in > both /usr/lib and /usr/local/lib. The problem is still the same, when I > (asdf:oos 'asdf:compile-op :cl-gd) it gives me 2 errors: > > Undefined foreign symbol: "gdImageCreate" > [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR] > > Restarts: > 0: [CONTINUE] Return NIL from load of #P"/home/andrews/systems/cl- > gd-0.5.2/gd-uffi.x86f ". > 1: [RETRY] Retry performing # on > #. > 2: [ACCEPT] Continue, treating # on > # as having been successful. > 3: [ABORT] Return to SLIME's top level. > 4: [ABORT] Return to Top-Level. > > Backtrace: > 0: (KERNEL:UNDEFINED-FOREIGN-SYMBOL-ERROR-HANDLER "" > #.(SYSTEM:INT-SAP > #x3FFFBB3C) > # #) at > #x3FFFB7B4> > (16)) > 1: (KERNEL::INTERNAL-ERROR #.(SYSTEM:INT-SAP #x3FFFB7B4) #) > 2: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") > 3: ("funcall2+#x2C [#x80553EE] /usr/bin/cmucl") > 4: ("interrupt_internal_error+#xC3 [#x80506F1] /usr/bin/cmucl") > 5: ("sigtrap_handler+#x187 [#x8055260] /usr/bin/cmucl") > 6: ("Foreign function call land") > 7: ("os_link_one_symbol+#xC3 [#x8056603] /usr/bin/cmucl") > 8: (LISP::ADD-FOREIGN-LINKAGE "gdImageCreate" > :CODE #("resolve_linkage_tramp" 1 NIL > "undefined_tramp" 1 ...) > # :TEST EQUAL :WEAK-P NIL :COUNT 555 > {28073825}> > ...) > 9: (LISP::FOREIGN-SYMBOL-ADDRESS-AUX "gdImageCreate" :CODE) > 10: (LISP::FOP-FOREIGN-FIXUP) > 11: (LISP::LOAD-GROUP > # ">) > 12: (LISP::FASLOAD > #) > 13: (LISP::INTERNAL-LOAD > #P"/home/andrews/systems/cl- gd-0.5.2/gd-uffi.x86f" > #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" > :ERROR :BINARY) > 14: (LISP::INTERNAL-LOAD > #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" > #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" > :ERROR NIL) > 15: (LOAD #P"/home/andrews/systems/cl-gd-0.5.2/gd-uffi.x86f" > :VERBOSE NIL > :PRINT ...) > 16: ((METHOD ASDF:PERFORM NIL (ASDF:LOAD-OP ASDF:CL-SOURCE-FILE)) > (#() . #(#)) # # > #) > 17: ("LAMBDA (G1558 G1559 G1560)" #<#1=unused-arg> #<#1#> > # > #) > 18: ((FLET #:G0 ASDF:OPERATE)) > 19: (ASDF:OPERATE ASDF:COMPILE-OP :CL-GD) > 20: (ASDF:OPERATE 2 ASDF:COMPILE-OP :CL-GD)[:EXTERNAL] > 21: ("DEFSLIMEFUN INTERACTIVE-EVAL") > 22: (SWANK::CALL-WITH-BUFFER-SYNTAX > #) > 23: ("DEFUN EVAL-FOR-EMACS") > 24: ("DEFINTERFACE CALL-WITH-DEBUGGER-HOOK" > # > #) > 25: ("DEFUN HANDLE-REQUEST") > 26: ("DEFINTERFACE CALL-WITH-DEBUGGER-HOOK" > # > #) > 27: (SWANK::CALL-WITH-REDIRECTED-IO # > # CALL-WITH-CONNECTION" > {59386AE9}>) > 28: (SWANK::CALL-WITH-CONNECTION # > # {58F41831}>) > 29: (SWANK::HANDLE-REQUEST #) > 30: (SWANK::PROCESS-AVAILABLE-INPUT # > # INSTALL-SIGIO-HANDLER" > {59386A99}>) > 31: ((FLET SWANK::HANDLER SWANK::INSTALL-SIGIO-HANDLER)) > 32: (SWANK-BACKEND::SIGIO-HANDLER #<#1=unused-arg> #<#1#> #<#1#>) > 33: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") > 34: ("funcall3+#x32 [#x8055422] /usr/bin/cmucl") > 35: ("interrupt_handle_now+#x105 [#x8050940] /usr/bin/cmucl") > 36: ("NIL+#x8050E07 [#x8050E07] /usr/bin/cmucl") > 37: ("Foreign function call land") > 38: (SYSTEM:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL) > 39: (LISP::DO-INPUT #) > 40: (LISP::INPUT-CHARACTER # NIL > (LISP::*EOF*)) > 41: (LISP::SYNONYM-IN # > NIL > (LISP::*EOF*)) > 42: (LISP::TWO-WAY-IN > #, > Output = #> > NIL > (LISP::*EOF*)) > 43: (READ-CHAR > #, > Output = #> > > And > > Undefined foreign symbol: "gdFontSmall" > [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR] > > Restarts: > 0: [CONTINUE] Return NIL from load of #P"/home/andrews/systems/cl- > gd-0.5.2/strings.x86f". > 1: [RETRY] Retry performing # on > #. > 2: [ACCEPT] Continue, treating # on > # as having been successful. > 3: [ABORT] Return to SLIME's top level. > 4: [ABORT] Return to Top-Level. > > Backtrace: > 0: (KERNEL:UNDEFINED-FOREIGN-SYMBOL-ERROR-HANDLER "" > #.(SYSTEM:INT-SAP > #x3FFFBB3C) > # #) at > #x3FFFB7B4> > (16)) > 1: (KERNEL::INTERNAL-ERROR #.(SYSTEM:INT-SAP #x3FFFB7B4) #) > 2: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") > 3: ("funcall2+#x2C [#x80553EE] /usr/bin/cmucl") > 4: ("interrupt_internal_error+#xC3 [#x80506F1] /usr/bin/cmucl") > 5: ("sigtrap_handler+#x187 [#x8055260] /usr/bin/cmucl") > 6: ("Foreign function call land") > 7: ("os_link_one_symbol+#xC3 [#x8056603] /usr/bin/cmucl") > 8: (LISP::ADD-FOREIGN-LINKAGE "gdFontSmall" > :DATA #("resolve_linkage_tramp" 1 NIL > "undefined_tramp" 1 ...) > # :TEST EQUAL :WEAK-P NIL :COUNT 555 > {28073825}> > ...) > 9: (LISP::FOREIGN-SYMBOL-ADDRESS-AUX "gdFontSmall" :DATA) > 10: (LISP::FOP-FOREIGN-DATA-FIXUP) > 11: (LISP::LOAD-GROUP > # /strings.x86f">) > 12: (LISP::FASLOAD > #) > 13: (LISP::INTERNAL-LOAD > #P"/home/andrews/systems/cl- gd-0.5.2/strings.x86f" > #P"/home/andrews/systems/cl-gd-0.5.2/strings.x86f" > :ERROR :BINARY) > > I am using debian linux (sarge), cmucl 19d. > > Thank you, > Andrew > > On 3/13/07, Edi Weitz wrote: > > > > On Mon, 12 Mar 2007 22:40:54 -0500, "Andrei Stebakov" < > > lispercat at gmail.com> wrote: > > > > > I've installed the libgd on my linux box (it's in > > > /usr/local/lib/libgd.so). I've installed the bindings and now when > > > I compile it it complained about not being able to find > > > gdImageCreate and gdSmallFont. > > > > > > [snip] > > > > > > I checked the libgd.so, looks like the gdImageCreate and the rest of > > > the functions are there. What could be causing the problem? > > > > CL-GD loads libgd.so indirectly through cl-gd-glue.so, so the OS has > > to be able to find it. How did you compile cl-gd-glue.so? Did you > > get any error messages? Does the OS look into /usr/local/lib? Does > > it work if you put the library into /usr/lib? Which Lisp are you > > using? > > _______________________________________________ > > 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 lispercat at gmail.com Thu Mar 15 04:50:04 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 15 Mar 2007 00:50:04 -0400 Subject: [cl-gd-devel] Error in function CREATE-IMAGE-FROM-FILE: Message-ID: I got the following error trying to draw text on an image. The test.png is a valid file, I can view it in browser. Here is the debug dump (I use CMUCL 19b, latest libgd and cl-gd, with-image macro works fine): Error in function CREATE-IMAGE-FROM-FILE: Could not create image from PNG file "/tmp/dir1/test.png" [Condition of type SIMPLE-ERROR] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [ABORT] Return to Top-Level. Backtrace: 0: (CREATE-IMAGE-FROM-FILE "/tmp/dir1/test.png" NIL) 1: (CREATE-TEXT-IMAGE-ON-IMAGE #P"/tmp/dir1/test.png" "Hello!" "arial" 100 ...) 2: ("DEFSLIMEFUN INTERACTIVE-EVAL") Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Thu Mar 15 05:10:21 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 15 Mar 2007 01:10:21 -0400 Subject: [cl-gd-devel] Re: Error in function CREATE-IMAGE-FROM-FILE: In-Reply-To: References: Message-ID: Here I attach the image: On 3/15/07, Andrei Stebakov wrote: > > I got the following error trying to draw text on an image. The test.png is > a valid file, I can view it in browser. Here is the debug dump (I use CMUCL > 19b, latest libgd and cl-gd, with-image macro works fine): > > Error in function CREATE-IMAGE-FROM-FILE: > Could not create image from PNG file "/tmp/dir1/test.png" > [Condition of type SIMPLE-ERROR] > > Restarts: > 0: [ABORT] Return to SLIME's top level. > 1: [ABORT] Return to Top-Level. > > Backtrace: > 0: (CREATE-IMAGE-FROM-FILE "/tmp/dir1/test.png" NIL) > 1: (CREATE-TEXT-IMAGE-ON-IMAGE #P"/tmp/dir1/test.png" > "Hello!" > "arial" > 100 > ...) > 2: ("DEFSLIMEFUN INTERACTIVE-EVAL") > > Thank you, > Andrew > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.png Type: image/png Size: 43042 bytes Desc: not available URL: From edi at agharta.de Thu Mar 15 11:14:31 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 15 Mar 2007 12:14:31 +0100 Subject: [cl-gd-devel] Error in function CREATE-IMAGE-FROM-FILE: In-Reply-To: (Andrei Stebakov's message of "Thu, 15 Mar 2007 00:50:04 -0400") References: Message-ID: On Thu, 15 Mar 2007 00:50:04 -0400, "Andrei Stebakov" wrote: > The test.png is a valid file, I can view it in browser. Here's the output of "identify" (which is a part of ImageMagick): edi at Groucho:~/desktop$ identify test.png test.png JPEG 400x400 DirectClass 42kb So, maybe you'll have more luck if you rename the file to "test.jpg" - let us know. From edi at agharta.de Thu Mar 15 11:57:19 2007 From: edi at agharta.de (Edi Weitz) Date: Thu, 15 Mar 2007 12:57:19 +0100 Subject: [cl-gd-devel] Error in function CREATE-IMAGE-FROM-FILE: In-Reply-To: (Edi Weitz's message of "Thu, 15 Mar 2007 12:14:31 +0100") References: Message-ID: On Thu, 15 Mar 2007 12:14:31 +0100, Edi Weitz wrote: > So, maybe you'll have more luck if you rename the file to "test.jpg" > - let us know. For the sake of completeness: If you insist on calling the file "test.png", there's also the optional TYPE parameter of CREATE-IMAGE-FROM-FILE. http://weitz.de/cl-gd/#create-image-from-file From lispercat at gmail.com Thu Mar 15 14:36:45 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Thu, 15 Mar 2007 10:36:45 -0400 Subject: [cl-gd-devel] Error in function CREATE-IMAGE-FROM-FILE: In-Reply-To: References: Message-ID: Oh, I am really sorry... This image came to me named as png and I even didn't think it wasn't that because it's parent (they transformed it) was a png! Shame on me! Andrew On 3/15/07, Edi Weitz wrote: > > On Thu, 15 Mar 2007 12:14:31 +0100, Edi Weitz wrote: > > > So, maybe you'll have more luck if you rename the file to "test.jpg" > > - let us know. > > For the sake of completeness: If you insist on calling the file > "test.png", there's also the optional TYPE parameter of > CREATE-IMAGE-FROM-FILE. > > http://weitz.de/cl-gd/#create-image-from-file > _______________________________________________ > 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 lispercat at gmail.com Sat Mar 17 13:39:00 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sat, 17 Mar 2007 09:39:00 -0400 Subject: [cl-gd-devel] Drawing anti-aliased text with transparent background Message-ID: Here is what I've got: http://www.greenpixeldesign.com/cphandler/tmp-img/test.png I'd like to remove the black outline from the anti-aliased text (I need RGB true color image). I know I am missing some stupid thing, but I experimented with different backgrounds, just doesn't make it right. My current setup is gdlib 2.0.33 on debian, and here is the code; (defun create-text-image (text font font-size file-name) (multiple-value-bind (width height horizont-shift vertical-shift) (get-bounding-rect text font font-size) (with-image* (width height t) (let* ((white (allocate-color 255 255 255)) (black (allocate-color 0 0 0)) (red (allocate-color 255 0 0)) (green (allocate-color 0 255 0)) (blue (allocate-color 0 0 255))) (setf (transparent-color) black) (draw-freetype-string (- 0 horizont-shift) (- height vertical-shift) text :anti-aliased t :font-name font :angle 0 :point-size font-size :color (allocate-color 0 0 255)) ;;(true-color-to-palette) (write-image-to-file file-name :if-exists :supersede))))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Sat Mar 17 13:55:26 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sat, 17 Mar 2007 09:55:26 -0400 Subject: [cl-gd-devel] Re: Drawing anti-aliased text with transparent background In-Reply-To: References: Message-ID: I tred to use the (make-anti-aliased) function: (draw-freetype-string 0 0 text :anti-aliased t :font-name font :angle 0 :point-size font-size :color (make-anti-aliased (allocate-color 0 0 255))) But the lisp gives me the error: The value of CL-GD::COLOR is #S(CL-GD::ANTI-ALIASED-COLOR :COLOR 255 :DO-NOT-BLEND NIL), which is not of type INTEGER. [Condition of type SIMPLE-TYPE-ERROR] Restarts: 0: [STORE-VALUE] Supply a new value of CL-GD::COLOR. 1: [ABORT] Return to SLIME's top level. 2: [ABORT] Return to Top-Level. Backtrace: 0: (LISP::CHECK-TYPE-ERROR CL-GD::COLOR #S(CL-GD::ANTI-ALIASED-COLOR :COLOR 255 :DO-NOT-BLEND NIL) INTEGER NIL) Thank you, Andrew On 3/17/07, Andrei Stebakov wrote: > > Here is what I've got: > http://www.greenpixeldesign.com/cphandler/tmp-img/test.png > I'd like to remove the black outline from the anti-aliased text (I need > RGB true color image). I know I am missing some stupid thing, but I > experimented with different backgrounds, just doesn't make it right. My > current setup is gdlib 2.0.33 on debian, and here is the code; > > (defun create-text-image (text font font-size file-name) > (multiple-value-bind (width height horizont-shift vertical-shift) > (get-bounding-rect text font font-size) > (with-image* (width height t) > (let* ((white (allocate-color 255 255 255)) > (black (allocate-color 0 0 0)) > (red (allocate-color 255 0 0)) > (green (allocate-color 0 255 0)) > (blue (allocate-color 0 0 255))) > (setf (transparent-color) black) > (draw-freetype-string (- 0 horizont-shift) (- height vertical-shift) > text > :anti-aliased t > :font-name font > :angle 0 > :point-size font-size > :color (allocate-color 0 0 255)) > > ;;(true-color-to-palette) > (write-image-to-file file-name :if-exists :supersede))))) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Sat Mar 17 14:19:43 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sat, 17 Mar 2007 10:19:43 -0400 Subject: [cl-gd-devel] Re: Drawing anti-aliased text with transparent background In-Reply-To: References: Message-ID: Ah, it looks like make-anti-aliased is only for brushes, for drawing lines... I wonder what technique works for the text? Thanks! Andrew On 3/17/07, Andrei Stebakov wrote: > > I tred to use the (make-anti-aliased) function: > (draw-freetype-string 0 0 > text > :anti-aliased t > :font-name font > :angle 0 > :point-size font-size > :color (make-anti-aliased (allocate-color 0 0 255))) > > But the lisp gives me the error: > > The value of CL-GD::COLOR is #S(CL-GD::ANTI-ALIASED-COLOR > :COLOR 255 > :DO-NOT-BLEND NIL), which is not of type > INTEGER. > [Condition of type SIMPLE-TYPE-ERROR] > > Restarts: > 0: [STORE-VALUE] Supply a new value of CL-GD::COLOR. > 1: [ABORT] Return to SLIME's top level. > 2: [ABORT] Return to Top-Level. > > Backtrace: > 0: (LISP::CHECK-TYPE-ERROR CL-GD::COLOR > #S(CL-GD::ANTI-ALIASED-COLOR > :COLOR 255 > :DO-NOT-BLEND NIL) > INTEGER > NIL) > > Thank you, > Andrew > > On 3/17/07, Andrei Stebakov < lispercat at gmail.com> wrote: > > > > Here is what I've got: > > http://www.greenpixeldesign.com/cphandler/tmp-img/test.png > > I'd like to remove the black outline from the anti-aliased text (I need > > RGB true color image). I know I am missing some stupid thing, but I > > experimented with different backgrounds, just doesn't make it right. My > > current setup is gdlib 2.0.33 on debian, and here is the code; > > > > (defun create-text-image (text font font-size file-name) > > (multiple-value-bind (width height horizont-shift vertical-shift) > > (get-bounding-rect text font font-size) > > (with-image* (width height t) > > (let* ((white (allocate-color 255 255 255)) > > (black (allocate-color 0 0 0)) > > (red (allocate-color 255 0 0)) > > (green (allocate-color 0 255 0)) > > (blue (allocate-color 0 0 255))) > > (setf (transparent-color) black) > > (draw-freetype-string (- 0 horizont-shift) (- height vertical-shift) > > > > text > > :anti-aliased t > > :font-name font > > :angle 0 > > :point-size font-size > > :color (allocate-color 0 0 255)) > > > > ;;(true-color-to-palette) > > (write-image-to-file file-name :if-exists :supersede))))) > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Sun Mar 18 03:17:21 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sat, 17 Mar 2007 23:17:21 -0400 Subject: [cl-gd-devel] Re: Drawing anti-aliased text with transparent background In-Reply-To: References: Message-ID: I got some help from libgd mailing list, so when I put Pierre's sample to lisp here is what I got (solves my problem): (with-image (new width height t) (setf (alpha-blending-p new) nil) (draw-rectangle* 0 0 width height :image new :filled t :color (allocate-color 0 0 0 :image new :alpha 127)) (draw-freetype-string 0 0 text :image new :anti-aliased t :font-name font :angle 0 :point-size font-size :color (allocate-color 0 0 255 :image new)) (setf (save-alpha-p :image new) t) (write-image-to-file file-name :image new :if-exists :supersede))) Thank you, Andrew On 3/17/07, Andrei Stebakov wrote: > > Ah, it looks like make-anti-aliased is only for brushes, for drawing > lines... I wonder what technique works for the text? > > Thanks! > Andrew > > On 3/17/07, Andrei Stebakov wrote: > > > > I tred to use the (make-anti-aliased) function: > > (draw-freetype-string 0 0 > > text > > :anti-aliased t > > :font-name font > > :angle 0 > > :point-size font-size > > :color (make-anti-aliased (allocate-color 0 0 255))) > > > > But the lisp gives me the error: > > > > The value of CL-GD::COLOR is #S(CL-GD::ANTI-ALIASED-COLOR > > :COLOR 255 > > :DO-NOT-BLEND NIL), which is not of > > type INTEGER. > > [Condition of type SIMPLE-TYPE-ERROR] > > > > Restarts: > > 0: [STORE-VALUE] Supply a new value of CL-GD::COLOR. > > 1: [ABORT] Return to SLIME's top level. > > 2: [ABORT] Return to Top-Level. > > > > Backtrace: > > 0: (LISP::CHECK-TYPE-ERROR CL-GD::COLOR > > #S(CL-GD::ANTI-ALIASED-COLOR > > :COLOR 255 > > :DO-NOT-BLEND NIL) > > INTEGER > > NIL) > > > > Thank you, > > Andrew > > > > On 3/17/07, Andrei Stebakov < lispercat at gmail.com> wrote: > > > > > > Here is what I've got: > > > http://www.greenpixeldesign.com/cphandler/tmp-img/test.png > > > I'd like to remove the black outline from the anti-aliased text (I > > > need RGB true color image). I know I am missing some stupid thing, but I > > > experimented with different backgrounds, just doesn't make it right. My > > > current setup is gdlib 2.0.33 on debian, and here is the code; > > > > > > (defun create-text-image (text font font-size file-name) > > > (multiple-value-bind (width height horizont-shift vertical-shift) > > > (get-bounding-rect text font font-size) > > > (with-image* (width height t) > > > (let* ((white (allocate-color 255 255 255)) > > > (black (allocate-color 0 0 0)) > > > (red (allocate-color 255 0 0)) > > > (green (allocate-color 0 255 0)) > > > (blue (allocate-color 0 0 255))) > > > (setf (transparent-color) black) > > > (draw-freetype-string (- 0 horizont-shift) (- height > > > vertical-shift) > > > text > > > :anti-aliased t > > > :font-name font > > > :angle 0 > > > :point-size font-size > > > :color (allocate-color 0 0 255)) > > > > > > ;;(true-color-to-palette) > > > (write-image-to-file file-name :if-exists :supersede))))) > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lispercat at gmail.com Sun Mar 18 23:20:52 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sun, 18 Mar 2007 19:20:52 -0400 Subject: [cl-gd-devel] Help with the multline text Message-ID: I am trying to use draw-freetype-string to output the multiline text. Here I go: (defun get-bounding-rect (text font font-size) (with-image* (0 0) (let ((rect (draw-freetype-string 0 0 text :do-not-draw t :font-name font :angle 0 :line-spacing 1.05d0 :color (find-color 0 0 255 :resolve t) :point-size font-size))) (values (- (aref rect 2) (aref rect 0)) (- (aref rect 3) (aref rect 5)) (aref rect 0) (aref rect 1) rect)))) When I call it (get-bounding-rect "Some #\Newline text" "arial" 50) I get an error: Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: #S(CL-GD::IMAGE :IMG #) is not of type (OR NULL SYSTEM:SYSTEM-AREA-POINTER (ALIEN:ALIEN (* #))) [Condition of type TYPE-ERROR] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [ABORT] Return to Top-Level. Backtrace: 0: (CL-GD::GD-IMAGE-STRING-FT-EX #S(CL-GD::IMAGE :IMG #) # 0 "arial" ...) 1: (DRAW-FREETYPE-STRING 0 0 "Some #Newline text" :ANTI-ALIASED ...) 2: (GET-BOUNDING-RECT "Some #Newline text" "arial" 50) 3: (GET-BOUNDING-RECT "Some #Newline text" "arial" 50) I think it doesn't like my :line-spacing 1.05d0 parameter. Also I am not sure that I can provide a string with #Newline. What's the proper way to do it? Thank you, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Mon Mar 19 00:46:57 2007 From: edi at agharta.de (Edi Weitz) Date: Mon, 19 Mar 2007 01:46:57 +0100 Subject: [cl-gd-devel] New release 0.5.3 (Was: Help with the multline text) In-Reply-To: (Andrei Stebakov's message of "Sun, 18 Mar 2007 19:20:52 -0400") References: Message-ID: On Sun, 18 Mar 2007 19:20:52 -0400, "Andrei Stebakov" wrote: > When I call it (get-bounding-rect "Some #\Newline text" "arial" 50) > I get an error: > > Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: Ah, yes, there was a bug in there. Thanks for the report. The new release should fix that. > (defun get-bounding-rect (text font font-size) > (with-image* (0 0) > (let ((rect (draw-freetype-string 0 0 text > :do-not-draw t > :font-name font > :angle 0 > :line-spacing 1.05d0 > :color (find-color 0 0 255 :resolve t) > :point-size font-size))) > (values (- (aref rect 2) (aref rect 0)) (- (aref rect 3) (aref rect > 5)) (aref rect 0) (aref rect 1) rect)))) Here's an easier version: (defun get-bounding-rect (text font font-size) (let ((rect (draw-freetype-string 0 0 text :do-not-draw t :font-name font :line-spacing 1.05d0 :point-size font-size))) (values (- (aref rect 2) (aref rect 0)) (- (aref rect 3) (aref rect 5)) (aref rect 0) (aref rect 1) rect))) > I think it doesn't like my :line-spacing 1.05d0 parameter. That wasn't really the problem (but it showed the symptoms). > Also I am not sure that I can provide a string with #Newline. You can't do it the way you did. There are basically two easy ways to do it in portable Common Lisp. Number one: (get-bounding-rect "Some text" "arial" 50) Number two: (get-bounding-rect #.(format nil "Some~%text") "arial" 50) Or use CL-INTERPOL: (get-bounding-rect #?"Some\ntext" "arial" 50) Cheers, Edi. From lispercat at gmail.com Sat Mar 24 03:26:41 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Fri, 23 Mar 2007 22:26:41 -0500 Subject: [cl-gd-devel] Error with draw-feetype-string Message-ID: I am not sure if it's hunchentoot or gd because when I specify "arial" for the functon, it works. When the same string comes from (session-value 'text) I got following error: Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: "arial" is not of type (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8)))) 0: (DEBUG:BACKTRACE 536870911 #) 1: (HUNCHENTOOT:GET-BACKTRACE #) 2: ("DEFUN PROCESS-REQUEST" #) 3: (SIGNAL #) 4: (ERROR TYPE-ERROR :FUNCTION-NAME CL-GD::GD-IMAGE-STRING-FT :DATUM "arial" :EXPECTED-TYPE (OR SIMPLE-BASE-STRING NULL (ALIEN:ALIEN (* (ALIEN:SIGNED 8))))) . . . 6: (KERNEL::INTERNAL-ERROR #.(SYSTEM:INT-SAP #x3FFFBF04) #) 7: ("call_into_lisp+#x8C [#x805560C] /usr/bin/cmucl") 8: ("funcall2+#x2C [#x80553EE] /usr/bin/cmucl") 9: ("interrupt_internal_error+#xC3 [#x80506F1] /usr/bin/cmucl") 10: ("sigtrap_handler+#x187 [#x8055260] /usr/bin/cmucl") 11: (CL-GD::GD-IMAGE-STRING-FT # # 0 "arial" 40.0d0 0.0d0 0 0 "555") 12: (CL-GD:DRAW-FREETYPE-STRING 0 0 "555" :ANTI-ALIASED T :POINT-SIZE 40 :ANGLE 0 :CONVERT-CHARS T :LINE-SPACING NIL :FONT-NAME "arial" :DO-NOT-DRAW T :COLOR 0 :IMAGE NIL) -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Sat Mar 24 10:51:21 2007 From: edi at agharta.de (Edi Weitz) Date: Sat, 24 Mar 2007 11:51:21 +0100 Subject: [cl-gd-devel] Error with draw-feetype-string In-Reply-To: (Andrei Stebakov's message of "Fri, 23 Mar 2007 22:26:41 -0500") References: Message-ID: On Fri, 23 Mar 2007 22:26:41 -0500, "Andrei Stebakov" wrote: > I am not sure if it's hunchentoot or gd because when I specify > "arial" for the functon, it works. When the same string comes from > (session-value 'text) I got following error: > > Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: > "arial" is not of type (OR SIMPLE-BASE-STRING > NULL > (ALIEN:ALIEN (* (ALIEN:SIGNED 8)))) Hmm, seems like a problem with the FFI of your Lisp. Try TYPE-OF to see what kind of object (SESSION-VALUE 'TEXT) actually is. From lispercat at gmail.com Sat Mar 24 12:55:00 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sat, 24 Mar 2007 08:55:00 -0400 Subject: [cl-gd-devel] Error with draw-feetype-string In-Reply-To: References: Message-ID: Looks like the value from (session-value) is BASE-STRING, and what the draw-freetype-string is looking for SIMPLE-BASE-STRING. Actually I setf the session value from the html form combo-box values. I wonder what can I do to make it right? Get latest FFI? Thank you, Andrew On 3/24/07, Edi Weitz wrote: > > On Fri, 23 Mar 2007 22:26:41 -0500, "Andrei Stebakov" > wrote: > > > I am not sure if it's hunchentoot or gd because when I specify > > "arial" for the functon, it works. When the same string comes from > > (session-value 'text) I got following error: > > > > Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: > > "arial" is not of type (OR SIMPLE-BASE-STRING > > NULL > > (ALIEN:ALIEN (* (ALIEN:SIGNED 8)))) > > Hmm, seems like a problem with the FFI of your Lisp. Try TYPE-OF to > see what kind of object (SESSION-VALUE 'TEXT) actually is. > _______________________________________________ > 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 lispercat at gmail.com Sat Mar 24 13:00:12 2007 From: lispercat at gmail.com (Andrei Stebakov) Date: Sat, 24 Mar 2007 09:00:12 -0400 Subject: [cl-gd-devel] Error with draw-feetype-string In-Reply-To: References: Message-ID: Now I did (coerce (session-value 'font) 'simple-base-string) seems to work. Thank you, Andrew On 3/24/07, Andrei Stebakov wrote: > > Looks like the value from (session-value) is BASE-STRING, and what the > draw-freetype-string is looking for SIMPLE-BASE-STRING. Actually I setf the > session value from the html form combo-box values. I wonder what can I do to > make it right? Get latest FFI? > > Thank you, > Andrew > > On 3/24/07, Edi Weitz wrote: > > > > On Fri, 23 Mar 2007 22:26:41 -0500, "Andrei Stebakov" < > > lispercat at gmail.com> wrote: > > > > > I am not sure if it's hunchentoot or gd because when I specify > > > "arial" for the functon, it works. When the same string comes from > > > (session-value 'text) I got following error: > > > > > > Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER: > > > "arial" is not of type (OR SIMPLE-BASE-STRING > > > NULL > > > (ALIEN:ALIEN (* (ALIEN:SIGNED 8)))) > > > > Hmm, seems like a problem with the FFI of your Lisp. Try TYPE-OF to > > see what kind of object (SESSION-VALUE 'TEXT) actually is. > > _______________________________________________ > > 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 edi at agharta.de Sat Mar 24 15:17:10 2007 From: edi at agharta.de (Edi Weitz) Date: Sat, 24 Mar 2007 16:17:10 +0100 Subject: [cl-gd-devel] Error with draw-feetype-string In-Reply-To: (Andrei Stebakov's message of "Sat, 24 Mar 2007 08:55:00 -0400") References: Message-ID: On Sat, 24 Mar 2007 08:55:00 -0400, "Andrei Stebakov" wrote: > Looks like the value from (session-value) is BASE-STRING, and what > the draw-freetype-string is looking for SIMPLE-BASE-STRING. Actually > I setf the session value from the html form combo-box values. I > wonder what can I do to make it right? Get latest FFI? You mean UFFI? I think this is not a problem of UFFI but rather a limitation of SBCL: CL-USER> (sb-alien:define-alien-routine "strlen" sb-alien:int (str (sb-alien:c-string :external-format :latin-1))) STRLEN CL-USER> (defun make-foo (&key (simplep t)) (let ((array (make-array 3 :element-type 'character :initial-contents '(#\f #\o #\o) :fill-pointer (not simplep)))) array)) MAKE-FOO CL-USER> (typep (make-foo) 'simple-string) T CL-USER> (typep (make-foo :simplep nil) 'simple-string) NIL CL-USER> (strlen (make-foo)) 3 CL-USER> (strlen (make-foo :simplep nil)) ;; you'll get the same error here You might want to ask on the SBCL mailing list if this is expected behaviour if you want to pursue this further. HTH, Edi. From jc at itsec.co.kr Thu Mar 29 22:14:38 2007 From: jc at itsec.co.kr (Jong-won Choi) Date: Fri, 30 Mar 2007 07:14:38 +0900 Subject: [cl-gd-devel] iconv and cl-gd Message-ID: <460C3A4E.2060906@itsec.co.kr> Dear cl-gd developers I know what iconv does quite well. I tried 'grep iconv ...' to figure out how it is used in cl-gd, and found nothing. Is link option -liconv really necessary? I built the cl-gd-glue shared library without the option and didn't have a problem so far(my client want to avoid GPL and LGPL softwares if it is possible) Thanks Jong-won Choi From jc at itsec.co.kr Thu Mar 29 22:15:02 2007 From: jc at itsec.co.kr (Jong-won Choi) Date: Fri, 30 Mar 2007 07:15:02 +0900 Subject: [cl-gd-devel] :convert-chars of draw-freetype-string Message-ID: <460C3A66.6080702@itsec.co.kr> I don't know much about gd and cl-gd and currently I don't understand what :convert-chars does so I'm trying to understand it. When I tried utf-8 Korean string with test-020, it did not render characters correctly. But if I set ':convert-chars nil' all the characters rendered correctly. I guess maybe gd itself handles non-ascii characters correctly(if this is true, maybe the :convert-chars can be removed from the function) Please use Korean string "????" (utf-8 encoded) for "Common Lisp", install ttf-unfonts package(Ubuntu and Debian), and use "/usr/share/fonts/truetype/unfonts/UnBatang.ttf" to exercise it with test-020. Thanks Jong-won Choi From jc at itsec.co.kr Thu Mar 29 22:15:09 2007 From: jc at itsec.co.kr (Jong-won Choi) Date: Fri, 30 Mar 2007 07:15:09 +0900 Subject: [cl-gd-devel] :do-not-draw of draw-freetype-string Message-ID: <460C3A6D.4030301@itsec.co.kr> When draw-freetype-string is called with ':do-not-draw t', I get: ------------------------------------- Condition: 0.05521739130434778 cannot be converted to foreign type (:SIGNED-INTEGER-TYPE 32). Call to CL-GD::GD-IMAGE-STRING-FT (offset 521) CL-GD::IM : # CL-GD::BRECT : # CL-GD::FG : 0 CL-GD::FONTNAME : "/opt/Korean/fonts/UnBatangBold.ttf" CL-GD::PTSIZE : 10.0 CL-GD::ANGLE : 1.5707963267948966 CL-GD::X : 0.05521739130434778 CL-GD::Y : 0.058695652173913 STRING : "Number of Outcome" ------------------------------------- I think there was no transformer for x and y coordinates, and finally gd-image-string-ft was called with the exactly same x and y arguments of draw-freetype-string. I do not have this problem with old cl-gd (0.4.8). Here is a diff output between 0.4.8 and 0.5.3(draw-freetype-string only): ------------------------------------- *************** *** 132,139 **** rendering during bounding rectangle calculation." (check-type string string) (check-type font-name (or pathname string)) ! (check-type color integer) ! (check-type image image) (with-transformed-alternative ((x x-transformer) (y y-transformer) --- 133,144 ---- rendering during bounding rectangle calculation." (check-type string string) (check-type font-name (or pathname string)) ! (cond (do-not-draw ! (setq color 0 ! image *null-image*)) ! (t ! (check-type color integer) ! (check-type image image))) (with-transformed-alternative ((x x-transformer) (y y-transformer) *************** *** 159,167 **** 'gd-ft-string-extra 'line-spacing) (coerce line-spacing 'double-float)) ! (gd-image-string-ft-ex (if do-not-draw ! *null-image* ! (img image)) c-bounding-rectangle (if anti-aliased color (- color)) c-font-name --- 164,170 ---- 'gd-ft-string-extra 'line-spacing) (coerce line-spacing 'double-float)) ! (gd-image-string-ft-ex (img image) c-bounding-rectangle (if anti-aliased color (- color)) c-font-name *************** *** 171,179 **** c-string strex))) (t ! (gd-image-string-ft (img (if do-not-draw ! *null-image* ! image)) c-bounding-rectangle (if anti-aliased color (- color)) c-font-name --- 174,180 ---- c-string strex))) (t ! (gd-image-string-ft (img image) c-bounding-rectangle (if anti-aliased color (- color)) c-font-name From edi at agharta.de Fri Mar 30 07:08:52 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 30 Mar 2007 09:08:52 +0200 Subject: [cl-gd-devel] iconv and cl-gd In-Reply-To: <460C3A4E.2060906@itsec.co.kr> (Jong-won Choi's message of "Fri, 30 Mar 2007 07:14:38 +0900") References: <460C3A4E.2060906@itsec.co.kr> Message-ID: On Fri, 30 Mar 2007 07:14:38 +0900, Jong-won Choi wrote: > Is link option -liconv really necessary? Did you read the note in the installation instructions? From edi at agharta.de Fri Mar 30 07:28:47 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 30 Mar 2007 09:28:47 +0200 Subject: [cl-gd-devel] :convert-chars of draw-freetype-string In-Reply-To: <460C3A66.6080702@itsec.co.kr> (Jong-won Choi's message of "Fri, 30 Mar 2007 07:15:02 +0900") References: <460C3A66.6080702@itsec.co.kr> Message-ID: On Fri, 30 Mar 2007 07:15:02 +0900, Jong-won Choi wrote: > I don't know much about gd and cl-gd and currently I don't > understand what :convert-chars does so I'm trying to understand it. > > When I tried utf-8 Korean string with test-020, it did not render > characters correctly. But if I set ':convert-chars nil' all the > characters rendered correctly. > > I guess maybe gd itself handles non-ascii characters correctly(if > this is true, maybe the :convert-chars can be removed from the > function) > > Please use Korean string "????" (utf-8 encoded) for "Common > Lisp", install ttf-unfonts package(Ubuntu and Debian), and use > "/usr/share/fonts/truetype/unfonts/UnBatang.ttf" to exercise it with > test-020. That's the result I get: http://miles.agharta.de/strings.png Is that wrong? Are you sure you're using the latest version of CL-GD? From edi at agharta.de Fri Mar 30 07:39:36 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 30 Mar 2007 09:39:36 +0200 Subject: [cl-gd-devel] :do-not-draw of draw-freetype-string In-Reply-To: <460C3A6D.4030301@itsec.co.kr> (Jong-won Choi's message of "Fri, 30 Mar 2007 07:15:09 +0900") References: <460C3A6D.4030301@itsec.co.kr> Message-ID: On Fri, 30 Mar 2007 07:15:09 +0900, Jong-won Choi wrote: > When draw-freetype-string is called with ':do-not-draw t', I get: > > ------------------------------------- > Condition: 0.05521739130434778 cannot be converted to foreign type > (:SIGNED-INTEGER-TYPE 32). > > Call to CL-GD::GD-IMAGE-STRING-FT (offset 521) > CL-GD::IM : # #x00000000> > CL-GD::BRECT : # > CL-GD::FG : 0 > CL-GD::FONTNAME : "/opt/Korean/fonts/UnBatangBold.ttf" > CL-GD::PTSIZE : 10.0 > CL-GD::ANGLE : 1.5707963267948966 > CL-GD::X : 0.05521739130434778 > CL-GD::Y : 0.058695652173913 > STRING : "Number of Outcome" > ------------------------------------- Could you please send a self-contained example that I can use to reproduce your problem? Also, it's generally a good idea to tell us which Lisp you are using, which OS you are on, and so on. > I think there was no transformer for x and y coordinates, and > finally gd-image-string-ft was called with the exactly same x and y > arguments of draw-freetype-string. > > I do not have this problem with old cl-gd (0.4.8). Here is a diff > output between 0.4.8 and 0.5.3(draw-freetype-string only): I don't see anything in the diff that would affect transformations. Cheers, Edi. From jc at itsec.co.kr Fri Mar 30 07:58:02 2007 From: jc at itsec.co.kr (Jong-won Choi) Date: Fri, 30 Mar 2007 16:58:02 +0900 Subject: [cl-gd-devel] iconv and cl-gd In-Reply-To: References: <460C3A4E.2060906@itsec.co.kr> Message-ID: <460CC30A.4000303@itsec.co.kr> Edi Weitz wrote: >> Is link option -liconv really necessary? >> > > Did you read the note in the installation instructions? Uh, I'm sorry I missed that. From jc at itsec.co.kr Fri Mar 30 08:49:08 2007 From: jc at itsec.co.kr (Jong-won Choi) Date: Fri, 30 Mar 2007 17:49:08 +0900 Subject: [cl-gd-devel] :convert-chars of draw-freetype-string In-Reply-To: References: <460C3A66.6080702@itsec.co.kr> Message-ID: <460CCF04.4060900@itsec.co.kr> Edi Weitz wrote: > http://miles.agharta.de/strings.png > > Is that wrong? Are you sure you're using the latest version of CL-GD? > No, you got correct result. Yes I downloaded latest cl-gd couple of days ago. Are you sure you got the png image without ':convert-chars nil'? I'm using Ubuntu LTS with Korean locale. With ':convert-chars t', the default, I got incorrect result and with ':convert-chars nil' I got correct result. From jc at itsec.co.kr Fri Mar 30 09:04:46 2007 From: jc at itsec.co.kr (Jong-won Choi) Date: Fri, 30 Mar 2007 18:04:46 +0900 Subject: [cl-gd-devel] :do-not-draw of draw-freetype-string In-Reply-To: References: <460C3A6D.4030301@itsec.co.kr> Message-ID: <460CD2AE.1030409@itsec.co.kr> Edi Weitz wrote: > Could you please send a self-contained example that I can use to > reproduce your problem? Also, it's generally a good idea to tell us > which Lisp you are using, which OS you are on, and so on. > I thought they are unrelated on this specific problem (maybe I'm wrong). I'm using LW4.4.5 and Ubuntu LTS > >> I think there was no transformer for x and y coordinates, and >> finally gd-image-string-ft was called with the exactly same x and y >> arguments of draw-freetype-string. >> >> I do not have this problem with old cl-gd (0.4.8). Here is a diff >> output between 0.4.8 and 0.5.3(draw-freetype-string only): >> > > I don't see anything in the diff that would affect transformations. > I don't know much about cl-gd details. But with 0.4.8 code, _image_ in with-transformed-alternative(code below) is not *null-image* yet. I think that's the main difference between 0.4.8 and 0.5.3. I'm guessing, for 0.5.3 code (find image *transformers* ...) returns nil with *null-image*, in contrast to 0.4.8 code returns a correct(?) transformer. For this one I can't send you a simple example - because the existing code is very hairy. ------------------------------------ (defmacro with-transformed-alternative ((&rest transformations) &body body) "Internal macro used to make functions transformation-aware. TRANSFORMATION is a list of (EXPR TRANSFORMATION) pairs where each EXPR will be replaced by the transformation denoted by TRANSFORMATION." (with-unique-names (transformer) (let ((transformations-alist (loop for (expr transformation) in transformations collect `(,expr . (funcall (,transformation ,transformer) ,expr))))) ;; note that we always use the name 'IMAGE' - no problem because ;; this is a private macro `(let ((,transformer (find image *transformers* :key #'image))) (cond (,transformer ,(sublis transformations-alist `(progn , at body) :test #'equal)) (t (progn , at body))))))) From edi at agharta.de Fri Mar 30 13:10:05 2007 From: edi at agharta.de (Edi Weitz) Date: Fri, 30 Mar 2007 15:10:05 +0200 Subject: [cl-gd-devel] :convert-chars of draw-freetype-string In-Reply-To: <460CCF04.4060900@itsec.co.kr> (Jong-won Choi's message of "Fri, 30 Mar 2007 17:49:08 +0900") References: <460C3A66.6080702@itsec.co.kr> <460CCF04.4060900@itsec.co.kr> Message-ID: On Fri, 30 Mar 2007 17:49:08 +0900, Jong-won Choi wrote: > Are you sure you got the png image without ':convert-chars nil'? Yes. > I'm using Ubuntu LTS with Korean locale. With ':convert-chars t', > the default, I got incorrect result and with ':convert-chars nil' I > got correct result. I now remember that we had something similar on the mailing list a few weeks ago - check the archive. It might be due to different versions of libgd. Or your locale is the culprit. You could try with (map 'string #'code-char '(52964 47676 47532 49845)) instead of a literal string just to be sure. That's what I did. From edi at agharta.de Sat Mar 31 10:51:04 2007 From: edi at agharta.de (Edi Weitz) Date: Sat, 31 Mar 2007 12:51:04 +0200 Subject: [cl-gd-devel] :do-not-draw of draw-freetype-string In-Reply-To: <460CD2AE.1030409@itsec.co.kr> (Jong-won Choi's message of "Fri, 30 Mar 2007 18:04:46 +0900") References: <460C3A6D.4030301@itsec.co.kr> <460CD2AE.1030409@itsec.co.kr> Message-ID: On Fri, 30 Mar 2007 18:04:46 +0900, Jong-won Choi wrote: > I don't know much about cl-gd details. But with 0.4.8 code, _image_ > in with-transformed-alternative(code below) is not *null-image* > yet. I think that's the main difference between 0.4.8 and 0.5.3. I'm > guessing, for 0.5.3 code (find image *transformers* ...) returns nil > with *null-image*, in contrast to 0.4.8 code returns a correct(?) > transformer. Yes, it looks like you're right and my recent update broke things. I'm on my way to Cambridge for the ILC now, though, so I probably won't be able to fix this before the end of next week. Thanks for the report, Edi.