Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传gif图片,为什么变成image/png类型了 #146

Closed
Alvazz opened this issue Dec 19, 2019 · 2 comments
Closed

上传gif图片,为什么变成image/png类型了 #146

Alvazz opened this issue Dec 19, 2019 · 2 comments

Comments

@Alvazz
Copy link

Alvazz commented Dec 19, 2019

<avatar-cropper
@uploading="handleUploading"
@uploaded="handleUploaded"
@completed="handleCompleted"
@error="handlerError"
trigger="#pick-avatar"
upload-url="https://test.abc.com/logoupload"
:output-mime="outmime"
:output-options="size"
:cropper-options="coption"
:upload-headers="{'X-CSRF-Token': csrf}"

this.outmime = 'image/gif'

@ferretwithaberet
Copy link
Collaborator

ferretwithaberet commented Jul 19, 2021

Cropper.js, which is a dependency of this project, does not support cropping gifs by default. There is cropperjs-gif though. Best case scenario, we will not package cropper.js with vue-avatar-cropper(I do not know why cropper.js is injected in the production code of vue-avatar-cropper, in my opinion it should be a dependency in the package.json) and instead, when you use the vue-avatar-cropper component, you will pass the instance of cropper.js as a prop, then the component will use the passed instance to crop images. This way the user will not have both cropper.js packages installed when he only really needs one.

Seems like cropperjs-gif is not a forked cropper.js with gif support, it crops gifs using cropper.js. So both cropper.js and cropperjs-gif need to be installed.

@ferretwithaberet
Copy link
Collaborator

I might add an optional dependency on cropperjs-gif for GIF support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants