question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a low-quality-placeholder directive

See original GitHub issue

This has been a requested feature and one that I’d argue is a wothwhile addition to the library. I’m not quite sure on the specific syntax though and would like to get some feedback!

My proposal would be:

  • Keyword: lqip
  • Type: boolean

Where lqip invokes the following steps:

  1. resize to a width of 640px
  2. set quality to 50

The question is wether these values should be customizeable on if so how? An integer that scales the values accordingly? I don’t want this directive to do too much since stuff like blurring can and should be added by the user to their liking.

_Originally posted by @rchrdnsh in https://github.com/JonasKruckenberg/imagetools/discussions/69_

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:6

github_iconTop GitHub Comments

3reactions
cryptodealcommented, May 13, 2021

I agree on blurring, that should be handled by the user to fit their desired aesthetic.

I do think both the size and quality should be customizable to an extent (I like the idea of using an integer that scales the values accordingly), but I don’t think there’s really a need for fine grained controls given lqip would be, ultimately, for the sake of convenience.

If a user needs the ability to highly customize the placeholder image, they should import the placeholder using the provided directives as that’s going to give the most granular control in terms of the resulting image.

E.g. I currently import placeholder images, which is passed into a lazy loading responsive image component (along w the srcset imported separately), by doing the following:

import logo from './logo.jpg?w=300&blur=100&quality=30';

Edit: Great work on this library by the way; love using it in with SvelteKit.

2reactions
bdlowerycommented, Apr 29, 2022

Is this an official feature now? It looks like it was added as a directive by @JonasKruckenberg. Not mentioned in the Docs however.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vanilla-lazyload | Yarn - Package Manager
To have a low quality placeholder, add the src attribute pointing to a very small version of the image. E.g. src="lazy_10.jpg" .
Read more >
vanilla-lazyload - npm
To have a low quality placeholder, add the src attribute pointing to a very small version of the image to the img tag....
Read more >
Lazy loading images with accessibility and printer support
No wasted image bytes. This solution calculates the actual size of the image to be requested. So instead of adding breakpoints in something...
Read more >
Image Editable - Pimcore
Name Type Description width integer Width of the image in pixel height integer Height of the image in pixel hidetext boolean Hides the input for the...
Read more >
Add alternative text to a shape, picture, chart, SmartArt graphic ...
Create alternative text for pictures, charts, or SmartArt graphics so that it can be used by accessibility screen readers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found