Release Pandora Image Viewer


The aspect ratio will be preserved, yes. I don't have to do any effort for that either, thanks to notaz' work. I just set the screen resolution to, say, 1200x900, and it will automatically scale it to 640x480 with black pillarboxes.

When you zoom in, I make sure that you see a portion of the image that fills the entire screen, of course with the right aspect ratio.

Another thing:

I'm not sure what I should do with transparent PNGs. The fastest thing to do is to just ignore the alpha channel, but that's of course not correct. I can also blend the image with a background - the typical thing to do here is to show a grey checkerboard "below" the transparency. The easiest thing is to blend with a fixed color (e.g. black). What do you think?
 
I'm not sure what I should do with transparent PNGs. The fastest thing to do is to just ignore the alpha channel, but that's of course not correct. I can also blend the image with a background - the typical thing to do here is to show a grey checkerboard "below" the transparency. The easiest thing is to blend with a fixed color (e.g. black). What do you think?
I suppose you could make a toggle for the fixed colour...  I'd recommend white, as most transparent PNGs I've come across look best on white when viewed in isolation (especially when its black line art) but the best background colour would depend on the image.  Is there any chance you could make it possible to switch between black, white and chequerboard backgrounds?

- Neelix
 
I assume you need two bits to encode the amount of rotation (0, 90, 180, 270 degrees). Maybe you could use the flags to SDL_SetVideoMode? Abuse some existing but currently ignored flags like SDL_RESIZABLE and SDL_NOFRAME to encode the rotation?
I don't think that's a good way as it will have side effects when someone switches to standard SDL for testing or whatever. Maybe I should just use another SDL_OMAP_ env var..
 
I assume you need two bits to encode the amount of rotation (0, 90, 180, 270 degrees). Maybe you could use the flags to SDL_SetVideoMode? Abuse some existing but currently ignored flags like SDL_RESIZABLE and SDL_NOFRAME to encode the rotation?
I don't think that's a good way as it will have side effects when someone switches to standard SDL for testing or whatever. Maybe I should just use another SDL_OMAP_ env var..
Env vars are fine, as long as you re-check them whenever SDL_SetVideoMode is called. I don't want to have to re-initialize SDL each time the user presses the "rotate" button.  Maybe you could just define a new version of SDL_SetVideoMode() with an extra argument for the rotation angle?

Edit: nevermind, you don't want to change the SDL.h include file. What about extra flags? Or are all bits already taken in that argument?
 
Last edited by a moderator:
I'm not sure what I should do with transparent PNGs. The fastest thing to do is to just ignore the alpha channel, but that's of course not correct. I can also blend the image with a background - the typical thing to do here is to show a grey checkerboard "below" the transparency. The easiest thing is to blend with a fixed color (e.g. black). What do you think?
I suppose you could make a toggle for the fixed colour...  I'd recommend white, as most transparent PNGs I've come across look best on white when viewed in isolation (especially when its black line art) but the best background colour would depend on the image.  Is there any chance you could make it possible to switch between black, white and chequerboard backgrounds?

- Neelix
That would certainly be possible. Simple background colors are very easy, checkerboard patterns should be easy too - I just don't know if it's more effort to write that myself, or to find some existing code to draw that pattern. For now I'm just using a black background, because that is also the color of the pillarboxes, so it made most sense to me to make it seem like the entire image is on a black background.

Here are some speed results for PNG files:

Big PNG files (I took two of those 10MP JPEG files, saved them as PNG, and on one of them I erased some parts and made some parts a bit transparent, just to check that); the test is to show those 2 big PNG files:

- ristretto: 7.2 seconds (3.6s per image)

- viewnior: 4.4 seconds (2.2s per image)

- my viewer: 3.6 seconds (1.8s per image)

The main bottleneck seems to be in libz; I tried to use a faster version of libz but it looks like the default one in our firmware is already pretty fast (I guess it is already NEON-optimized).

Small PNG files: I took 10 images of 800x480 each.

- ristretto: 2.13 seconds (0.21 second per image)

- viewnior: 1.53 seconds (0.15 second per image)

- my viewer: 0.77 seconds (0.08 second per image)

So that's looking pretty good. I assume most people will tend to have big JPEG files and not so big PNG files anyway, so speed is less of an issue for PNG files.
 
Last edited by a moderator:
I tried loading a directory containing pictures which resulted in it crashing before it could show one of them. Here's the .out that should help figure out what went wrong:

=======================================================================================

PND             : /media/PANDORA-SD1/pandora/apps/piv.wb.pnd
PND_FSTYPE      : Squashfs
APPDATADIR      : /media/PANDORA-SD1/pandora/appdata/piv
APPDD_FSTYPE    : vfat
PND_CPUSPEED    : <unset>
EXENAME         : run
ARGUMENTS       : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop1" "/mnt/utmp/piv"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/PANDORA-SD1/pandora/appdata/piv=rw+nolwh":"/mnt/pnd/piv=rr" none "/mnt/utmp/piv"
[sUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( run  ) ----------
vp 1.7 © 2001 Erik Greenwald <erik@smluc.org>, 2013 Jon '_wb_' Sneyers

real    0m0.533s
user    0m0.328s
sys    0m0.195s
cat: /tmp/piv_wb_deletion: No such file or directory
No files marked for deletion
rm: cannot remove `/tmp/piv_wb_deletion': No such file or directory
[ FAILED]--- Starting the application ( run  ) ----------
[ START ]--- Restoring the frame buffer status ----------
[sUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[sUCCESS]--- Waiting the Union to be available ----------
auplink:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/piv': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[sUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[sUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 4
 
Actually there doesn't seem to be any indication of what made it crash.  The time output shows that execution of the binary had already finished by that point.    What you are seeing only shows that the script that actually deletes 'deleted items' didn't find any items so marked.

For now I'm just using a black background, because that is also the color of the pillarboxes, so it made most sense to me to make it seem like the entire image is on a black background.
I do get your reasoning,  but I would point out for example that it would be kind of useless to view this image on a black background:

http://en.wikipedia.org/wiki/File:B747FAMILYv1.0.png

- Neelix
 
Great thing you are working on !! :D

_wb_, have you tried PepViewer ?

It's really fast, but no one has developed it for years... and there's no source :(

I think it has the best interface I ever seen for the pandora, and it uses great all the buttons, maybe you can take a look at it to have some inspiration.

And while you are at it, (all the "minimal things" you start will become full professional application with time :D ) can you make it display all the images inside archives ? Like the comic readers do.
 
looks lik the deletion function made it crash.
It ran the program but no image was shown. Maybe a parameter it was expecting wasn't passed to it.
Just to confirm, but were there any actual image files in the folder you selected? Did you open the folder, or just highlight it before clicking ok?

- Neelix

Edit:  just reread the original message
 
Last edited by a moderator:
looks lik the deletion function made it crash.
It ran the program but no image was shown. Maybe a parameter it was expecting wasn't passed to it.
Just to confirm, but were there any actual image files in the folder you selected? Did you open the folder, or just highlight it before clicking ok?

- Neelix

Edit:  just reread the original message
I tried both ways. Neither of them worked.
 
Last edited by a moderator:
Thanks to an IRC conversation, I discovered the reason for it closing. Its because there are spaces in the filename(s) of the image/directory(ies) containing the images. Also, an image flickers when when I try to zoom in/out and after doing it a few times, PIV crashes.
 
Last edited by a moderator:
The filenames with spaces thing - I'll check it out, I was hoping shell expansion would do the right thing but apparently not.

If there's a specific image that makes PIV misbehave, please send me the image.

Neelix: I'll make a "toggle background" button to toggle between black, grey and white.
 
The filenames with spaces thing - I'll check it out, I was hoping shell expansion would do the right thing but apparently not.
I've made that mistake before... shell expansion gets the full filename but spaces are still treated as unescaped unless the expression is contained in double quotes.
Neelix: I'll make a "toggle background" button to toggle between black, grey and white.
Cheers! :)
 
Thanks to an IRC conversation, I discovered the reason for it closing. Its because there are spaces in the filename(s) of the image/directory(ies) containing the images. Also, an image flickers when when I try to zoom in/out and after doing it a few times, PIV crashes.
so, is it fast or not?
 
Back
Top