在 codeigniter 中一次制作 2 个缩略图
谁能告诉我如何在 codeigniter 中创建不同大小和位置的相同图像的 2 个不同缩略图。我创建了一个上传功能和另一个缩略图生成功能,它工作正常,但无法弄清楚如何同时相应地创建 2 个不同的缩略图。任何帮助将不胜感激。
can anyone tell me how to create 2 different thumbnails of same images with different sizes and location in codeigniter. I have created a upload function and another thumbnail generation function, it works fine but can't sort out how to create 2 different thumbnail at accordingly at once. any help will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
其实很简单...
It's actually pretty easy...
所以你有一个thumbnail_generator函数,并说它接受参数original_file_name、new_file_name和thumbnail_size。
只需调用两次即可!
So you have a thumbnail_generator function, and say it takes parameters original_file_name, new_file_name, and thumbnail_size.
Just call it twice!
只需对上面的答案稍加修改即可。将其添加到函数的开头,
需要清除以前的配置
Just a little modification in the above answer. Add this in the beginning of your function
the previous config needs to be cleared