ANN: image viewer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

a while ago Mark persuaded me to re-release my simple image viewer 
application as open source, especially as several parts of it already 
accompanied my Swing-related bug reports...

I finally found the time to clean-up the sources a bit, and I also added
thumbnails support. This is not a Gimp, not even a Picasa, but I still 
like it to view my images because the mouse-dragging lets me scroll 
quickly to areas of interest in the magnified images:

http://tams-www.informatik.uni-hamburg.de/personal/hendrich/niffler

The application expects the image directory name as its first argument;
without explicit parameter (e.g. when using webstart) the viewer will
search your home directory for images. Depending on the number of files 
lying around there, this can take some time... If necessary, just use 
the popup-menu and select another image directory.

jamvm -Xmx256m -jar niffler.jar /home/hendrich/images/

I only tested with classpath-0.20 under jamvm (and different JDKs).
It kind of works, but scrolling is still a little too slow for a good
user experience. Thumbnails support is very experimental, so please
report bugs.

If anyone has time to test this with a faster VM (like cacao or gcj),
please let me know the results. If anyone wants to add this to the 
'free Swing apps' page, please do...

- Norman

BTW: any news about the big Java2D rewrite?




---

Additional technical info for Swing fans and developers:

As usual, the program GUI has the directory-tree (explorer) on the left,
thumbnails on the top, and the image in the center (rather, bottom-right).
Using two custom components (ImageCanvas and ThumbnailsPanel) and a JTree
embedded in three JScrollPane's in two nested JSplitPane's, and a rather
large nested JPopupMenu, the program tortures the free Swing pretty badly... 
it basically works, but there are still repainting bugs all over the place.

Performance-wise, loading and displaying most JPEGs works fine when using
the (default) loadImageViaAWT method. Image drawing seems a bit slow, but
still acceptable on the main image canvas. Scrolling is too slow to be fun.
Expanding/collapsing subdirectories in the JTree often fails to notify 
the JScrollPane, so that the scrolling for the tree is broken.

Note 1: my first version of ThumbnailsPanel would request an image drawing
operation for every thumbnail without Graphics.clipRect test. This version
ran 15000 times slower on classpath-0.20/jamvm than on JDK 1.5.0 on a 
directory with 800 thumbnails, probably because the JDK drawImage()
method internally checks the clipRect and returns quickly if outside.
The current version of ThumbnailsPanel.paintComponent() includes its own
clipRect test, which has little effect on the JDK, but makes classpath 
useable.

Note 2: thumbnail creation is pretty slow, because the source images
is first loaded, rescaled, and then written. Unfortunately, ImageIO
is unable to access the EXIF previews embedded in most JPEGs and TIFFs.

Note 3: once the app is running, try switching to javax.imageio instead
of the AWT image loading:  popup-menu -> options -> load images via ImageIO.
I predict you won't like the resulting performance...



[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux