zhanziyang / vue-croppa

A simple straightforward customizable mobile-friendly image cropper for Vue 2.0.
https://zhanziyang.github.io/vue-croppa/
ISC License
967 stars 128 forks source link

Image size not same as container #216

Open SiliconMachine opened 5 years ago

SiliconMachine commented 5 years ago

I have this:

<croppa :placeholder="'Choose an image'" :placeholder-font-size="12" :placeholder-color="'black'" :width="280" :height="280" prevent-white-space v-model="myCroppa" :canvas-color="'transparent'" />

But when I store my image it saves with the double of the height/width although the container has the proper size.

There's something that I'm missing out?

RedShift1 commented 4 years ago

For some reason the canvas width and size is set to double if the width and height you supply to the component. Seems like a bug to me.

Demoskretos commented 4 years ago

Nah, this is just due to poor property naming and default value. The prop you're looking for is quality. By default it is set to 2 which doubles the output size of the image... Just set it to 1 and it should output the same size as the image.

ardeleandrei commented 1 year ago

I think this should be quality="1" by default to prevent confusion, I certainly wouldn't have expected it to double the output size of the image when I only need it to crop or reposition an image