ColdFusion IsImageFile对于jpg文件失败。 WTF? [英] ColdFusion IsImageFile fails for jpg file. WTF?

查看:192
本文介绍了ColdFusion IsImageFile对于jpg文件失败。 WTF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2 jpg图像看起来完全相同(上面的失败图像,no.jpg,resaved as yes.png)但是一个不是根据IsImageFile函数的图像...任何想法

2 jpg images that look exactly the same (failing image above, no.jpg, resaved as yes.png) but one is not an Image according to IsImageFile function... Any ideas

运行此代码

#IsImageFile("http://fdiapp.com/ini/cms/file_uploads/yes.jpg")#
**
#IsImageFile("http://fdiapp.com/ini/cms/file_uploads/no.jpg")#


推荐答案

我认为问题是 CMYK jpeg。 ColdFusion 9在内部使用 ImageIO ,其中afaik 只支持RGB 。 (虽然该线程中的一些Java建议是从ColdFusion工作的 - 所得到的图像中的颜色是倾斜的。)可能发生的是, ImageIO 无法加载图像文件,这就是为什么 IsImageFile 返回no。

I think the problem is that is a CMYK jpeg. ColdFusion 9 uses ImageIO internally, which afaik only supports RGB. (While some of the java suggestions in that thread do work from ColdFusion - the colors in the resulting image are skewed.) What is probably happening is that ImageIO fails to even load the image file and that is why IsImageFile returns "no".

FWIW, IsImageFile 在ColdFusion 10中返回yes。但是,它仍然存在 CMYK 。例如,如果你尝试读取图像,最终的颜色都错了...

FWIW, IsImageFile returns "yes" in ColdFusion 10. However, it still has issues with CMYK. For example if you try and read the image, the final colors are all wrong ...

我认为你最好的打算是通过一个工具,如 ImageMagick 并将其转换为ColdFusion可以正确处理的格式。

I think your best bet is to run it through a tool like ImageMagick and convert it to a format ColdFusion can handle properly.

这篇关于ColdFusion IsImageFile对于jpg文件失败。 WTF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆