Hey everyone.. I'm trying to use this fuction below in a CFC.... it's
suppose to return the demensions of the photo

This is how I'm calling it...  How do I get the results from the CFC??

<cfscript>
        imgObj=CreateObject("component", "cfc/tmt_img");
        imgObj.getDimensions("photo2.jpg");
</cfscript>

<cffunction name="getDimensions" access="public" output="false"
returntype="struct" hint="Returns a structure containing the
dimensions (pixels) of a jpg, png or gif image file. Keys are: width
and height">
                <cfargument name="imgPath" type="string" required="true" 
hint="Image
path, either local or absolute">
                <cfscript>
                var imgStruct = StructNew();
                var jFile = urlToJavaFile(arguments.imgPath, true);
                var jBufferedImg = javaFileToJavaImg(jFile);
                </cfscript>
                <cftry>
                        <!--- Get the info and store them into the structure 
--->
                        <cfset imgStruct.width=jBufferedImg.getWidth()>
                        <cfset imgStruct.height=jBufferedImg.getHeight()>
                        <cfcatch type="any">
                                <cfthrow message="Failed to read image 
dimensions. The component
can read only jpg, gif and png files" type="tmt_img">
                        </cfcatch>
                </cftry>
                <cfreturn Duplicate(imgStruct)>
        </cffunction>

-- 
Ryan Everhart
[EMAIL PROTECTED]
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
   http://www.dfwcfug.org/form_MemberRegistration.cfm


Reply via email to