Open choiRyan opened 7 years ago
This is a bug. And we do not support crop and resize image together. And do you have any good suggestion? And this bug will be fixed soon.
Thanks for the quick response!
I think existing implementations of resize+crop have both going on at once. For some [jQuery] examples, here's Cropper, Cropbox, and a tutorial I found. I don't know how this plays with max-width
and max-height
in their current states. Maybe the image could be resized accordingly after crop/resizing, if the new image's dimensions exceed those values.
Some questions related to crop/resizing (on client):
imagechanged
event when selecting an image with crop="local"
with is-xhr=false
max-file-size
is set, shouldn't this check occur after resizing/cropping? Assuming a max-file-size
of 3MB, someone could select a 6MB image, then crop/resize it client-side to <3MB, which would be OK to upload. (Or notify the user that the cropped/resized image is too large)Thanks a lot 😀. I think the max-width allow you to limit your image size if you crop one. For example when you crop an image but the crop area's width may be 800px and if you set max-width=500, finally the image's width should be 500px.
Unluckily ðŸ˜, Gif doesn't support the crop.
when you use imagechanged
event props, you could receive a param function the function when you bind. And the param is an object which is an array of files object. And then you can get the data and show the image. You can view the example code here: http://jsfiddle.net/yjgcc6v8/3/
In fact, PNG compress algorithm is complex via canvas, but it should be a bug. I'll fix it together.
I agree with you about the support of resizing and cropping an image together.
My English is not good If you want to talk more you can add me Facebook Messager here: http://vanthink-ued.github.io/vue-core-image-upload/index.html#/en/others
Oh if that's how max-width
works that's great, I can make do with that and imagechanged
, then, but does the imagechanged
event get sent if is-xhr="false"
? When using is-xhr="false"
, only the imageuploading
event is sent.
Yeah, working with gifs is rather hard... No worries there.
Thanks for all the work :)
Is it possible to resize and crop on the same image?
I can see how it might get awkward (Both at once? resize then crop? Or crop then resize?)
Currently, when I use both options (Chrome 58, Mac) I can resize the image, but two rows of OK/Cancel buttons are visible (shown below). The view closes when I press either OK button.
Also there's a console.log in resize-bar.vue:95 in the latest release :)