GUI server draw-image JPEG load problem...

Started by oofoe, October 12, 2015, 02:08:15 PM

Previous topic - Next topic

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:


 (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!
Testing can show the presence of bugs, but not their absence.

oofoe

#1
OK, after some head scratching, I figured I must be experiencing some sort of redraw problem.



I changed the code to this:



 (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.
Testing can show the presence of bugs, but not their absence.