我正在尝试使用 ImageNew 函数 (coldfusion 8) 创建带有图像 URL 链接的图像对象,例如
那里有很多链接,其中大多数都很好,但是对于某些图像链接,当我调用 ImageNew 函数时出现错误:尝试读取图像时发生异常。 javax.imageio.IIOException:不支持的图像类型
与图像的大小有关吗?有人有什么想法吗?
非常感谢
结果:最后是CMYK/RGB问题。看来CF8在处理CMYK时遇到了麻烦,并且CF8不支持从CMYK到RGB的转换。我使用 ImageMagic 进行转换。
I am trying to use the ImageNew function (coldfusion 8) to create an image object with a image URL link, e.g. <cfset myImage=ImageNew(evaluate( "http://.../../1.jpg" ))>
There are many links there and most of them are good, but for some of the image links, I got an error when I call the ImageNew function: An exception occurred while trying to read the image. javax.imageio.IIOException: Unsupported Image Type
Does it have something to do with the size of images? Does anybody have any idea?
Many thanks
Results: Finally, it's the CMYK/RGB issue. It seems CF8 has trouble in dealing with CMYK and CF8 doesn't support convertion from CMYK to RGB. I use ImageMagic to do the convertion.
发布评论
评论(1)
公平地说,我有时也会遇到这个问题。我认为这与您的代码没有任何关系,coldfusion 的图像处理实用程序要么无法处理完全有效的图像,要么因不符合标准的图像而窒息。发生这种情况时,通常是客户端上传图像,而我的系统会抛出错误。他们把文件发给我,我用 Photoshop 或类似的东西重新保存它,噗,coldfusion 喜欢它。
如果这是问题,我知道的唯一解决方案是使用第三方图像处理器而不是 Coldfusion 的内置功能。我曾经使用 cfx_imagecr
http://efflare.com/products/cfx_imagecr/
但这不是唯一的解决方案。
To be fair, I have this issue sometimes. I don't think it has anything to do with your code, coldfusion's image processing utilities either cannot process a perfectly valid image, or they choke on an image that is not up to standards. When this happens it is typically a client uploading an image and my system throws an error. They send me the file, I resave it out using photoshop or something like that, and poof, coldfusion likes it.
The only solution I know if this is the problem, is to use a third party image processor instread of coldfusion's built in functions. I used to use cfx_imagecr
http://efflare.com/products/cfx_imagecr/
But that is not the only solution out there.