Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Determining Image Width & Height Automatically
pwetzel
Hello everyone! First time poster, long time reader. :-)
I am looking to populate my <IMG> tags with Width and Height attributes. Is there a way of Interwoven calculating a image width and height so the user doesn't have to determine and input it?
Thanks in advance,
Pete
Find more posts tagged with
Comments
Johnny
I have created a presentation utility module that does this amongst many other features.
wonder over to
http://cpan.org
and have a look at Image::Info . It has the stuff you're looking for.
John Cuiuli
Consultant
Sydney, Australia
Adam Stoller
Maybe I'm missing something here - but isn't the widht/height of the image something that is (a) directly associated with the image file itself and (b) something that can be manipulated by the creator of the page as they desire to squeeze or exapnd the image into a spot that they've chosen to do so?
I.e. I don't think there's anything specific about Interwoven here - you can either not specify the width/height and let the browser do whatever it's going to do, or you can specify specific width/height and as you think makes sense for the page you are [presumably] generating.
Or you can use some tool (I'm sure they exist) that can extract from an image file the intended / actual width/height of the image and use that either with or without some kind of adjustment. But again, I don't believe this is an Interwoven tool, I think it's one or more graphics tools that exist out there somewhere....
--fish
(Interwoven Senior Technical Consultant)
Johnny
In my experience, I have always made it best practice to state the actual dimensions of the image. This avoids screen redraws of the final rendered page once the image has loaded. A big advantage on Netscape especially.
John Cuiuli
Consultant
Sydney, Australia
Migrateduser
Your ABSOLUTELY correct Johnny.
Paulo Gouveia
Royal Caribbean and Celebrity Cruises
Information Tecnology
Florida/USA
Johnny
Thanks Paulo,
Any chance of a free Celebrity Cruise for my correct answer? ;þ
John Cuiuli
Consultant
Sydney, Australia
Migrateduser
Hey,
It would be my pleasure to give you a free cruise, but, I'm only the Tech Guy responsible for TeamSite, not the CIO
.
Paulo Gouveia
Royal Caribbean and Celebrity Cruises
Information Tecnology
Florida/USA
iwovGraduate
I have done this in the past using Image:
ize.
The imgsize function returns the height and width.
You can use this in the PT or within a CGI callout.
Unfortunately I do not have original code/libraries with me right now. But a search on cpan or google will get you the libraries/modules.
Hope that helps.
Johnny
It was worth a shot ;þ
John Cuiuli
Consultant
Sydney, Australia