Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to know dimensions of an image file in CF please

Status
Not open for further replies.

arthuro111

Programmer
Aug 15, 2002
18
US
I am generating an automatic email using CFmail in an app. Part of what I am in putting in there is pictures. I want them to be thumbnails, so I resize them in the img tag, either the vertical or horizontal.

However, here's the problem: I need to be able to do both.

In most email programs (Outlook, Yahoo, etc) when you put in only one of the dimensions, the other one shrinks to match proportionally when you view the email itself.

In Lotus Notes, which is what will have to be used, if you only put in the vertical dimension, the pictures come out stretched all the way across the page. If you only do horizontal, they are super tall.

My temporary solution is to pick a size (175x100 say), but of course the pictures are usually distorted.

Can anyone point me towards something that will detect the size of images from their file? I can then do the calculations to shrink the picture down.

Thanks in advance!!!!!!!!!
 
Have you though about just resizing the images to whatever size you need them to be?



Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
Sorry, didn't mention that but I have no control over these images - they come in from lots of non-technical users so there will not be an easy way to force them to be a particular size or aspect ratio.

There may be a tag which could allow them to crop, etc on upload, but the guy running the system doesn't want to complicate the regular users lives, so I'm stuck with what I get.

So the question remains - given that I am getting image files of random size, how can I know their size?

I know Javascript can get the size - can I transfer that information into CF?

Thanks in advance for any help!
 
they come in from lots of non-technical users so there will not be an easy way to force them to be a particular size or aspect ratio.

There may be a tag which could allow them to crop, etc on upload, but the guy running the system doesn't want to complicate the regular users lives, so I'm stuck with what I get.

When the user uploads the image they're done. It's up to you to resize the image. The users life is no more diffacult.

for example:

all use Alagad image component to resize the image to a width determined by the admin user of the content management system behind the scenes... (click the thumbnails to see the actual image the user upladed) it doesn't require users to do anything special.


There are free programs out there but this one is by far the best.



We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I might add the host is having some technical probles so please forgive the lack of speed in loading the example links i posted.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top