开发者

Upload Image, Crop & Resize

What is the best way to upload an image, save it temporary, and let some user resize and crop it in some ajaxy interface?

Any serious librarys with PHP开发者_JAVA技巧?


Brad is right, separate your problem into its independent pieces.

I had some luck with Imagemagick as the backend. Also see here.

For Ajaxy UI tricks, JQuery seems to be the stock advice, although I've hardly used it myself.


Rather than storing temporary, I would store it permanently and do some default resizing/cropping initially. Then, if user wants to edit the default results, there would be additional interface for this.

Users are often lazy and it is OK to have some default processing for such users.


You can upload an image and store the it (the original) in the filesystem permanently. You can then use an image manipulation library (I would recommend having a look at phpThumb) to do the resizing. As for the interface, you can use jQuery or any other user interface library of your choice (see this link). The interface would merely allow user to specify the resize/crop parameters -- phpThumb will do the rest.


For a PHP Image Transformation Library, I always found class.upload.php to be quite handy. It handles resizing/cropping/filling and other basic transformations quite well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜