You can do this using base64, look at the site I'm working with: http://www.wordirish.com all images are processed on the client side using HTML5 or flash for older browsers.
you just need to do this:
function thisFunctionShoulBeCallByTheFileuploaderButton(e){ e.preventDefault && e.preventDefault(); var image, canvas, i; var images = 'files' in e.target ? e.target.files : 'dataTransfer' in e ? e.dataTransfer.files : []; if(images && images.length) { for(i in images) { if(typeof images[i] != 'object') continue; image = new Image(); image.src = createObjectURL(images[i]); image.onload = function(e){ var mybase64resized = resizeCrop( e.target, 200, 150 ).toDataURL('image/jpg', 90); alert(mybase64resized); } } } } function resizeCrop( src, width, height ){ var crop = width == 0 || height == 0;
piece of cake;)
Adriano Spadoni Jan 30 '13 at 17:39 2013-01-30 17:39
source share