Forum guidelines
HELP! Detect if a JPG is progressive! REWARD!
Posted By info on 16 Oct 2003
ALL I NEED TO DO IS determine if a JPG file is PROGRESSIVE or BASELINE. I have Scoured the web, read half the MSDN library, posted on numerous .net forums, read every GDI+ article in C# Corner and heaven... and NOWHERE can I find the answer to this question! I have ASP.NET applications that allow users to upload image files, and I need to reject or re-save PROGRESSIVE (multi-pass) jpegs because they can't be loaded or displayed in Flash Player if the are Progressive. AFAIK there is no built-in property in the system.drawing or namespaces to determine this, (although that would be awesome if there were)... so you would possibly have to open the file as a binary stream or something and find the progressive "marker" in the file. I have seen PHP scripts that can do this, so I am fairly sure that a .NET script should be able to as well. PLEASE HELP! I will gladly compensate you with some graphic design, flash development or .net programming if you can provide me with working code to perform this task. I will worship you as a .NET guru if you can do this for me!!!!
Re: HELP! Detect if a JPG is progressive! REWARD!
Posted By andrew on 16 Oct 2003  
You have to use Image.GetEncoderParameterList method. Then you can use one of the enumerations from: EncoderValue RenderNonProgressive and RenderProgressive I have used those for saving, but never tried retrieving the values, which I think GetEncoderParameterList might help.
  • 0
  • 0
Re: HELP! Detect if a JPG is progressive! REWARD!
Posted By info on 17 Oct 2003  
Hi Werdna... Thanks for the tip, it sounds like a good lead! However, I am still not sure how to actually call the GetEncoderParameterList method in an application... it does not seem to appear as a valid method of the image object in the IDE. The closest match I could find to your suggestion is the system.imaging.encodervalue enumeration detailed here: but still, I don't understand how this could be used to retrieve a value from an encoded image- it appears to be only applicable to retrieving encoder value constants which can then be applied to an existing image for subsequent encoding. If there's any way you could show me a basic usage example in the context of an ASP.NET application, enumerating the GetEncoderParameterList as applicable to an existing image file, that would be very much appreciated. I know your time is valuable and I'll gladly return the favor in any way I can.


JetBrains ReSharper Ultimate
.NET code analysis, refactorings, navigation, unit testing, code coverage and profiling in Visual Studio, a bonus for C++ devs, bundled at 50% off.