Rockbox

Tasklist

FS#11819 - image viewer: use magick number in file to determine image type.

Attached to Project: Rockbox
Opened by Teruaki Kawashima (teru) - Monday, 20 December 2010, 14:35 GMT
Last edited by Teruaki Kawashima (teru) - Saturday, 22 January 2011, 13:47 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

this implements suggestions discussed in mailing list ( FS#6321  - Universal Image Viewer(http://www.rockbox.org/mail/archive/rockbox-dev-archive-2010-11/0058.shtml))
get_image_type in image_decoder.c is changed as follows.
1. if it has supported image's magick value and has assosiated file extension, returns corresponding IMAGE_*.
file will be loaded.
2. if it has supported image's magick value but *doesn't* have assosiated file extension, it warns that file extension might not be correct and returns corresponding IMAGE_* determined from the magick value.
file will be loaded.
3. if it *doesn't* have supported image's magick value but has supported image file's file extension, returns corresponding IMAGE_* determined from the extension.
file will not be loaded, and error will be displayed. user can know something is wrong.
4. if it *doesn't* have supported image's magick value and *doesn't* have supported image file's file extension, returns IMAGE_UNKNOWN.
image viewer skips to next file silently.

get_pic_list imag in imageviewer.c is changed so that it create list of all file.
(if filtering is done at this point, initial loading would take longer, but not confirmed)
This task depends upon

Closed by  Teruaki Kawashima (teru)
Saturday, 22 January 2011, 13:47 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed in r29110.
Comment by Teruaki Kawashima (teru) - Tuesday, 21 December 2010, 13:49 GMT
it seems like i attached wrong version of the patch. this is correct one.
Comment by Marcin Bukat (MarcinBukat) - Saturday, 25 December 2010, 13:51 GMT
What about situation where the same decoder handles a few variants of the format with different magic values? One example is ppmviewer with magic numbers P2 and P6 both valid.
Comment by Teruaki Kawashima (teru) - Sunday, 26 December 2010, 07:41 GMT
add both of them to magic_list and files will be loaded fine.

update patch: slightly change error message.
Comment by Teruaki Kawashima (teru) - Saturday, 15 January 2011, 11:32 GMT
synced.

Loading...