Codeigniter 蓝色色调
更新:答案是使用 GD2 库,DOH!
我正在使用 Codeigniter 的图像处理库来调整一些照片的大小。不幸的是,它们给照片带来了蓝色色调或色调。不知道为什么会这样,需要看看这是否是我正在做的事情。这是我用来创建拇指的代码。如果您想查看图像链接,请告诉我,我会将它们上传到某个地方。
$this->load->library('image_lib');
$config['image_library'] = 'GD';
$config['source_image'] ="images/IMG_0007.jpg";
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = '450';
$config['height'] = '450';
$this->image_lib->initialize($config);
if(!$this->image_lib->resize())
{
echo $this->image_lib->display_errors();
}
UPDATE: THE ANSWER IS USE THE GD2 LIBRARY, DOH!
I am working with Codeigniter's image manipulation library to resize some photos. Unfortunately, they are producing a blue tint or hue to the photos. Not sure why this is and needed to see if it was something I am doing. Here is the code I am using to create the thumb's. Let me know if you want to see image links, and I will upload them somewhere.
$this->load->library('image_lib');
$config['image_library'] = 'GD';
$config['source_image'] ="images/IMG_0007.jpg";
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = '450';
$config['height'] = '450';
$this->image_lib->initialize($config);
if(!$this->image_lib->resize())
{
echo $this->image_lib->display_errors();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈建议您使用 ImageMagick 来调整图像大小。它尊重颜色配置文件,速度稍快,占用内存较少,并且通常会产生更好的质量。请参阅此问题:
如何停止 GD2调整图像大小时洗掉颜色?
如果您没有安装 ImageMagick,这可能会有所帮助:
http://ferdychristant.com/blog//archive/DOMM-8GAFGL
I strongly recommend you to use ImageMagick for image resizing. It respects color profiles, is slightly faster, less memory hungry and generally produces better quality. See this question:
How to stop GD2 from washing away the colors upon resizing images?
If you do not have ImageMagick installed, this may be of help:
http://ferdychristant.com/blog//archive/DOMM-8GAFGL