[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

get image and swf dimensions with coldfusion

Posted on 2006-05-12
6
Medium Priority
?
727 Views
Last Modified: 2013-12-20
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
Comment
Question by:siva350
  • 4
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 2000 total points
ID: 16672011
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
 
LVL 3

Author Comment

by:siva350
ID: 16672573
will this work with a flash banner?
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 16683161
I don't know
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 3

Author Comment

by:siva350
ID: 16683996
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
 
LVL 3

Author Comment

by:siva350
ID: 16684197
this code does not seem to work, can you tell me what I need to change?
0
 
LVL 3

Author Comment

by:siva350
ID: 16684273
nevermind, Im a moron and forgot to put the file path in the code. oops
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
Suggested Courses
Course of the Month18 days, 20 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question