C# .NET - Progressive JPEG

Asked By s w on 16-Mar-06 05:57 PM
I need to distinguish regular jpeg images from progressive images in my c# code. They both have the same file extension. Does anyone know how to do it? Maybe that information is encoded in the first few byte of image file. Please help 
SW

Jpeg images have an encoderParameter block

Asked By Peter Bromberg on 16-Mar-06 08:41 PM
which can have the following enum values:
enum EncoderValue
{
   EncoderValueColorTypeCMYK,             // 0
   EncoderValueColorTypeYCCK,             // 1
   EncoderValueCompressionLZW,            // 2
   EncoderValueCompressionCCITT3,         // 3
   EncoderValueCompressionCCITT4,         // 4
   EncoderValueCompressionRle,            // 5
   EncoderValueCompressionNone,           // 6
   EncoderValueScanMethodInterlaced,      // 7
   EncoderValueScanMethodNonInterlaced,   // 8
   EncoderValueVersionGif87,              // 9
   EncoderValueVersionGif89,              // 10
   EncoderValueRenderProgressive,         // 11
   EncoderValueRenderNonProgressive,      // 12
   EncoderValueTransformRotate90,         // 13
   EncoderValueTransformRotate180,        // 14
   EncoderValueTransformRotate270,        // 15
   EncoderValueTransformFlipHorizontal,   // 16
   EncoderValueTransformFlipVertical,     // 17
   EncoderValueMultiFrame,                // 18
   EncoderValueLastFrame,                 // 19
   EncoderValueFlush,                     // 20
   EncoderValueFrameDimensionTime,        // 21
   EncoderValueFrameDimensionResolution,  // 22
   EncoderValueFrameDimensionPage         // 23
};
You can read this block and determine  whether the  EncoderValueRenderProgressive or EncoderValueRenderNonProgressive value is present. 
Check MSDN on the above keywords to find sample code.

Progressive JPEG

Asked By s w on 22-Mar-06 04:41 PM
Hi Peter,
I'm affraid it will not work (At least I don't know how to do it). Encoder parameters are only use for specifying compression while saving an image file. I don't think that I can use it for reading parameters which were used for compressing a file.
For reading that kind of info we need decoder, but there is no decoder class in c#.
Am I right?
Sylvester