简体   繁体   English

PHP move_uploaded_file-图片颜色不正确? (ICC个人资料?)

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

该图说明了我遇到的问题

I am trying to upload photos, but once PHP handles the upload with move_uploaded_file the colors gets all messed up and blue-ish in the color. 我正在尝试上传照片,但是一旦PHP用move_uploaded_file处理了上传,颜色就会变得一团糟,颜色变成蓝色。 I have no idea what all these ICC profile (designer stuff) is and all I want is to upload images that look EXACTLY like the ones the customer has in Photoshop. 我不知道所有这些ICC配置文件(设计师的东西)是什么,我只想上传看起来与客户在Photoshop中完全一样的图像。

I was reading about the ICC Profiles and found this 我在阅读有关ICC配置文件的信息,发现了这一点

But there are no documentation. 但是没有文档。 In order for me to do this I have to have the original photo and copy the ICC profile, but before I can have the original photo I have to upload it, and in the process it ruins the ICC profile and make the image "blue" - so it's kinda like running in circles for me right now. 为了执行此操作,我必须拥有原始照片并复制ICC配置文件,但是在获得原始照片之前,我必须上传它,并且在此过程中它会破坏ICC配置文件并使图像变为“蓝色” -有点像是现在为我跑步。

Does anyone have a trick for this? 有人为此有把戏吗? I prefer NON-imagemagick solutions, as I am not a fan of being dependant on third-party plugins ( server/webhotel issues everytime ). 我更喜欢NON-imagemagick解决方案,因为我不喜欢依赖第三方插件( server/webhotel issues everytime )。

Thanks! 谢谢!

move_uploaded_file() does not alter a single byte of the file, it's just a secure alternative to good old rename() designed for file uploads and it certainly knows nothing about image formats: move_uploaded_file()不会更改文件的单个字节,它只是为文件上传而设计的良好旧版named()的安全替代方法,它对图像格式一无所知:

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). 此功能检查以确保filename所指定的文件是有效的上传文件(意味着该文件是通过PHP的HTTP POST上传机制上传的)。 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. 如果上传的文件所做的任何事情都可能向用户甚至同一系统上的其他用户透露其内容,则这种检查尤为重要。

The error must be somewhere else. 该错误必须在其他地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM