473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Detecting Progressive JPEGs in ASP.NET

Hello .NET Gurus!

I have been posting messages all over the .NET forums to no avail, so I
thought I'd give this newsgroup a shot as well.

I am trying to figure out how to detect if a user-uploaded JPG file is in
Progressive or Baseline format. I need to determine this because the display
mechanism I am using (namely, flash) is not capable of displaying
Progressive JPGS. I have succesfully managed to detect the mime-type of the
files, but they always show as image/pjpeg, even when it's not a progressive
jpg file.

The closest I have gotten is that I did discover the RenderProgressive and
RenderNonProgressive members of the EncoderParameters enumeration. However,
these appear to be "write-only", e.g. they can be applied to the Encoder
object as parameters for encoding an existing file... but they can't be used
as a means by which to determine the properties of an existing file.
Furthermore, in the .NET docs on MSDN, these two parameters are documented
as being "Not used in GDI+ 1.0"

Lastly, I want to mention that using PHP it seems to be possible to detect
progressive jpgs by reading the binary code and looking for certain markers
or patterns using the following script.... But this is way over my head as
far as how to convert this code to somthing in VB or C#. So, forgive me for
posting PHP on a microsoft forum ;P ... but this is the only solid lead I
have!

<php code>
$fp = @fopen( $filename, "rb" );
$imageData = fread( $fp, 100000 );
@fclose( $fp );

function checkImage($imageData) {
if ( strstr( $imageData, pack( "n", 0xFFC2 ) ) ) {
return false;
}
if ( strstr( $imageData, pack( "n", 0xFFC6 ) ) ) {
return false;
}
if ( strstr( $imageData, pack( "n", 0xFFCA ) ) ) {
return false;
}
return true;
}
</php code>


Nov 22 '05 #1
0 819

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aaron Davies | last post by:
I'm trying to write some classes for my collaborative whiteboard to transmit images over the network, using the javax.imageio API, but I'm running into an odd problem: my code words fine with PNGs,...
0
by: Dianne Combs | last post by:
Dear Online Reader or Editor ... If you could ... please take a look at our new online treeless edition newspapers, The Northeast Progressive Advocate-Journal and our sister newspaper the San...
5
by: Pecos Bill | last post by:
Hi to everybody, I'd like to know how to extract a progressive number in a select. Example.. Select * from employers Name Surname Position Age Hire Date Progressive...
3
by: Girish | last post by:
Hi All, I have written a component(ATL COM) that wraps Xerces C++ parser. I am firing necessary events for each of the notifications that I have handled for the Content and Error handler. The...
1
by: Chris Jakeman | last post by:
Hi, Internet Explorer doesn't load JPGs progressively. I need to show a large graphic (100KB) on dial-up lines, so I searched for a way to emulate progressive loading of images. Couldn't find...
0
by: Ryan Cooper | last post by:
Hello .NET Gurus! I have been posting messages all over the .NET forums to no avail, so I thought I'd give this newsgroup a shot as well. I am trying to figure out how to detect if a...
1
by: Carlo | last post by:
I have a table with a lot of fields. One is a numeric field. How can I introduce in these field a progressive number. I have to change at times the start number. example:...
0
by: nhacnhac | last post by:
Hi Guys does anyone knows if the a JPEG file saved as JFIF version 1.02 is always considered progressive? I need to create a program in C# to open JPEG files and upload just the non-progressive...
3
by: mukesh | last post by:
I have designed a form in ms access to show the account of firms. In the total column i need a progressive total of one or more column of this form. what to do please thanks in advance
5
by: byteit101 | last post by:
I am working a an Image processing program, and I want to save my jpegs as being progressive (blurry to sharp instead of line by line while it loads). this does not work howerver: ImageCodecInfo...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.