FS#2646 - Modified JPEG viewer allowing file scrolling.

Attached to Project: Rockbox
Opened by Alexander Spyridakis (xaviergr) - Monday, 22 August 2005, 15:42 GMT
Last edited by Alexander Spyridakis (xaviergr) - Sunday, 19 February 2006, 04:41 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


(This patch was made for iriver models, though it may
work on archos too, it has not been tested with an
Archos model.)

This is a patch for a modified version of the JPEG
viewer that allows file scrolling without the need to
quit first(then select new file).

To change files press Joystick-up (previous file) or
Joystick-down (next file) when the picture is in its
default state.
If you are in zoom mode then press Play (next file) or
Record (previous file).

Note that Play and Record change files whether you are
zoomed or not. Also if you are going to view a picture
that is larger than 1024 (y axis) the picture will be
zoomed by default (so change files with play\record)

Missing feature is still the alphabetical proccess of
   jpeg.diff (16.9 KiB)
This task depends upon

Closed by  Alexander Spyridakis (xaviergr)
Sunday, 19 February 2006, 04:41 GMT
Reason for closing:  Accepted
Additional comments about closing:  Logged In: YES

Finally It got commited!! :)
Patch closed.
Comment by Anonymous Submitter - Tuesday, 23 August 2005, 13:55 GMT

i tested the patch it seem to work,
even the alphabetical sorting seems working..

mfg Domonoky
Comment by Alexander Spyridakis (xaviergr) - Wednesday, 24 August 2005, 00:16 GMT

Yes truth is that alphabetical sorting works in the end.

I updated the patch to be more stable and optimized.
Also I included some checks if the user tries to open
folder with more than 2000 files. (500 for Archos)

Only thing is left is to define the play/record keys for the
Comment by Jonas Häggqvist (rasher) - Thursday, 22 September 2005, 12:00 GMT

Is there any reason why you're not skipping directories?

When reading the directory contents, do something like if
(entry->attribute & ATTR_DIRECTORY) to check if the current
item is a directory.
Comment by Anonymous Submitter - Thursday, 22 September 2005, 19:23 GMT

Bacon Boy:
Yes you are right, I have solved this bug, I just forgot to
update my patch which solves this issue.

I will also ask the devs about the commitment of the patch,
(with or with out the playback patch).
Comment by Alexander Spyridakis (xaviergr) - Thursday, 22 September 2005, 21:02 GMT

Ok here is on of the last updates for this patch.

The code now accepts ".jpeg" extensions (just in case) and
excludes folders from loading.

Maybe the keymappings need better adjustments for the Archos
but I will leave that for the devs.

Any plans for commitment?
Comment by Alexander Spyridakis (xaviergr) - Tuesday, 04 October 2005, 19:08 GMT

*Final Update: Button handling fixed for all archos targets.

P.S: Except if someone changes code in cvs before commitment
Comment by Alexander Spyridakis (xaviergr) - Monday, 12 December 2005, 19:33 GMT

Major Update:
This update implements file scrolling with a whole different
approach. In addition I added viewing of files while audio
playback, on iriver targets. (Thanks to Sebastian Henriksen
for main idea)

The plugin will force to fetch data from the plugin buffer
unless it runs out of memory, where it will ask the user to
choose from various actions. To have limitless capabilities
it follows another way of events.

First the folder is scanned for all jpeg files, and passes
the data to memory. Then it sorts the data and afterwards it
will write the whole (sorted) list to a physical filename.
This way it will discard the big buffer and save a lot of
space for the jpeg buffer.

In my tests it handled very well for up to 1074 files with
74 characters each. (note that only filename matters, not
the path)

(Fixed a bug where stkov error could occur)
Comment by Alexander Spyridakis (xaviergr) - Monday, 12 December 2005, 19:38 GMT

P.S: My tests were done with 1074 files in theory this
number can climb up to 10000 (rockbox limit). Though I
haven't done any tests with so many files. (Even rockbox has
a hard time to show all these files in the filetree.)
Comment by Alexander Spyridakis (xaviergr) - Friday, 16 December 2005, 11:27 GMT

Major Update: Ok this is another major update.

Third and (probably) final approach for the file scrolling

Now rockbox dir buffer is used to get all the files in
current folder. Only 1 array buffer and no more file listing
and tricky memory management.
I had to add tree.h in plugin.c and plugin.h because I use
the tree_get_context() to get the address where filenames
are stored in dir buffer. Up to 10000 files (rockbox limit)
without major delays.

I hope this is the final version. :)
Comment by Alexander Spyridakis (xaviergr) - Thursday, 02 February 2006, 20:47 GMT

Updated with current CVS
Comment by Alexander Spyridakis (xaviergr) - Tuesday, 07 February 2006, 15:43 GMT

Updated again to compile with current CVS.
Comment by Alexander Spyridakis (xaviergr) - Wednesday, 08 February 2006, 03:01 GMT

Updated again to compile with latest changes and fixed a
serious bug. (though hard to reproduce, (file handler))
Comment by Alexander Spyridakis (xaviergr) - Sunday, 12 February 2006, 03:13 GMT

Updated iPod keymap.
Comment by Nicolas Pennequin (nicolas_p) - Friday, 17 February 2006, 19:32 GMT

i synched this patch with the latest CVS (17.02.06), which
includes color JPEG decoding. get it here :
Comment by Alexander Spyridakis (xaviergr) - Sunday, 19 February 2006, 04:41 GMT

Finally It got commited!! :)
Patch closed.