Improved Async Image Loading and Decoding

  Рет қаралды 3,931

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 17
@GeorgeMonsour
@GeorgeMonsour 3 жыл бұрын
You own the 'nuance' corner of the internet!!
@morganbaker6894
@morganbaker6894 2 жыл бұрын
Mind...blown. Ok not quite, but still. Came across this attr randomly today after using wp_filter_content_tags() in WordPress and noticed it added decoding attr. A nice little gem here that I will try to exploit in builds. You explained it perfectly too as the MDN docs I saw just made me think 'isn't this just what lazy loading is doing?'.
@samsonmoses2601
@samsonmoses2601 2 жыл бұрын
Stumbled across this and it really helped me although I'm using blurhash I realized I can run an AJAX function that blurs and unblurs the image. Thanks Steve❤❤
@azox_sudo
@azox_sudo 3 жыл бұрын
i learned alot and that will help me to improve my code by ALOT ty you so much
@EvgenichTalagaev
@EvgenichTalagaev 3 жыл бұрын
Спасибо за видео!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
ничего.
@sreekar_s
@sreekar_s 3 жыл бұрын
How to do this if we were to use picture and source tags?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
Picture still needs an img tag as the element that displays the selected source. The img element handles it.
@sreekar_s
@sreekar_s 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 True! Let's say if I'm multiple source tags with their own srcsets'. Then I don't think we can follow this process as we don't know the image that will gets displayed by the browser in the end. Maybe I'm missing something. Thanks for your reply though ☺️
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
@@sreekar_s it doesn't matter how many sources you have in your html. The browser only asks for one of them.
@m01d25
@m01d25 9 ай бұрын
I was just wondering the same thing. Did you find a solution back then?
@midoone188
@midoone188 2 жыл бұрын
Amazing tutorial but i have a problem. When i refresh the page or scroll very fast to the images (lazy images) i got this Error (Uncaught (in promise) DOMException: The source image cannot be decoded. ) I wrapped the i.decode().then() with setTimeout() and increase the delay for every loop it‘s works fine but i think this is not the solution for this Error Have you any advice to solve this problem Thanks in advance
@mikebryan3270
@mikebryan3270 3 жыл бұрын
This is like skeleton loading for images. Nice deep dive into using lazy and async with javascript.
@daishokomiyama
@daishokomiyama 2 жыл бұрын
This is a hidden gem! Thank you
@ickebins55
@ickebins55 2 жыл бұрын
The attribute is decoding not decode.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
The attribute in the HTML is decoding. The method in the JS is decode.
@hardwired66
@hardwired66 3 жыл бұрын
cool ❤️
Stop Using Buttons as Links
7:10
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 7 М.
Do This to Improve Image Loading on Your Website
11:39
Mozilla Developer
Рет қаралды 50 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 22 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 50 МЛН
Important differences between textContent and innerText
11:44
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,5 М.
Ten Steps to Mastering the Fetch API
2:19:52
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 49 М.
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 349 М.
Secrets Hidden in Images (Steganography) - Computerphile
13:14
Computerphile
Рет қаралды 1,2 МЛН
These Mistakes Slow Down Your React App!
11:38
Lama Dev
Рет қаралды 42 М.
Revealing the Differences between HTML Dialogs and the Popover API
24:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 9 М.
Download Progress Monitoring with SVG Animation
32:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 1,6 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 326 М.
How To Load Images Like A Pro
15:48
Web Dev Simplified
Рет қаралды 387 М.
7 Design Patterns EVERY Developer Should Know
23:09
ForrestKnight
Рет қаралды 67 М.