"photoprochad" wrote:
The company I work for has a database of around 1,000,000 JPG images. We take RGB images, convert them to CMYK, process and print them. The original files to be kept in the database are supposed to remain RGB. We believe that there was a problem with our archival process which may have filtered a significant number of CMYK formatted images back into our archive.
We need to find the CMYK images and delete them but leave all RGB images intact. Obviously with a million files, this would be a daunting task to open each one to determine its format.
Does anyone know of a software tool that can determine whether images are RGB or CMYK either without opening them or by batch processing and listing results?
I did some -rather trivial- programming around JPEG files recently in order to fix a bug in a commercial application producing jpegs with faulty headers, so I have the JPEG specs still on my desktop. As far as I understand it, JPEG does in itself not rely on a color space, and often encoders convert RGB or CMYK data to a different color space like YCbCr on encoding, because this results in higher compression. Furthermore, there need not be any hint on the colorspace of the encoded data in the output file, but usually there is a color space tag in the file header. Unfortunately, Adobe has been using a proprietary encoding logic when creating JPEGS and a proprietary output format as well, which is not understood by all decoders. Consequently, Adobe CMYK JPEGS differ from others. I just made two CMYK jpegs from an RGB jpeg and found that the file header created by PS CS2 starts with an Adobe EXIF tag whereas the file header created by Corel Photopaint 12 starts with a standard JFIF tag and contains the CMYK colorspace tag easily visible in the hex file. If you always have been using Adobe to create the CMYK files it should be easy for a programmer with a background in graphics programming to write you software within some days which can sort your company's files or tag the filenames - which IMNSHO would be wise, given the trouble you ran into. I'd suggest you go to sci.image.processing and ask whether a student is willing to earn some money on the job.
Peter