Hello thar, list!
I have started a lil' work here on some McCLIM based software and I have run into a bit of an issue.
I'm trying to have a pane with a display-function that displays me an image I load from a PNM, and this fails for me.
Basically I have (excuse the indentation. thunderbird mail client etc.)
(defmethod pane-display (frame stream) (draw-design (find-pane-named frame 'foo-pane) (climi::make-rgb-image-design (image::read-image-file "foo.pnm"))))
result is this
There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION CLIM-INTERNALS::IMAGE-WIDTH (1)> when called with arguments (#2A((12693671 12303027 12697025 12960710 13093066 13618384 14210776 14343390 14606308 14738150 ...) (11902865 11706271 12433848 12633281 13683403 13947084 13947345 14080471 14670557 14606822 ...) (11118502 11445149 11973554 12759733 13222341 13487563 13683408 13882839 14606045 14738146 ...) (8945292 11970725 12169393 12365746 13091006 13422029 13882580 14276825 14606041 14540249 ...) (10723750 11710384 11973812 12564921 13355469 13881037 14472140 14342101 14538968 14605792 ...) (11908536 12499904 13486538 13486792 13552588 13947345 14473680 14736857 14473433 14538717 ...) (12828606 13090233 13421257 13420744 13486791 13749708 14209746 14342105 14671069 14868192 ...) (13024958 13420748 13551822 13422023 13749963 13618378 14144469 14734804 14473432 14998751 ...) (12962251 13422543 13618382 13552330 13422538 13421261 13949651 14473688 14538969 14473432 ...) (13488855 12899034 13030102 13293012 13095121 13292756 13488336 13357008 13684694 14079703 ...) ...)). [Condition of type SIMPLE-ERROR]
Backtrace: 0: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) #<unavailable argument> #<unavailable argument> #<STANDARD-GENERIC-FUNCTION CLIM-INTERNALS::IMAGE-WIDTH (1)>)[:EXTERNAL] 1: ((SB-PCL::FAST-METHOD INITIALIZE-INSTANCE :AFTER (CLIM-INTERNALS::DRAW-IMAGE-DESIGN-OUTPUT-RECORD)) ..)[:EXTERNAL] 2: ((LAMBDA (SB-PCL::|.P0.| SB-PCL::|.P1.| SB-PCL::|.P2.| SB-PCL::|.P3.|)) #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument>) 3: ((LABELS #:G5221) #<CLIM-CLX::CLX-MEDIUM {1003B139A1}>) 4: ((SB-PCL::FAST-METHOD CLIM-INTERNALS::MEDIUM-DRAW-IMAGE-DESIGN* :AROUND (OUTPUT-RECORDING-STREAM T T T)) ..) 5: ((SB-PCL::FAST-METHOD CLIM-INTERNALS::DO-GRAPHICS-WITH-OPTIONS-INTERNAL (MEDIUM T T)) ..)[:EXTERNAL] 6: ((SB-PCL::FAST-METHOD CLIM-INTERNALS::DO-GRAPHICS-WITH-OPTIONS (SHEET T)) ..)[:EXTERNAL] 7: ((SB-PCL::FAST-METHOD DRAW-DESIGN (T CLIM-INTERNALS::RGB-IMAGE-DESIGN)) ..)[:EXTERNAL]
I'm unaware if this is actually a bug or I just should stay the hell away from these functions and make the pnm loader behave with MAKE-PATTERN-FROM-BITMAP-FILE.
Hello,
Marcus Eskilsson writes:
I have started a lil' work here on some McCLIM based software and I have run into a bit of an issue.
I'm trying to have a pane with a display-function that displays me an image I load from a PNM, and this fails for me.
Basically I have (excuse the indentation. thunderbird mail client etc.)
(defmethod pane-display (frame stream) (draw-design (find-pane-named frame 'foo-pane) (climi::make-rgb-image-design (image::read-image-file "foo.pnm"))))
This is because there are several, mutually incompatible image extensions in McCLIM. When you do (image::read-image-file ...) the raw data is returned, whereas climi::make-rgb-image design requires an object of type rgb-image which you create by giving it :width, :height, and :data initargs.
Regards,