Precia
----- Original Message ----- From: "Nando" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 01, 2004 9:50 AM
Subject: RE: [CFCDev] Using a Java class in CF to get image width and heig ht
Precia,
http://www.geocities.com/marcoschmidt.geo/image-info.html
Well, this is the only one i've found, but as a Java newbie, i don't see how
to implement it via CF directly - as you have done with the
javax.swing.ImageIcon approach. I'd have to sit with it for a few days to
distill the essential functions from this class, see how they work, and try
and implement them via CF. But it seems it should work.
I've also found the same technique used in PHP and VB examples, read the first few bytes and extract the height and width information from the header.
In any case, i think it would be very useful to refine this for CF, as it's
probably the most commonly needed use of Java in CF.
:) nando
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of PC Carraway Sent: Wednesday, September 01, 2004 4:30 PM To: [EMAIL PROTECTED] Subject: Re: [CFCDev] Using a Java class in CF to get image width and heig ht
Nando
I'm still on the lookout for an SWF solution. Good luck if you find one before me.
Precia
----- Original Message ----- From: "Nando" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 01, 2004 8:44 AM Subject: RE: [CFCDev] Using a Java class in CF to get image width and heig ht
Precia,
thanks for the code snippet - and the example of using java within CF - it
works very well, for images. It's much faster than using the approach
Craig
indicated, via java.io.File and javax.imageio.ImageIO, or the Alagad
component. I wonder if that's because javax.swing.ImageIcon just grabs the
file header? Unfortunately it doesn't work for SWFs, but because the code
is
so clean, i'm thinking to use it for the images anyway and work out a
specialized solution for the SWFs
Thanks again,
:) nando
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Precia Carraway Sent: Wednesday, September 01, 2004 10:16 AM To: [EMAIL PROTECTED] Subject: Re: [CFCDev] Using a Java class in CF to get image width and heig ht
<cfscript> function getImageWidth(imagepath) { imgFile = createObject("java","javax.swing.ImageIcon").init(imagepath); imgFile.getImage(); imgWidth = imgFile.getIconWidth(); return imgWidth; } function getImageHeight(imagepath) { imgFile = createObject("java","javax.swing.ImageIcon").init(imagepath); imgFile.getImage(); imgWidth = imgFile.getIconHeight(); return imgWidth; } </cfscript>
#getImageWidth(attributes.filepath)# #getImageHeight(attributes.filepath)#
Hope this helps... PCC
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
