jpg文件的ColdFusion IsImageFile失败 [英] ColdFusion IsImageFile fails for jpg file

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

问题描述

2张看起来完全相同的jpg图像(上面的图像失败,no.jpg,重新保存为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.

运行此代码

#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 返回否的原因。

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中返回是。但是,<$ c $仍然存在问题c> 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.

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

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