thinksoftware / meteor-image-resize-client

Meteor - Client Side Image Resize
37 stars 9 forks source link

Unable to resize the image for non square image size #1

Open sparupat opened 9 years ago

sparupat commented 9 years ago

Hi,

The resize method always resizes the image to square image dimensions, although I provide non square dimensions.

e.g Resizer.resize(files[0], { width: 200, height: 600, cropSquare: false }, function(err, url) {});

aaronthorp commented 9 years ago

hmm, seems you are correct, i shall fix that and release an update shortly

sparupat commented 9 years ago

I used the below snippet to fix the resize issue

resizeCanvas.width = options.width; resizeCanvas.height = options.height; var resize_ctx = resizeCanvas.getContext("2d"); resize_ctx.drawImage(resize_img, 0, 0, options.width, options.height); var resize_dataUrl = resizeCanvas.toDataURL(fileData.type);

timbrandin commented 9 years ago

You should check out this PR if it solves this issue, it contains a refactor to more battle tested javascript library for image resizing in the client: JavaScript-Load-Image

timbrandin commented 9 years ago

Please try the latest version, this is probably solved now.

subatomicceo commented 8 years ago

I'm still experiencing this issue even after setting {cropSquare:false}. Thoughts?

egarza54 commented 7 years ago

Can this issue be resolved? I'm currently having trouble uploading non-square images