So, I'm currently working on a new application for the next DRK. I can't say much about it (it's code named Harlan), but I can talk about an issue I ran into. I needed a quick way to determine the height and width of an image. Normally I would use Alagad for this type of task. I really like Alagad - it's like the Bass-O-Matic of Image tools, and the price is right. But - it's not free, so I can't include it in the DRK. However, I did find this nice tip by David Medlock:
<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>
<cfobject type="JAVA" action="Create" name="img" class="java.awt.Image">
<cfscript>
img = tk.getDefaultToolkit().getImage(fname);
width = img.getWidth();
height = img.getHeight();
</cfscript>
Archived Comments
There was an AIC Lite included in one DRK or another that was free. Not that you still need a solution, but that is out there.
Yea, the Lite version is also very powerful - but it would require users to have the DRK. Now this is an app for _another_ DRK, so that may be safe, but I don't want any dependancies on other DRKs.
I already did a ColdFusion function using this code on the start of 2004 and sent it to CFLIB.ORG, but it was never online.
Regards,
Marcos
That's because we had one already. It did it via reading in file bits.
The second CFOBJECT call is not necessary in your code sample.
Ray, you mean this one: http://cflib.org/udf.cfm?ID...
It's very complicated, maybe you should add this different way.
Marcos, the one in CFLib is nice though because it doesn't require AWT, so on some unix servers that is good.
Maybe you could add this one as AWTImageSize or something.
Another free solution that I have used is tmt_img by Massimo Foti. It is available here http://www.olimpo.ch/tmt/cf...
It's amazing that alot of CF programmers I have talked to forget that you can leverage Java extremly easy in CFMX.
I use Java ALOT in the application that I write because I find alot of times CFMX doesn't have a function that I need or simply can't do what I need it to do practically.