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

PNG data urls trigger an access denied error in IE 11 #526

Closed
stof opened this issue May 24, 2019 · 8 comments
Closed

PNG data urls trigger an access denied error in IE 11 #526

stof opened this issue May 24, 2019 · 8 comments
Labels

Comments

@stof
Copy link
Contributor

stof commented May 24, 2019

Describe the bug
When trying to crop a PNG image provided as a data-URL, IE 11 triggers an Access Denied error. JPEG is working fine.

Expected behavior
PNG works fine too.

Desktop:

  • OS: Windows
  • Browser: IE
  • Version: 11

Additional context

cropperjs/src/js/cropper.js

Lines 119 to 122 in 2df11cc

if (REGEXP_DATA_URL_JPEG.test(url)) {
this.read(dataURLToArrayBuffer(url));
return;
}
has some special handling for JPEG data URLs. Shouldn't the same be done for other data URLs ?

@stof stof changed the title PNG data urls trigger an access defied error in IE 11 PNG data urls trigger an access denied error in IE 11 May 27, 2019
@stof
Copy link
Contributor Author

stof commented Jun 6, 2019

why adding the "question" label ? This looks like a bug to me.

@fengyuanchen
Copy link
Owner

fengyuanchen commented Jun 23, 2019

In general, the cropper will continue to work after the error caused.

More details: https://github.com/fengyuanchen/cropperjs/blob/master/src/js/cropper.js#L130-L136

@stof
Copy link
Contributor Author

stof commented Jun 24, 2019

but why reading the data url directly for JPEG but not for PNG ?

@stof
Copy link
Contributor Author

stof commented Jun 24, 2019

oh, and in IE 11, this does not continue to work based on our experience.

@fengyuanchen
Copy link
Owner

Only a JPEG image includes the orientation Exif information.

@HaSangKyung
Copy link

HaSangKyung commented Jul 12, 2019

@stof
Hi, I think you should define polyfill for toBlob function.
Please try add this scripts on your page.

https://github.com/eligrey/canvas-toBlob.js/blob/master/canvas-toBlob.js

@stof
Copy link
Contributor Author

stof commented Jul 12, 2019

@fengyuanchen but then, why trying to do an AJAX request to load the metadata for PNG data-urls ? Any data-url could still be loaded directly

@fengyuanchen
Copy link
Owner

@stof You are right. I will improve this soon.

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

No branches or pull requests

3 participants