title: How to detect if a jpeg contains cmyk color profile?
body: <p>I have some code that scales the images users upload. It works perfectly in most situations, but sometimes they upload jpegs that contain cmyk information. </p>
  
  <p>After googling a bit, it seems like jpegs with cmyk values isn't valid, but since they work in windows, the users assume it's a problem with my application, so I need to be able to handle those situations. The questions:</p>
  
  <p>How do I detect if the jpeg contains cmyk information?(it would allow me to inform the user why it doesn't work).</p>
  
  <p>How can I convert it to a normal jpeg? </p>