Lisp HUG Maillist Archive

(LW-HUG) (gp:analyze-external-image <.jpg>)

Happy Sunday to the List...

There is apparently a difference between .bmp and .jpg files 
internally within CAPI & Friends...

-----------------------------------------------------------------------------------------------------------------
CL-USER 3 > (multiple-value-bind (width height color-table number color-depth)
                            (gp:analyze-external-image
                                   (gp:read-external-image "d:/LS1100 
Runtime/bilder/go-slider-sprite.bmp"))  ; .BMP FILE...
                        (list width height color-table number color-depth))

(50 30 NIL 0 24)


CL-USER 4 > (multiple-value-bind (width height color-table number color-depth)
                           (gp:analyze-external-image
                                      (gp:read-external-image 
"d:/LS1100 Runtime/bilder/go-slider-sprite.jpg"))  ;  .JPG FILE...
                         (list width height color-table number color-depth))

Error: in GRAPHICS-PORTS:ANALYZE-EXTERNAL-IMAGE : External image 
#<GRAPHICS-PORTS:EXTERNAL-IMAGE 200FEBCB> is not plain editable
   1 (abort) Return to level 0.
   2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other options
-------------------------------------------------------------------------------------------------------------------

In the above, the image files are identical other than file format - 
the .bmp was created from the .jpg via Windows PAINT save-as etc.

Any idea what "..is not plain editable" means in this context???

I would much rather use the far-smaller .jpg files in my application 
if for no other reason than for Internet updates and the like.

Do other CAPI guys have trouble with .jpg files??

I have used .jpg files as the source to, e.g., (gp:draw-image pane
                                                                    (gp:load-image 
pane (gp:read-external-image <file.jpg>))
                                                                    0 0)
    without incident.  So, capi:draw-image appears happy with images 
from .jpg sources.

Thoughts?


Regards,

Jack Harper
Secure Outcomes Inc.


Re: (LW-HUG) (gp:analyze-external-image <.jpg>)

Hello Jack,

| There is apparently a difference between .bmp and .jpg files
| internally within CAPI & Friends...
| ...snip...|
| Do other CAPI guys have trouble with .jpg files??
|
| I have used .jpg files as the source to, e.g.,
|   (gp:draw-image pane  (gp:load-image
|      pane (gp:read-external-image <file.jpg>))
|                                    0 0)
| without incident.  So, capi:draw-image appears happy with images
| from .jpg sources.
|
| Thoughts?

If you only need to display the image and extract its width and height, you
can dispose of gp:analyze-external-image at all. CAPI seems quite happy with
JPEG images read by means of

  (gp:read-and-convert-external-image output-pane pathname)

or the like.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: (LW-HUG) (gp:analyze-external-image <.jpg>)

Dmitriy said:



>| There is apparently a difference between .bmp and .jpg files
>| internally within CAPI & Friends...
>| ...snip...|
>| Do other CAPI guys have trouble with .jpg files??
>|
>| I have used .jpg files as the source to, e.g.,
>|   (gp:draw-image pane  (gp:load-image
>|      pane (gp:read-external-image <file.jpg>))
>|                                    0 0)
>| without incident.  So, capi:draw-image appears happy with images
>| from .jpg sources.
>|
>| Thoughts?
>
>If you only need to display the image and extract its width and height, you
>can dispose of gp:analyze-external-image at all. CAPI seems quite happy with
>JPEG images read by means of
>
>   (gp:read-and-convert-external-image output-pane pathname)
>
>or the like.


Thank You Dmitriy - I appreciate the reply.

Regards,

Jack Harper
Secure Outcomes Inc
Evergreen, Colorado USA


Updated at: 2020-12-10 08:40 UTC