GUI server draw-image JPEG load problem...

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE

GUI server draw-image JPEG load problem...

Postby oofoe » Mon Oct 12, 2015 9:08 pm

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!
Testing can show the presence of bugs, but not their absence.
oofoe
 
Posts: 60
Joined: Wed Sep 28, 2005 7:13 pm

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

Postby oofoe » Wed Oct 14, 2015 7:18 am

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.
Testing can show the presence of bugs, but not their absence.
oofoe
 
Posts: 60
Joined: Wed Sep 28, 2005 7:13 pm


Return to newLISP Graphics & Sound

Who is online

Users browsing this forum: No registered users and 1 guest