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

feat(imgix): format keys #364

Merged
merged 2 commits into from
Sep 5, 2021
Merged

feat(imgix): format keys #364

merged 2 commits into from
Sep 5, 2021

Conversation

shadow81627
Copy link
Contributor

resolves #363

@productdevbook
Copy link
Member

blurhash library used ? I couldn't see https://github.com/nuxt/image/blob/main/package.json

@shadow81627
Copy link
Contributor Author

shadow81627 commented Jul 9, 2021

@productfrontenddeveloper my understanding is that blurhash is a image format supported by imgix?
https://docs.imgix.com/apis/rendering/format/fm#blurhash

What is the library we need to include and what functionality does it provide?

@productdevbook
Copy link
Member

productdevbook commented Jul 9, 2021

imgix return blurhash -> 'eEC|aSROj=WAt:f-n#WXe-N4bJtRj]j[M{oNkXj[ozRjj^a$ayfl' and see loading etc with.

https://blog.imgix.com/2021/01/26/blurhash

https://blurha.sh/

https://github.com/woltapp/blurhash/tree/master/TypeScript

@shadow81627
Copy link
Contributor Author

@pi0 is it in scope for @nuxt/image to transform blurhash into placeholder images? https://github.com/woltapp/blurhash/tree/master/TypeScript

@pi0 pi0 merged commit ce66fa7 into nuxt:main Sep 5, 2021
@pi0
Copy link
Member

pi0 commented Sep 5, 2021

Thanks!

is it in scope for @nuxt/image to transform blurhash into placeholder images?

Nop. It happens on server side of imgix

@productdevbook
Copy link
Member

productdevbook commented Sep 6, 2021

Thanks!

is it in scope for @nuxt/image to transform blurhash into placeholder images?

Nop. It happens on server side of imgix

@pi0
https://docs.imgix.com/apis/rendering/format/fm#blurhash

It only freezes a key on the imgix side, you need to use it inside. so when we add this, the picture does not come back.

When uploading a picture, you need to first take it and show it. You can show the image when the image is finished uploading.

CleanShot 2021-09-06 at 07 11 10

@pi0
Copy link
Member

pi0 commented Sep 6, 2021

You are correct @productfrontenddeveloper. We still need placeholder support (#189) for loading strategy. Normally for providers not supporting blurhash, we use a pixel resized version of image but can also support native server blur ike this.

Meanwhile this format can be useful for cases a static blurry version is desired like a banner background image.

@Rigo-m
Copy link

Rigo-m commented Oct 13, 2021

What I did in userland is this:

  1. Fetched with $http the imgix blurhash hash
  2. Rendered the blurhash as a Base64 (using node-canvas if in SSR, using native canvas if in frontend)
  3. Placed Base64 as a background in a div
  4. Hid blurhash if image has already been loaded (image.complete attribute) or on @load event

It works well imho, should I try to implement it in nuxt-img? Any caveats/ideas on it?

procrates pushed a commit to procrates/nuxt-image that referenced this pull request Feb 21, 2023
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.

feat: imgix Blurhash support
4 participants