Forum guidelines
AuthorQuestion
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 VB.net 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 system.io 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!!!!
AuthorReply
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.
info
  • 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 asp.net application... it does not seem to appear as a valid method of the image object in the VisualStudio.net IDE. The closest match I could find to your suggestion is the system.imaging.encodervalue enumeration detailed here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingimagingencodervalueclasstopic.asp 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.

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.