Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Plugins
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by teru - 2010-12-20
Last edited by teru - 2011-01-22

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

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)

Closed by  teru
2011-01-22 13:47
Reason for closing:  Accepted
Additional comments about closing:  

Committed in r29110.

teru commented on 2010-12-21 13:49

it seems like i attached wrong version of the patch. this is correct one.

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.

teru commented on 2010-12-26 07:41

add both of them to magic_list and files will be loaded fine.

update patch: slightly change error message.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing