Cfimage 信息非常慢

Cfimage info very slow

我在 coldfusion 9 中有以下脚本:

<cfimage action="info" source="E:\....\image.png" structname="local.imageInfo">

图像在本地驱动器上。这个动作大约需要 4 秒。文件大小约为 800kb(300 dpi,png)。这对我来说似乎不正常。有没有办法加快速度?我只需要图片的宽度和高度。

顺便说一句,对图像执行简单的读取操作会立即执行

<cffile action="read" FILE="E:\....\image.png" VARIABLE="local.imageread">

如果您使用的是 Windows 和 ColdFusion 8+,请考虑使用免费、可移植的命令行程序 Exiv2 和 GraphicsMagic。 Exiv2 可以使用命令行 read/write EXIF 数据并且比内置 CF 函数更快。

http://www.exiv2.org/

GraphicsMagick 在转换、调整大小、裁剪、旋转、生成缩略图、读取 CMYK 图像时不会抛出错误等方面要快得多

http://www.graphicsmagick.org/

我已经将 ColdFusion 8-2016+ 自定义标签编写为两个可移植命令行程序的包装器。

http://gamesover2600.tumblr.com/post/139435793234/coldfusion-udf-for-exiv2-faster-exif-image

<CFSET ImageFilePath = "c:\test.jpg">
<CFDUMP VAR="#Exiv2(imageFilePath)#">

http://gamesover2600.tumblr.com/post/125766251344/graphicsmagick-coldfusion-custom-tag

<CFSET ImageIn = "c:\test.jpg">
<!--- Identify - Get basic info (Exiv2 is better/faster) --->
<CF_GraphicsMagick action="Identify" infile="#ImageIn#" result="GM_Identify">
<CFDUMP VAR="#GM_Identify#" label="GM_Identify">

<!--- Optimize (common settings to reduce filesize) --->
<CF_GraphicsMagick action="Optimize" infile="#ImageIn#" outfile="#replace(ImageIn,'.jpg','_optimize.jpg')#" result="GM_Optimize">

<!--- ResizeWidth (Resize to defined width --->
<CF_GraphicsMagick action="ResizeWidth" infile="#ImageIn#" width="200" outfile="#replace(ImageIn,'.jpg','_resizeWidth.jpg')#" result="GM_ResizeWidth">

<!--- AspectCrop (Similar to ImageUtils.cfc) --->
<CF_GraphicsMagick action="AspectCrop" Infile="#ImageIn#" outfile="#replace(ImageIn,'.jpg','_aspectCrop.jpg')#" width="100" height="100" quality="90" result="aspectCrop">