Page 1 of 1

GUI server draw-image JPEG load problem...

PostPosted: Mon Oct 12, 2015 9:08 pm
by oofoe
Hi!

I'm doing a simple picture viewer using the GUI server. However, I am having an odd problem where sometimes the image loads and sometimes it doesn't. If I advance to the next image then come back to one that didn't load, it will often load then.

I am using this to clear the previous image, then load and draw a new image into the canvas:

Code: Select all
     (gs:delete-tag 'I)
     (gs:draw-image 'I path  0 0   (psize 1) (psize 0))
     (gs:draw-text 'I path  21 25  '(0 0 0))
     (gs:draw-text 'I path  20 24  '(1 1 0)))


The images are generally about 4Kx2.5K, scaled to 625x521 (for the psize argument).

When the image load fails (?), the text draws following it fail also, so nothing is shown.

Any ideas as to what's going on -- and how I can fix it?

Thanks!

Re: GUI server draw-image JPEG load problem...

PostPosted: Wed Oct 14, 2015 7:18 am
by oofoe
OK, after some head scratching, I figured I must be experiencing some sort of redraw problem.

I changed the code to this:

Code: Select all
     (gs:delete-tag 'I false)
     (gs:draw-image 'I path  0 0   (psize 1) (psize 0))
     (gs:draw-text 'I path  21 25  '(0 0 0))
     (gs:draw-text 'I path  20 24  '(1 1 0))
     (gs:show-tag 'I)


Note the addition of arguments to control redraw at the end of delete-tag call.

And that seems to mitigate the problems. There are still pauses before the new image shows up, but I imagine that's just the loading/decompression/scaling overhead.