Currently getImageType just looks at the file suffix to determine tiff/jp2. We've got files in a respository, which renames datastreams to a format like: "llgc-id_3891196+access+access.0".
We can patch the code, but that's not very sustainable.
Two approaches that getImageType could use:
Or there could be an override param that forces a particular type, regardless of filename?
You seem to have CSS turned off.
Please don't fill out this field.
File magic numbers are I think the way to go here. Maybe there's some code we can hack out of the linux "file" utility to do this? Where did you get these first byte sequences from?
There's a list here: http://www.garykessler.net/library/file_sigs.html
There's also http://www.digitalpreservation.gov/formats/fdd/descriptions.shtml for more detail, and differentiation between JP2, JPX, JPM & various TIFF flavours.
libmagic is the C lib that you use to leverage magic numbers in C/C++, and it should already be on all linux systems.
Sorry, that anonymous post was me, I didn't notice I wasn't logged in.
...and of course, you won't get that anonymous post until somebody moderates it, so I'm apologising in advance...
OK, I'll take a look at this and see how best to integrate this into the server.
OK guys, I've just uploaded new code to github, which implements magic number signature format testing for image files. So, there are no longer any restrictions on how images are named!
Sign up for the SourceForge newsletter: