Topic: New Features

I know there is a forum for requesting new features. But in my case, I have already implemented them in my usage of plupload. I can, if desired submit these back to the project, if anyone wants them.

1. I needed to show thumbnails of the images. Using the new(ish) HTML5 Files API I could produce these, except that plupload does not present the original native file object to the end user, so that they can use it to access the img data. I updated the HTML5 module to add this data to the .file array.

Something like this seems like a no-brainer must-have, for a module labelled HTML5. At the least this allows the user to add thumbnails, whilst still basically keeping the API 'pure'. Its working well for me.

2. I needed to add Thumbnail production and uploading. We are going to use Amazon AWS for our new site. They dont charge for upload data (pretty much only thing they don't charge for!). So, why waste the opportunity to use the users PC to process the thumbs for us (we all have super computers these days eh?).

Again, pretty much a must have I think. Again, I've tried to keep it inline with the API, non hacky. I added another setting, called thumbnailsize ( width, height, quality) and if its present in settings the upload engine takes a second stab at resizing the image and uploading. Along the way I filter filenames to ensure lowercase, three char file types i.e. .jpg, not .jpeg or .JPG. And on the thumbnail upload rename the file to _thumb.jpg/png. Again, seems to be working for me.

Great library. Just going to pay for it now. Like I said, if anyone wants these, I'll submit them for inclusion?

Cheers

Chris

2 (edited by cthomas 2012-02-21 03:54:03)

Re: New Features

Just added one more feature before crashing for the night. The thumbnail resize was producing pretty nasty results. It looks like for speed reasons that CANVAS is not interpolating on scale, using drawImage. To get around this, I used a simple trick.

Set the canvas alpha to 1, draw the resized image to the canvas. This gives us what we already had, both for large resized images, and for thumnails i.e. highly ailised. I then set alpha to .1 and draw the image over and over again, in all 16 times in a circle of confusion. First eight use .15 pxl offsets, second eight use .25 pxls. The offsets are, up, up-right, right, down-right, down, down-left, left, up-left. And for some reason the combo of two circles at .15 and .25 give great results. Luckily Canvas does support these sub-pixel offsets, allowing us to sample the "signal" more effectively.

Again, I think this should be a standard feature. BTW, does anyone know of any other examples of how to anti-ailise Canvas drawImage?

CT

Re: New Features

Submit a pull request when you are finished if you'd like to see these new features added.  Other developers can have a look at the code and let you know what they think.

Re: New Features

Sorry, how would I submit a pull request? Is this via Git, or?

Re: New Features

Yes, using git and github.

Code is here:
https://github.com/moxiecode/plupload

The basics of pull requests are here:
http://stackoverflow.com/questions/5256 … est-commit
http://help.github.com/send-pull-requests/

Re: New Features

Has this functionality been added to plupload and/or are there plans to? I'd love to be able to have thumbnails generated client-side rather than trying to do it server side.