在做了cffile action=“上传”之后,我想检查一下宽度(假设它是一张图片)。我目前使用的是CF8。
有没有一个内置的函数来获取图像的宽度?如果在CF9中有一个内置的函数,我想我需要知道它在我们更新的时候。
发布于 2011-08-21 06:22:04
根据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>https://stackoverflow.com/questions/7134880
复制相似问题