moxiecode / plupload

Plupload is JavaScript API for building file uploaders. It supports multiple file selection, file filtering, chunked upload, client side image downsizing and when necessary can fallback to alternative runtimes, like Flash and Silverlight.
http://www.plupload.com
GNU Affero General Public License v3.0
5.63k stars 1.43k forks source link

Client resize not working #1552

Open o-rey opened 6 years ago

o-rey commented 6 years ago

Client resize stopped working after switching version 2 to version 3. My config options are resize: { width: 224, height: 150, crop: true }

If I replace plupload.full.min.js by plupload.dev.js I see in console: StateChanged: ImageResizer::o_1c8trj0291nch2s91lje1hm217b8g (IDLE to DONE) so resizer is being called, but uploaded image still the same size.

fotan commented 6 years ago

Bump. I'm using PLUpload in Bootstrap 4 and the client side resize isn't doing anything. I'm not seeing anything in console. It's just failing silently.

fotan commented 6 years ago

To clarify on my comment, resize does not work in v3 of plupload. It works fine in v2.

jfstenuit commented 6 years ago

Same here with Firefox 59/Ubuntu 16.04.1/plupload 3.1.2, 'html5' runtime : the resize function doesn't seem to work. I have breakpoints set throughout the code and moxie/runtime/html5/image/ResizerCanvas/scale is indeed called. But it seem some other steps further down the chain are ignored. Maybe non-related, but the unique_names feature is broken as well in my environment since the upgrade.

maPer77 commented 6 years ago

Hello, do you have any solutions for this? version 3.1.2 resizing does not work !!!

warrenkc commented 5 years ago

I also have encountered the same issue.

dealer-solutions-gene commented 2 years ago

And here I am in 2022 trying to use v3... var rszr = new ImageResizer(file); seems to be creating a new instance of "ImageResizer" but not including any of the options specified when setting up new plupload.Uploader({})

dealer-solutions-gene commented 2 years ago

Additional commentary, I can see what ultimately resizes the image is done with HTML5 canvas here

canvas.getContext("2d").drawImage(_getImg(), rect.x, rect.y, rect.width, rect.height, 0, 0, canvas.width, canvas.height);

however the source and destination image dimensions are the same, leading to a canvas that is the exact same size as the previous image. Going back to 2.3.9 works