PHP Image Resize and Cropping

烂漫一生 提交于 2019-12-11 06:43:08

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/3260016/php-image-resize-and-cropping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!