上传后强制图像宽度

Phi*_*enn 1 coldfusion

做了一个cffile动作="上传"后,我想检查宽度(假设它是一个图像).我目前正在使用CF8.

是否有内置函数来获取图像的宽度?如果CF9中有内置函数,我想我需要知道更新时间.

小智 5

根据LiveDocs,CF8中存在功能.

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_h-im_32.html#5164681

Adobe提供的示例可以帮助您:

<!--- This example shows how to retrieve information associated with the image. --->
<!--- Create a ColdFusion image from a JPEG file.--->
<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage">
<!--- Retrieve the information associated with the image. --->
<cfset info=ImageInfo(myImage)>
<cfdump var="#info#"></cfdump>
<p>height = <cfoutput>#info.height#</cfoutput>
<p>width = <cfoutput>#info.width#</cfoutput>
<p>source = <cfoutput>#info.source#"</cfoutput>
Run Code Online (Sandbox Code Playgroud)