在 CakePHP 中,您使用过的最好的图像上传/调整大小组件是什么?
我正在寻找可以属于许多模型的东西,并且希望也具有内置的所有调整大小功能。
想知道是否有任何好的建议,我不想选择错误的。
或者是否值得自己构建?
Im looking for somthing that can belong to many many models and, hopfully, has all the resizing functionality built in too.
Wondering if there's any good suggestions out there, I don't want to pick the wrong one.
Or is it just worth building my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
几年前,我为 Cake 1 编写了一个非常漂亮的图像上传组件。现在我不知道代码在哪里,但我的朋友 Koa 不久前写了一篇文章:
http://labs.iamkoa.net/2007/10/23/image-upload -component-cakephp/
http://labs.iamkoa.net/2007/11/06/multiple-image-uploads-into-single-mysql-table-cakephp/
可能是你可以破解的东西。它处理上传、调整大小(调整大小、裁剪、调整大小然后裁剪、最大、混合),如果我没记错的话,它甚至可能做过滤器(翻转、反转、灰度)。
我还将代码移植到 Zend 框架(和 PEAR 文件命名)以用于我的新内容管理框架。现在一切都包含在内并且好多了(完成了我上面提到的所有事情并且有很好的文档记录)。您可以在这里下载(查看 ImageManipulator 类。我认为 FileUploader class 依赖于我的 String utils 类,如果你想使用它,你可以轻松删除它,
否则,我说 Cake 中的组件架构一开始让我感到困惑,所以如果你想学习 XP,它可能是一个很好的选择。如果您还不知道,您可以获取某人的上传器并将其转换为您的 Cake 应用程序的组件。
I wrote a pretty sweet image upload component a few years ago for Cake 1. I don't have a clue where the code is these days, but my friend Koa did a write up on it a while back:
http://labs.iamkoa.net/2007/10/23/image-upload-component-cakephp/
http://labs.iamkoa.net/2007/11/06/multiple-image-uploads-into-single-mysql-table-cakephp/
Might be something you can hack. It handles uploads, resizing (resize, crop, resize then crop, max, mix) and if I remember correctly, it might even do filters (flipping, inverse, greyscale).
I also ported the code to Zend framework (and PEAR file naming) for my new content management framework. It's all contained and much better now (does all the things I mentioned above and is pretty well documented). You can download that here (check out the ImageManipulator class. I think the FileUploader class has a dependency on my String utils class which you could easily remove if you want to use that.
Otherwise, I say roll your own. The component architecture in Cake was confusing to me at first so it could be a good learning XP if you don't know it yet. If you do, you can just grab someones uploader and convert it into a component for your Cake application.
查看 @nperson https://github.com/davidpersson/media/wiki
Check out the Media plugin by @nperson https://github.com/davidpersson/media/wiki
https://thoughtwm.com/code/ 用于图像上传
&
http://www.darrenhoyt.com/2008/04/ 02/timthumb-php-script-released/ 用于调整图像大小
https://thoughtwm.com/code/ for the image upload
&
http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/ for the image resizing
获取图像的 EXIF/元信息怎么样?
How about for getting EXIF/Meta info of the image?