I am using c++, gdi+,WINDOWS.
How to check whether a jpeg is a RGB or CMYK?
I am using c++, gdi+,WINDOWS. How to check whether a jpeg is a RGB
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you use the IJG libjpeg library, you can open the JPEG file, read the header, and see whether is it grayscale (monochrome), RGB, or CMYK. (Actually, there are several free JPEG libraries, but the IJG libjpeg is probably the most commonly used.) You can find libjpeg sources at:
http://www.ijg.org/files/jpegsrc.v8c.tar.gz
An approximate example of how to read the header would be something like: