Lisp HUG Maillist Archive

Error handling in image-pinboard-object

Hi,

I’ve got a situation where a corrupt image file is being read with gp:read-external-image and fed to a image-pinboard-object. This leads to an error (in convert-external-image) when the pinboard is being displayed. Is there any way to guard against this?

One possibility would be to load the image with read-and-convert-external-image in the first place, to be able to handle any errors there. However that is inconvenient in this case, as the image file is being read from a process which has no access to a graphics-port.

Thanks
Erik


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Error handling in image-pinboard-object

Waited to see if anyone had a better answer, but seeing as they didn't: (untested!) if it were me I would create a pixmap-graphics-port and pass that around. 

- nick

> On 12 Jun 2016, at 23:45, Erik Ronström <erik.ronstrom@doremir.com> wrote:
> 
> 
> Hi,
> 
> I’ve got a situation where a corrupt image file is being read with gp:read-external-image and fed to a image-pinboard-object. This leads to an error (in convert-external-image) when the pinboard is being displayed. Is there any way to guard against this?
> 
> One possibility would be to load the image with read-and-convert-external-image in the first place, to be able to handle any errors there. However that is inconvenient in this case, as the image file is being read from a process which has no access to a graphics-port.
> 
> Thanks
> Erik
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Error handling in image-pinboard-object

Erik Ronström <erik.ronstrom@doremir.com> writes:

> I’ve got a situation where a corrupt image file is being read with
> gp:read-external-image and fed to a image-pinboard-object. This leads
> to an error (in convert-external-image) when the pinboard is being
> displayed. Is there any way to guard against this?

I haven't had this problem (I use image-pinboard-objects in the same
way), but would it help subclassing image-pinboard-object and make a
safeguarding :around method to draw-pinboard-object?
--
  Espen
  

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


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