I'm creating a small image upload validator for this printing company, they need to make sure that an uploaded image has a color space of either CMYK or PMS.
This is what I'm using right now:
Image img = Image.FromStream(fupFile.PostedFile.InputStream);
ImageFlags flags = (ImageFlags)Enum.Parse(typeof(ImageFlags), img.Flags.ToString());
I can then check flags, which will contain something like "Partially Scalable | ColorSpaceCmyk | HasRealPixelSize". There's more info on it here: http://msdn.microsoft.com/en-us/library/system.drawing.imaging.imageflags.aspx
Notice that there is no flag for a PMS color space. Is there a way to check that?
Also, some files I upload, they don't have a color space flag at all. Does that mean that the color space can't be recognized?
I'm also wondering if this is a foolproof way to check the color space, or if there is a better strategy?
EDIT:
I've been looking around, and I guess you can get a lot of data from the image's metadata. http://msdn.microsoft.com/en-us/library/xddt0dz7%28v=VS.90%29.aspx
Does anyone know if the metadata contains the image's color space?