PHP move_uploaded_file - 图片颜色不正确? (国际刑事法院简介?)

PHP move_uploaded_file - image not correct colors? (ICC Profile?)

我正在尝试上传照片,但是一旦 PHP 使用 move_uploaded_file 处理上传,颜色就会变得一团糟,并且颜色偏蓝。我不知道所有这些 ICC 配置文件(设计师的东西)是什么,我只想上传看起来与客户在 Photoshop 中拥有的完全一样的图像。

我正在阅读有关 ICC 配置文件的信息,发现 this

但是没有文档。为了让我这样做,我必须有原始照片并复制 ICC 配置文件,但在我拥有原始照片之前我必须上传它,并且在这个过程中它会破坏 ICC 配置文件并制作图像 "blue" - 所以现在对我来说有点像 运行 在圈子里。

有人有这方面的诀窍吗?我更喜欢非 imagemagick 解决方案,因为我不喜欢依赖第三方插件 (server/webhotel issues everytime)。

谢谢!

move_uploaded_file() does not alter a single byte of the file, it's just a secure alternative to good old rename()专为文件上传而设计,它当然对图像格式一无所知:

This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.

This sort of check is especially important if there is any chance that anything done with uploaded files could reveal their contents to the user, or even to other users on the same system.

错误一定是在别的地方。