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

Inline images for a blur placeholder #237

Open
markvital opened this issue Oct 19, 2024 · 2 comments
Open

Inline images for a blur placeholder #237

markvital opened this issue Oct 19, 2024 · 2 comments

Comments

@markvital
Copy link

markvital commented Oct 19, 2024

Hi there,

I was wondering if it’s possible to inline blur placeholders as Base64 data URLs to reduce load time?

In my current project, I display 50 images in a grid on each page. Loading 50 placeholder images via HTTP as separate files seems to create unnecessary overhead. It would be great if this plugin could support inlining these placeholders to improve performance. I couldn’t find an option for this feature in the existing implementation.

Here’s an example of the current behavior:
Screenshot 2024-10-18 at 6 26 52 PM

And here’s what I’d love to see:
Screenshot 2024-10-18 at 6 26 52 PM copy

Thanks for considering this feature request!

@markvital markvital changed the title Inline images for blur placeholder Inline images for a blur placeholder Oct 19, 2024
@Niels-IO
Copy link
Owner

Hi @markvital,

I thought about this feature a while ago, and I don't think it's possible in the way this library works currently. The library would need to modify all occurrences of ExportedImage and change the source code itself.

The only way I can think of is, that the library spits out a JSON file of the image file names as keys and the base64 placeholder images as values.

@markvital
Copy link
Author

Hi @Niels-IO,
Makes sense, thank you for the update.

Do you know any ready-made workarounds that I can use without switching to another library?

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

No branches or pull requests

2 participants