I'm currently working on a site were user submit information to be used in
auction catalogs. The user is required to submit high rez images for the
catalog. I'm using the image.cfc to get the image size in pixels and file size.
We can then give the user some feed back and tell them if the image is large
enough. The problem is that the page that we use to give the user feed back on
the images they uploaded takes forever to load. There might be up 5 large image
on this page that we need to get the image information for.
I'm wondering if some one might no a better way of getting this information.
This is the code I'm using to access the image cfc.
<cftry>
<cfscript>
//If object has not been created then create it
if(isdefined("variables.image")){
//writeoutput("object not created");
}else{
variables.image =
CreateObject("component","auctiontool.admin.imagemanager.image");
//writeoutput("created");
};
variables.imagePath = ImageInfoFile;
variables.image.readImage("FILE", variables.imagePath);
getsize = variables.image.length();
getheight = variables.image.height();
getwidth = variables.image.width();
</cfscript>
<cfset imageClass = "imageinfo">
<cfif (getheight is not "n/a") and (getwidth is not "n/a")>
<cfset thispixelDepth = getheight * getwidth>
<cfif thispixelDepth lt minpixeldepth>
<cfset imageClass = "imageinfoError">
</cfif>
</cfif>
<div class="#imageClass#">
<cfif imageClass is 'imageinfoError'>
Not print quality<br/>
</cfif>
Image Size: #getsize# KB<br/>
Height: #getheight# pixels<br/>
Width: #getwidth# pixels<br/>
</div>
<cfcatch type="any">
<p class="FormError"><b> Unable to calculate image info.</b></p>
</cfcatch>
</cftry>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266149
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4