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

Get Image width & height without downloading the entire image?

Dear Sirs,

Is there a way to get the width and height of an image without
downloading the image, or with just downloading a minimal portion of
the image?

For instance, I have a list of 10,000 image urls, and I would like to
get the width and height of every image without spending the time and
bandwidth of downloading every image.

Thanks,
Dave
Nov 16 '05 #1
2 6994
In article <f3**************************@posting.google.com >,
da**@digitallint.com says...
Is there a way to get the width and height of an image without
downloading the image, or with just downloading a minimal portion of
the image?


Hmmm... Possibly. When you make a request to a website for an image, it
will stream down the entire image. I guess you could get just read
enough bytes (depending on the file format) to programatically determine
width/height and then close the stream. I'm not sure if that would
really limit network traffic, or just limit the amount of the traffic
processed by the client.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 16 '05 #2
Thank you for the quick response... I think that my code will just
have to download the images until I find a better solution. Thank you
though.

Dave

Patrick Steele [MVP] <pa*****@mvps.org> wrote in message news:<MP************************@msnews.microsoft. com>...
In article <f3**************************@posting.google.com >,
da**@digitallint.com says...
Is there a way to get the width and height of an image without
downloading the image, or with just downloading a minimal portion of
the image?


Hmmm... Possibly. When you make a request to a website for an image, it
will stream down the entire image. I guess you could get just read
enough bytes (depending on the file format) to programatically determine
width/height and then close the stream. I'm not sure if that would
really limit network traffic, or just limit the amount of the traffic
processed by the client.

Nov 16 '05 #3

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
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: csgraham74 | last post by:
Hi there, i have creted a datagrid control to display images using the following code. <asp:DataGrid id="dg_Properties" runat="server" HorizontalAlign="Center" Width="450px"...
12
by: Lance | last post by:
hey all, first time vb.net 2005 user, after sticking vb6 out for a long time... anyway, using this code ====================== Dim FS As FileStream = File.OpenRead(Filename) Dim theImage As...
3
by: Christoph Burschka | last post by:
Is there some way to get the dimensions of an image, given the binary data of the image, without having to write it to a temporary file? It seems that getimagesize() will only take a filename,...
3
by: benn600 | last post by:
I'm in the process of taking an old table laden, poor code design web site and updating it to a modern day, mostly standards compliant design with only CSS where possible. I'm not having trouble...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
2
by: studentofknowledge | last post by:
For some unknown reason ie is placing images I have in a div in a weird way. One image is overlapping another but this problem is not occuring in mozilla. I have looked at my code over and over again...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.