-
Notifications
You must be signed in to change notification settings - Fork 562
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
fix: switch lazy loading images to eager #359
Conversation
Codecov ReportBase: 63.24% // Head: 63.24% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #359 +/- ##
=======================================
Coverage 63.24% 63.24%
=======================================
Files 10 10
Lines 555 555
Branches 129 129
=======================================
Hits 351 351
Misses 146 146
Partials 58 58
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
## [1.11.5](v1.11.4...v1.11.5) (2023-01-30) ### Bug Fixes * **cloneCSSStyle:** rounded values of d attr fix ([#358](#358)) ([6d28bdb](6d28bdb)), closes [#357](#357) * include source in npm package ([#316](#316)) ([b609415](b609415)) * switch lazy loading images to eager ([#359](#359)) ([f7c311b](f7c311b))
🎉 This PR is included in version 1.11.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [1.11.5](bubkoo/html-to-image@v1.11.4...v1.11.5) (2023-01-30) ### Bug Fixes * **cloneCSSStyle:** rounded values of d attr fix ([bubkoo#358](bubkoo#358)) ([6d28bdb](bubkoo@6d28bdb)), closes [bubkoo#357](bubkoo#357) * include source in npm package ([bubkoo#316](bubkoo#316)) ([b609415](bubkoo@b609415)) * switch lazy loading images to eager ([bubkoo#359](bubkoo#359)) ([f7c311b](bubkoo@f7c311b))
## [1.11.5](bubkoo/html-to-image@v1.11.4...v1.11.5) (2023-01-30) ### Bug Fixes * **cloneCSSStyle:** rounded values of d attr fix ([bubkoo#358](bubkoo#358)) ([6d28bdb](bubkoo@6d28bdb)), closes [bubkoo#357](bubkoo#357) * include source in npm package ([bubkoo#316](bubkoo#316)) ([b609415](bubkoo@b609415)) * switch lazy loading images to eager ([bubkoo#359](bubkoo#359)) ([f7c311b](bubkoo@f7c311b))
## [1.11.5](bubkoo/html-to-image@v1.11.4...v1.11.5) (2023-01-30) ### Bug Fixes * **cloneCSSStyle:** rounded values of d attr fix ([bubkoo#358](bubkoo#358)) ([6d28bdb](bubkoo@6d28bdb)), closes [bubkoo#357](bubkoo#357) * include source in npm package ([bubkoo#316](bubkoo#316)) ([b609415](bubkoo@b609415)) * switch lazy loading images to eager ([bubkoo#359](bubkoo#359)) ([f7c311b](bubkoo@f7c311b))
## [1.11.5](bubkoo/html-to-image@v1.11.4...v1.11.5) (2023-01-30) ### Bug Fixes * **cloneCSSStyle:** rounded values of d attr fix ([bubkoo#358](bubkoo#358)) ([6d28bdb](bubkoo@6d28bdb)), closes [bubkoo#357](bubkoo#357) * include source in npm package ([bubkoo#316](bubkoo#316)) ([b609415](bubkoo@b609415)) * switch lazy loading images to eager ([bubkoo#359](bubkoo#359)) ([f7c311b](bubkoo@f7c311b))
## [1.11.5](bubkoo/html-to-image@v1.11.4...v1.11.5) (2023-01-30) ### Bug Fixes * **cloneCSSStyle:** rounded values of d attr fix ([bubkoo#358](bubkoo#358)) ([6d28bdb](bubkoo@6d28bdb)), closes [bubkoo#357](bubkoo#357) * include source in npm package ([bubkoo#316](bubkoo#316)) ([b609415](bubkoo@b609415)) * switch lazy loading images to eager ([bubkoo#359](bubkoo#359)) ([f7c311b](bubkoo@f7c311b))
I noticed an issue with my images not loading. I traced it to neither
onload
oronerror
firing during theembedImageNode
step, which I was able to fix by changing theloading
(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading) attribute toeager
instead oflazy
as my images are.Description
Add a condition during
embedImageNode
that changes lazy loading images to eager to ensure (ideally) that onload/onerror fires.Motivation and Context
This problem occurs at least for me when I have an
img
which hasloading
(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading) set tolazy
. Changing this toeager
stops the problem, so I've made this adjustment occur during cloning as we would not want to lazy loading images when we are trying to clone them and are waiting for them to finish decoding/loading.Types of changes
Self Check before Merge