• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 733
  • Last Modified:

get image and swf dimensions with coldfusion

Is there a way to check the dimensions of an image or a swf file on your server. I am building a banner management application and I want it to add the height and width of a banner to the database when a banner gets uploaded throught the form using cffile. I want this to be an automated feature so the client does not have to add them in their self. Any advice as where to start on this would be great.
0
siva350
Asked:
siva350
  • 4
  • 2
1 Solution
 
mrichmonCommented:
Yes.

<cfobject type="JAVA" action="Create" name="tk" class="java.awt.Toolkit">
<cfobject type="JAVA" action="Create" name="img" class="java.awt.Image">
<cfscript>
img = tk.getDefaultToolkit().getImage(fname);
width = img.getWidth();
height = img.getHeight();
</cfscript>

Or use a nice tag like those linked to from here:
http://www.thenetprofits.co.uk/coldfusion/faq/topic.cfm?TopicID=20
0
 
siva350Author Commented:
will this work with a flash banner?
0
 
mrichmonCommented:
I don't know
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
siva350Author Commented:
mrichmon, thanks for your help, I found a cfc that I think will work for the flash but it looks like your answer will do the trick for the gifs and jpg so I will be back shortly to let you know if it all worked and post a link to the cfc if it does work
0
 
siva350Author Commented:
this code does not seem to work, can you tell me what I need to change?
0
 
siva350Author Commented:
nevermind, Im a moron and forgot to put the file path in the code. oops
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now