PHP 世界中有没有与 SORL 缩略图(一个 Django 项目)具有相同功能的东西。
具体来说:
1)它缓存结果(动态生成缩略图太消耗CPU资源)。
2)它提供了智能裁剪功能,可以根据图像熵进行裁剪以适应(因此它不仅仅裁剪到中心,而是裁剪“动作”所在的位置)。
我正在寻找的最大功能是智能裁剪能力。
Is there anything out there in the PHP world with equivalent functionality to SORL thumbnail (a Django project).
Specifically:
1) It caches results (generating thumbnails on the fly is too cpu intensive).
2) It provides a smart cropping feature that crops to fit based on image entropy (so it doesn't just crop to center, but rather crops where the 'action' is).
The big feature I'm looking for is the smart cropping ability.
发布评论
评论(3)
我立即知道的唯一图像操纵器是
php.net/manual/en/book.image.php
但经过一些快速谷歌搜索后发现
http://www.ajquick.com/programming/thumbnail/
希望其中之一有所帮助。
Only image manipulator I knew off the bat was
php.net/manual/en/book.image.php
But after some quick Googling found
http://www.ajquick.com/programming/thumbnail/
Hope one of those helps.
我找到了一个 drupal 模块,可以从中提取一些 php 代码:
http://github.com/dylantack/codename_cornbaby< /a>
它实际上基于引用的相同 django-sorl-thumbnail 方法,所以这是完美的。
I found a drupal module from which I can lift some php code:
http://github.com/dylantack/codename_cornbaby
It's actually based on the same django-sorl-thumbnail approach cited, so that's perfect.
如果您确实遇到了这个问题,尽管它是一个非常古老的问题,您可以尝试像 ImageKit.io 这样的工具,它提供 智能裁剪开箱即用。它在内部使用面部和特征检测来为智能裁剪进行必要的计算。 ImageKit 还具有面部裁剪模式,可以从原始图像中挑选出面部来创建缩略图。
If you do land up on this question, though its a very old one, you can try tools like ImageKit.io which provide smart cropping out of the box. It uses face and feature detection internally to make the necessary computations for smart crop. ImageKit also has a face-crop mode that picks out the face from the original image to create a thumbnail.