Fetch jpeg image dimension without load it
I want to know image dimension but I can't use Image.FromFile method to load image file because it is very slow and I want get image dimention quickly.
my image file format is JPEG
i will thank every one help me
(excuse me i can't speak english correctly)
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jan MontanoRank #1,295 · 1.3K reputationPosted Jul 3, 2007, 5:58 PM EDT
One option is having a look for "JPEG Library". I once used it in picture comparisons in a machine problem. But it's written in either C or C++ (can't remember). You could understand more the sturcture of a JPEG file by researching this API. If you're really up to speed, maybe you could take a look.
If I remember it correctly, the dimension is also listed in the jpeg header. Perhaps you could just have a binary read of the file and parse the dimension information. But then again, you may still have to open the file to be able to read.
mostafa3 reputationPosted Jul 4, 2007, 5:50 AM EDT