Short version: Is there any simple way how to find out if the JPG file is CMYK or RGB in Delphi XE? Preferably without any additional libraries...
Longer version: I have a 3rd party library that accepts JPEG. But for whatever reason the library needs to know whether they are in CMYK or RGB colorspace. And what is worse it renders the CMYK ones with wrong colors (probably something with CMS or so...). Delphi itself (TJPEGImage) displays the CMYK image correctly but it seems that all the "CMYK vs RGB stuff" is hidden in jpeg.pas implementation section and is not published...
I searched a lot of stuff on the Internet but here I found only few years old posts. Also I've found Gabriel Corneanu's modified jpeg.dcu but it is all about making Delphi load the image correctly. And it seems that XE does load the CMYK JPEGs correctly.
In the end I would prefer to convert the CMYK image to RGB and even as it sounds horrible I do not mind doing it by recoding the JPEG (if there is no other better option). Basically load it to bitmap and save the bitmap as JPEG if needed...
P.S. I would like to avoid bringing another libraries to my project as much as possible and I would like to stay within "standard Delphi" as much as possible so if I ever need to move this project to Mac, iOS or Android I do not have to deal with a lot of external stuff...
We've narrowed the solutions to three: