|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using img tag to resize image in desired format - avoid generating thumbnails
I have a site where I need to generate a smaller version of an image file. WHat I need is for the largest of the two sizes to be = 83 pixels.
If I take this <img src="" width="83" /> it works, except I cannot guarentee the images largest size is the width, it could be the height. It auto generates the other one porportionally, so that parts ok. I do not want to use a script that creates a thumbnail copy unless I MUST, because I don't want to use extra space until I move up to a dedicated server. Is there a way I can take the largest porportion of a given image, and then generate the proper code? This can be in javascript or php for this site. In theory something like If width <= height ...generate "<img src="$image_url" height="83" /> else if ...generate "<img src="$image_url" width="83" /> Just not sure how to grab those values. An example would be great, as my programmer wants to use a generation but if I can hand him a solution saves us both time. Thanks so much! |
|
#2
|
||||
|
||||
|
FYI: If you display a full size image with smaller dimensions, the browser still downloads the full size image. This means the bandwidth usage and load time of each image would be the same for the "thumbnail" as the original size image.
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
||||
|
||||
|
<img src="some-image.jpg" id="myimage">
document.getElementById('myimage').width; document.getElementById('myimage').height; ![]()
__________________
columbus ohio web designer | sussex county new jersey business directory | columbus ohio roofing
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Web Design Help > Using img tag to resize image in desired format - avoid generating thumbnails |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|