Detecting CYMK jpeg images

Ben Rubinstein benr_mc at
Fri Feb 6 07:18:00 EST 2009

Does anyone have a method in Transcript to detect the colour space of a jpeg 

As you doubtless know, Rev can't open a CMYK JPEG; however the error it throws 
if you try to open one (eg by setting the filename of an image object to the 
URL of a jpeg file that happens to be CMYK) is simply "could not open image", 
which is the same as it gives if the URL doesn't exist, requires 
authentification, is in an unsupported format, etc.

I can improve my reporting somewhat by retrieving the data of a URL directly 
after receiving a "could not open image"; then I can detect a 404 or 401, for 
example.  But if I actually have data, and it appears to be in JFIF format, 
then I'd like to be able to establish the colour space.

I know somebody (sorry, forget who - or perhaps more than one person?) has 
done work to read IPTC and EXIF data out of JPEG files; did that work also run 
across the colour space?

Any suggestions (whatever I does has to be in pure Transcript, not using 
externals or external apps) gratefull received.



More information about the Use-livecode mailing list