473,385 Members | 1,893 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,385 software developers and data experts.

GDI: fastest way to read image dimensions

Hi all,

Is there a faster way to read image dimensions other than something
like:
ImageOrig = System.Drawing.Image.FromFile(Filepath);
ImageOrigHeight = ImageOrig.Height;
ImageOrigWidth = ImageOrig.Width;

The problem is this operation takes quite a bit of time to complete
(100+ ms).

What I'm doing is reading the original image size, calculating the new
image size, and then checking a cache where I save the output. If I
could figure out a faster way to get the h/w of the image first it
would help.

thanks,
Tom
Nov 16 '05 #1
1 10544
Hi Thomas,
Hi all,

Is there a faster way to read image dimensions other than something
like:
ImageOrig = System.Drawing.Image.FromFile(Filepath);
ImageOrigHeight = ImageOrig.Height;
ImageOrigWidth = ImageOrig.Width;


Yes, there is!
The fastest way is to read image file header.
But i'm affraid that there is a lot of image formats that
you'll have to learn.

Look at:
http://www.fastgraph.com/help/image_...r_formats.html

Cheers!

Marcin Grzębski
Nov 16 '05 #2

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

Similar topics

4
by: Will McGugan | last post by:
Hi, I'm writing an app that downloads images. It rejects images that are under a certain size - whithout downloading them completely. I've implemented this using PIL, by downloading the first K...
0
by: Thomas | last post by:
Hi all, I'm in search of a fast solution to reading image dimensions. I know you can get the image dimensions by loading a file into an image object, and then reading the height/width...
5
by: John | last post by:
I am rotating images at one location of my web site. My problem is if I set the width and height of the new image before I show the new image, the old image is stretched first to the new image...
1
by: Rico | last post by:
Hello, I have an ole object field (Access XP/2002) which I store images in. I have a couple of questions regarding this; is it possible to determine the image dimensions? Secondly, is there...
3
by: Andy Baxter | last post by:
Is there a way in javascript to find out the size of an image you've just preloaded? I have the following object: function tourImage(imgName) { // used for passing image details to a...
2
by: joe | last post by:
how to read image from sql server to show in a image
1
by: johnrees | last post by:
I am building a photo gallery using code which creates thumbnails of a specific size from any image. When clicked the thumbnail expands dynamically to a pre-determined size. The sizes of the...
70
by: quickcur | last post by:
hi can anyone explain me to read image to memory from a url it is very easy in java but it is hard to find an complete solution in c/c++. Thanks,
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.