vue-croppa icon indicating copy to clipboard operation
vue-croppa copied to clipboard

auto-sizing and fixed output width.

Open seanhak opened this issue 7 years ago • 5 comments

Is it possible to change output image size? For example, I always want a 1000x1000 square image saved to the server, but I want to make it responsive as well on the clientside (with correct aspect ratio of course).

generateBlob always seems to return exactly what the canvas size is (* quality)?

Thank you.

seanhak avatar Jul 06 '18 12:07 seanhak

For now you can only do this by changing quality accordingly. I will improve this but don't know when...

zhanziyang avatar Jul 07 '18 08:07 zhanziyang

Cool! Really like this component, usefully and easy to use - Thanks! So if I try out changing quality dynamically that might be work!

I was messing around with getMetaData and trying to recreate the crop on server & a new html canvas but didn't get very far...

So target width ÷ canvas width = quality, and I can have a computed method that changes quality dynamically based on authorize width.

seanhak avatar Jul 08 '18 23:07 seanhak

Problem with using the quality prop is for instance picking a "cover image" as use case, think of facebook, twitter, linkedin, you need something with large width but usually small or fixed height, quality stays short here. @zhanziyang thoughts on how to approach this use case?

twbagustin avatar Oct 01 '18 22:10 twbagustin

@AguD I can tell you how I solved it, no autosize. Fixed width and height (quality=1). Then did all scaling of canvas using CSS (and JS as IE fallback).

seanhak avatar Oct 02 '18 15:10 seanhak

@seanhak Can you please share if you figured it out? :)

ugurarici avatar Jun 24 '19 14:06 ugurarici