Murga-Projects Forums

Full Version: gallery of demos updated
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(I will use this thread to signal updates to the murgalua gallery... if you have contributions to make, please send them along)

I added a photo gallery. This is an adaptation of Mikshaw's icon display examples. I changed the display to an horizontal one and added functions to take care of the resizing of the picture, so that it fits in the bouding box.



Simply add images (jpg and png by default) in a pix directory, in the folder from which the script is started.

Available in the murgalua Gallery
That's very cool.
I have had 2 problems with the photo gallery so far, though:

1) The download link says photo_gallery.lua, but the filename is actually photogallery.lua
2) It seems to choke on large numbers of files. I believe the icon script has the same or similar trouble.

mikshaw Wrote:
1) The download link says photo_gallery.lua, but the filename is actually photogallery.lua


Oups Sad. Thanks for letting me know. Corrected.

mikshaw Wrote:
2) It seems to choke on large numbers of files. I believe the icon script has the same or similar trouble.


Yes, I noticed that as well. When writing the demo, I was using quite big files (kind of royalty free photos you receive on web-designer magazines 1600x1200 pixels) and noted that the application was very slow to open (mac os x).

I haven't tested that any further. I was rather trying to implement a paging system such that only the pictures that are visible at a given time get uploaded.

A note about the drag-and-drop demo...
If you use Fl_Double_Window() for w, rather than Fl_Window(), it will reduce or eliminate the flicker caused while dragging. I think this depends on whether or not your graphical environment supports double buffering (should work for most modern systems).
Nice work on the demos, these really help to get people up to speed.

I found Fl_Double_Window cured the flicker I was getting in the clock demo, also.

I'm wondering, in scripts like photo_gallery.lua what's the best (or any) way to make it incrementally draw?

Ideally, (for the photo_gallery.lua example) the main window and the image directory scroll would show first, then the images would show as they loaded.

Actually (this might be simpler), even just making the main window show first before the images load, would be nice. As it stands, nothing shows until all the images are loaded, which can take a while.

Any ideas how to do that?
I'm not sure exactly what you're looking for, but I'm guessing that the main thing would be not having to wait for the window to display. A quick fix might be to eliminate the thumbnail previews, athough I'm not sure that's acceptible. With no disrespect intended, this script was based on a test which itself was incomplete and in need of serious improvement. So you might consider looking at my image viewer, which stores only one image at a time (or so I assume...maybe ram usage increases with each loaded image, but i haven't checked that yet) and uses a file list instead of thumbnails. It's a work in progress, and it needs to be modified to work in 0.5.5 (I haven't worked on it in a few weeks), but it does not suffer from an initial wait period, and does not lock up when you enter a directory of thousands of images. It might give you some ideas.
http://www.murga-projects.com/forum/show...php?tid=53

mikshaw Wrote:
but it does not suffer from an initial wait period, and does not lock up when you enter a directory of thousands of images. It might give you some ideas.
http://www.murga-projects.com/forum/show...php?tid=53


Thanks, that is a help. And it does have a much faster interaction!

Thinking ... what might it take to make an image viewer like this scale well for huge directories of images...

Maybe what would be nice is some kind of a scrolling widget that can tile things (thumbnails) on the scrolling area, such that each tile/thumb knows whether or not it is currently exposed relative to the position of the scroll.

Then something (a separate thread?) can load things on the scroll (thumbs, in this case) only when needed for display. Which is to say, only when the thumb needs to be drawn does it get loaded/drawn. So as the scroll changes position, thumbs get loaded only when they need to be shown, and unloaded as soon as they are scrolled off the display and can't be seen anyway.

Could also try a pages method where you load x number of images, that fit into a frame of a certain size, and then page through them with buttons.

Programs like iPhoto and Extensis Portfolio create a database of thumbnails on importing images, instant access to tens of thousands of images 'appears' to
happen after that, but in the background there's a gig or so of these
thumbnails in many folders somewhere.
Reference URL's