Skip to content

Optimisation for thumbnail #88

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

Merged
merged 2 commits into from
Mar 29, 2018
Merged

Optimisation for thumbnail #88

merged 2 commits into from
Mar 29, 2018

Conversation

bubbatls
Copy link
Contributor

There is no need to rebuild a data uri.
We can use URL.createObjectURL and a Blob.
It is faster, and further use of the URL will be too.

There is no need to rebuild a data uri.
We can use URL.createObjectURL and a Blob.
It is faster, and further use of the URL will be too.
@blueimp
Copy link
Owner

blueimp commented Mar 29, 2018

Thanks @bubbatls
Could you update your pull request so it passes the linter rules?

@bubbatls
Copy link
Contributor Author

Sorry, I've worked too fast and so... too dirty.
It's done

@blueimp
Copy link
Owner

blueimp commented Mar 29, 2018

Thanks again. :)

@blueimp blueimp merged commit 88de25f into blueimp:master Mar 29, 2018
@bubbatls
Copy link
Contributor Author

maybe the code for building data-uri might be used in loadImage.createObjectURL when it is detected it does not work properly

@blueimp
Copy link
Owner

blueimp commented Mar 29, 2018

Could you clarify what you meany by "it does not work properly"?

@bubbatls
Copy link
Contributor Author

The variable urlAPI might be undefined if it is not available or buggy (for opera 12 as I saw in comments)
And the data-uri might solve the issue, but maybe it is a bad idea to potentielly use it for something bigger than a thumbnail

@blueimp
Copy link
Owner

blueimp commented Mar 29, 2018

The EXIF code is only called in browsers that do support DataView.
Opera 12 is an edge case, but I don't think this browser is even supported anymore.
There's still Safari 6 (and potentially other browsers using webkitURL), but that is solved by using loadImage.createObjectURL.

@bubbatls
Copy link
Contributor Author

Thanks for the explanation,
And thanks for this project

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

Successfully merging this pull request may close these issues.

2 participants