问题描述:

I'm currently creating a website for a karate school with an administration but I'm stuck at the "Add photo" section.

I want to know how I can create a fully HTML5 picture uploader with drag & drop feature, resize to make a thumbnail, and rename the picture to fit the PHP specifications.

Here's my specifications for the uploader:

-> Drag and Drop from a local folder

-> If the image is not the correct ratio, provide a image cropping. (Like Twitter)

-> Resizing like this:

-> Detect the aspect ratio (4:3 / 16:9)

-> Create a thumb of 40% of the size

-> Create 2 files in the "Uploads" folder

-> {a random ID}.{png,jpg,gif,etc...} (full size)

-> {the same ID-thumb.{the same ext} (thumbnail)

I want to create this using only JS and PHP. I use Zend Framework for this app.

I hope that this is possible in PHP and HTML5 but I didn't try anything yet. I don't want to loose time because I'm paid for that so the time is cash!

网友答案:

For HTML Upload, You can surely use plupload, I have used it and it worked fine.

For re-sizing and thumb generation you may create your custom function and integrate that into plupload or may go for ffmpeg

相关阅读:
Top