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

get real image size

Dormilich
8,658 Expert Mod 8TB
Hi,

I wonder, if there is a possibility to determine the real size (width/height) of an image in JavaScript. something like Gecko’s naturalWidth/naturalHeight. in FF/Safari I can get the values, but that doesn’t work for Chrome and Opera.

Dormi
Mar 13 '10 #1
8 4494
gits
5,390 Expert Mod 4TB
hmmm ... might be that this is of some help?

kind regards
Mar 14 '10 #2
Dormilich
8,658 Expert Mod 8TB
it seems it takes the image dimensions immediately after loading the source and before the styling of the image applies … maybe I can make something of that (but I don’t install jQuery just for that)
Mar 14 '10 #3
gits
5,390 Expert Mod 4TB
me too ... wouldn't do that :) ... just thought to show the link as a ref on how to try to achieve that goal ...

kind regards
Mar 14 '10 #4
Dormilich
8,658 Expert Mod 8TB
seems like I don’t get it without jQuery (i.e. test script failed)
Mar 14 '10 #5
gits
5,390 Expert Mod 4TB
hmmm ... might be that a xmlhttprequest and php's getimagesize() would be a good idea? this could even be used before sending a page so that a page could include a javascript 'image-info' object? ... seems better than a JavaScript solution?

kind regards
Mar 14 '10 #6
Dormilich
8,658 Expert Mod 8TB
is there anything without requiring a server script? (like a HEAD request …)
Mar 15 '10 #7
gits
5,390 Expert Mod 4TB
none that i'm aware of ... sorry ... didn't even had such a requirement before so there might be possibilities that i just don't know :)

kind regards
Mar 15 '10 #8
Dormilich
8,658 Expert Mod 8TB
darn, were it for the file size, a HEAD Request would be perfect …
Mar 15 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ruby Tuesday | last post by:
I have a section(185pixelsx 185pixels) in my web page to display an image that is stored in a directory. Using php, how do you resize so if: the image dimension is smaller(width and height is...
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: no-spam | last post by:
Hello, I have an HTML question that I'm not sure can be solved. I want to restrict the maximum size of an inline image. For example, I can force the image to be 200x200 if I do this: <img...
8
by: Chris Dewin | last post by:
Hi. I run a website for my band, and the other guys want an image gallery. I'm thinking it would be nice and easy, if we could just upload a jpg into a dir called "gallery/". When the client...
23
by: Adam | last post by:
I am coding a microkernel based off of Tanebaum's theroy. For Isis to be extensible, fast, and secure, it has been decided it will be a microkernel. Not in the old Mach sense of the word, but in...
1
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks-...
6
by: nichughes | last post by:
Hello all, A question relating to http://www.entrust-systems.net/ Just for a change I have run into a problem that seems to be OS specific rather than browser specific - the box image that is...
2
by: Adam Teale | last post by:
hey guys Is there a builtin/standard install method in python for retrieving or finding out an image's dimensions? A quick google found me this:...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.