Codeigniter图片resize()缩略图名称问题 [英] Codeigniter image resize() thumbnail name issue
问题描述
当我调整图像大小时,保持 $ config [’create_thumb'] = true
Codeigniter在调整大小的图像名称的末尾添加字符串 _thumb。
When I resize an image keeping $config['create_thumb'] = true
Codeigniter adds the string "_thumb" in the end of the name of resized image.
我想问的是,是否可以在图像名称的开头添加后缀 _thumb
What I want ask is, is it possible to add the suffix "_thumb" in the beginning of the image name
示例:
original_name.jpg
example: original_name.jpg
调整大小后:
original_name_thumb.jpg
after resizing: original_name_thumb.jpg
我想要什么:
thumb_original_name.jpg
What I want: thumb_original_name.jpg
任何帮助都将受到赞赏!
Any kind of help is appreciated!
推荐答案
您可以尝试以下操作:
$data = $this->upload->data();
$config['create_thumb'] = false;
$config['new_image'] = 'thumb_'.$data['file_name'];
如果您对CI图像处理库有其他问题,也许可以尝试 ImageMoo 。
And if you have other problems with CI image manipulation library, maybe you can try ImageMoo.
这篇关于Codeigniter图片resize()缩略图名称问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!