|
Hi,
I need to distinguish progressive jpeg's from baseline jpeg's.
So far I retrieved all image properties using image.GetPropertyItem, and all properties are the same for these two kinds.
There is also function GetEncoderParameterList, but it can only (at least as far as I know) be used to set encoding properties when you want to save a file.
Do you know maybe how can I use GetEncoderParameterList for my purpose? Or, how can I distinguish these two types of JPEG's by reading and comparing bytes from image file.
Thanks
SW
|
|
|
|
|
Progressive information is held in the JPEG compression header. You need to read in the jpeg file then access the fields by address. There are three single byte address fields (0xC2, 0xC6, 0xCA) that holds progressive information. Generally I think 0xC2 is always set if the jpeg is progressive.
So create a struct that contains the information you want and then read the file into that struct (fread, or the .NET equivlant), and then access the proper field.
Mike
|
|
|
|
|
Mike,
Thank you for fast response. Could you post a sample code how I could access and retrieve that info using byte address fields (or a link to a website with similar code). I'm a kind of new to image processing and example would help me a lot.
Thank you again,
Sylvester
|
|
|
|
|
Hey Sly,
Here is a link to some code samples to give you an idea on what to do. Don't follow exactly because the addressing doesn't line up, the BITMAPINFO struct doesn't break out the progressive address so you would have mask the information you need out of what it does hold.
http://www.experts-exchange.com/Programming/Q_21769844.html[^]
The last post might be a little better info. Also these snippets are written in C so you would have to translate that to C# .NET. Since I haven't done this type of stuff in .NET I can't tell where to head.
-Mike
|
|
|
|
|
Mike,
Unfortunately I don't have subscription on experts-exchange, but at least I know what to look for.
Thanks
Sly
|
|
|
|
|
Sly,
You don't need a subscription (I don't) just scroll down far enough and you will see the whole post, you have to get past all the ads, and don't click on the "View Solution" button.
But just in case I am getting lucky:
Based on the info here:
http://www.fastgraph.com/help/jpeg_header_format.html
You can read in the necessary info, similarly to how I demonstrated with the above code (for bitmap).
Firstly, define a struct to store the JPEG header info in:
struct JPEGINFOHEADER
{
unsigned short id ;
unsigned short width ;
unsigned short height ;
unsigned char number_of_component ;
// etc etc
} ;
/**
* Return value:
* 0 - Successful
* -1 - Could not find/open the specified file
* -2 - Specified file is not a valid bitmap file
*/
int LoadJpegHeader( char *filename, JPEGINFOHEADER *jpegInfoHeader )
{
FILE *filePtr ;
filePtr = fopen( filename, "rb" ) ;
if ( filePtr == NULL )
{
return -1 ;
}
fread( JpegInfoHeader, sizeof(JPEGINFOHEADER), 1, filePtr ) ;
fclose( filePtr ) ;
return 0 ;
}
|
|
|
|
|
Mike,
You are right, when I saw "View solution" I didn't even scroll down the page.
I also found a book which covers that topic very well. The title is:
"Compressed Image File Formats: jpeg, png, gif, xbm, bmp" by John Miano, 1999
It also has a CD with console application (jpegdump) written in c++ extracting all info from jpeg file.
Now, I only need to convert it to c#. Great!!!
Thanks
Sylvester
|
|
|
|
|
I have a web app and I would like to create Outlook contacts and assign them to groups in the Outlook address book. I'm using C# and Visual Studio 2005. Can someone help point me in the right direction? Thanks
paul
|
|
|
|
|
Hi,
in a windows form I am trying to populate a datagrid from an arraylist. instead of getting the text value I am getting the length of each string in the array passed to the grid, in this case the number "5"
ArrayList list = new ArrayList();
list.Add("Test1");
list.Add("Test2");
dataGrid1.DataSource = list;
Any ideas?
thanks
brian
|
|
|
|
|
Hi all,
I developing a windows application which will have login verification and other stuffs.
I want to lock the application when the user is idle (as like in windows ctrl+alt+del lock) for some time(say 1 hour - it should be confiurable parameter).
how can i do that in c#
I found one event in Application.idle but this event trigger once the UI get painted.
Regards,
Srini
|
|
|
|
|
I use a class that implements IMessageFilter that is added as a message filter after the user has logged in (i.e. Application.AddMessageFilter). The filter contains a timer that gets reset everytime a mouse or keyboard message is received. If the timer ticks (i.e. no mouse or keyboard activity for a defined period of time - five minutes in my case) then my application becomes "inactive" (actually all it does is stop counting how much time the user has been using the program).
When a new keyboard or mouse event is received while the app is sleeping it will wake back up and start tracking time again.
|
|
|
|
|
I am developing windows application to add "Outlook Contacts" to database. I need to provide option for choosing contacts folder.
I need sample code (or idea ) for displaying outlook contacts folders and extracting contacts from selected folder
Thanks in advance
Ram
|
|
|
|
|
try entering acovado.com
once there you'll find various information on the subject !!!!!!!!!
(:
|
|
|
|
|
|
We plan on purchasing the IP Works suite that nsoftware provides. We are going to spend around $8000
and just wanted to know if anyone has had any negative experience with them. I cant seem to find any reviews online so I am asking the CP community for help.
|
|
|
|
|
I created a custom control inherited from panel that will contain a collection of another custom control. I added an attribute 'Items' that startes the Collection Editor and adds however many instances of the the controls and add it to a collection class. All works fine, the control gets added to the collection, InitializeComponent gets modified, but for the new control to show up on the form I need to rebuild the parent form, THEN it shows up.
So my question is, does anyone have tips on what I need to do to get the control added to the collection to actually be displayed on the form upon adding it to the collection?
-Mike
(ps removal using the Collection Editor works fine)
|
|
|
|
|
Hi everyone, I've been developing the Sudoku puzzle program. Does anyone know how to implement this function or algorithm:
User can create his/her own puzzle and ask the program to provide answer
Thanks
eric
|
|
|
|
|
|
|
|
Thanks a lot
They are very useful.
eric
|
|
|
|
|
I developed a chat software. But it works only in LAN. Because I am using IP address to talk each other. The problem is the ip address of 1 machine is local to the LAN. I want to communicate to a machine which is residing in another LAN through Internet. How can I ?
Please help me
Cheers
Jijo
|
|
|
|
|
For this problem you have to create one server application. Now your all client send request to server & talk through server. before that client connect with server.
I think this will solve your problem.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Developing a client-server program or peer to peer program on a LAN is only the first step. Once you are fully assured your application(s) is/are working then you can proceed to trying to make it work over the Internet.
Let's look at the requirements:
1. Internet Connection
2. Some way to identify your public IP address (i.e. the one of the Cable or DSL ISP)
3. A Router
Your application will run on your LAN. It has a well known port, lets say it was 5999. Over on the router you will need to configure 5999 under Port Forwarding in order to send public traffic matching that port to the computer on your LAN that is running your application.
Meanwhile your friend or colleague needs to know two things to connect: Public IP and port.
You can also use this basic technology to setup a FTP Server, Web Server or other common applications (including Remote Desktop) that you wish to remotely access.
Ahhh, but lest we not forget the one caveat. If you can see it on the Internet so can people with nefarious purposes. So make sure you have a firewall in place, keep your software behind the DMZ.
Good Luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
My friend your program if it connected successfully to its server so your application is running properly but you can't connect to the actual world wide except when you enable your application ports in the internet connection firewall on windows xp sp1 or sp2 then you are done enjoy your life with your small chat sever application.
Thanks my friend i hope it may help you.
Human knowledge belongs to the world.
|
|
|
|