Expose the blurhash url in jsonapi response

Created on 25 September 2024, about 2 months ago

Problem/Motivation

Hi 👋
Could be cool to expose a URL to the blurhash as well in the JSON:API response. Any thoughts? :)

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇰Denmark blymemikkel Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @blymemikkel
  • 🇳🇴Norway efpapado

    Hello, not sure what you mean. The blurhash is just a string, if you enable the blurhash_image_style_metadata submodule, when the metadata are generated, the blurhash string is stored in the database (on the entity's table) and it gets exposed in JSON:API as the other fields.

    Or maybe you mean something else that I didn't get? :)

  • 🇩🇰Denmark blymemikkel Copenhagen

    Sorry for being unclear and it might be a non-issue and just me not understanding the concept correctly :)

    Yes, the blurhash is exposed like LEHV6nWB2yk8pyo0adR*.7kCMdnj. What I mean is that we still need to do some sort of transformation in the frontend as the above blurhash string isn't a valid image. Would it be possible for Drupal to generate the image and then expose it with something like https://example.com/sites/default/files/public/2024-11/filename.png? Do you have any examples on how to build the blurhash image I can see?

    Thank you!

Production build 0.71.5 2024