Codeigniter 和 GD 图像处理
在 codeigniter 中,我正在创建一个应用程序,允许用户一次性上传多个文件,对此我正在使用这个库, http://www.mitesdesign.com/blog/open-source/multi-upload-jquery-code-igniter
我的问题是是否有已上传的多个图像如何在 $config 中定义源图像,到目前为止我已经这样做了,
$gd['image_library'] = 'gd2';
$gd['source_image'] = '';
$gd['create_thumb'] = TRUE;
$gd['maintain_ratio'] = TRUE;
$gd['width'] = 164;
$gd['height'] = 103;
$this->load->library('image_lib', $gd);
$this->image_lib->resize();
您可以看到 source_image 是空的,因为我不知道如何获取用户上传的所有图像。
任何人都可以提出任何建议吗?
In codeigniter I am creating an application that allows the user to upload multiple files in one go, to this I am using this library, http://www.mitesdesign.com/blog/open-source/multi-upload-jquery-code-igniter
My question is if there are multiple images that have been upload how do I define the source image in the $config, so far I have done this,
$gd['image_library'] = 'gd2';
$gd['source_image'] = '';
$gd['create_thumb'] = TRUE;
$gd['maintain_ratio'] = TRUE;
$gd['width'] = 164;
$gd['height'] = 103;
$this->load->library('image_lib', $gd);
$this->image_lib->resize();
as you can see the source_image is empty as I do not know how to get all the images that the user has upload.
Can anyone suggest anything?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看本文 ZIP 中提供的 Multi_upload 库,您所要做的就是:
这将返回一个如下所示的多维数组:
然后只需进行 foreach 并在调整大小代码中使用这些详细信息。
Looking at the Multi_upload library supplied in the ZIP in this article, all you have to do is this:
That will return a multi-dim array like this:
Then just foreach through and use those details in your resizing code.