hengebytes/ibexa-blurhash

Symfony 扩展,用于在 Ibexa CMS 中生成图片模糊哈希

安装: 69

依赖项: 0

建议者: 0

安全: 0

星级: 1

关注者: 1

分支: 0

公开问题: 0

类型:symfony-bundle

v1.0.2 2023-11-03 10:23 UTC

This package is not auto-updated.

Last update: 2024-09-21 03:26:06 UTC


README

composer require hengebytes/ibexa-blurhash

(可选) 配置图片转换

# config/packages/ibexa_blurhash.yaml
parameters:
    # uploaded image resized to 75x75 before encoding
    ibexa_blurhash.encode.resize_original_width: 75
    ibexa_blurhash.encode.resize_original_height: 75
    # blurhash generated with 4x3 component, x and y component counts must be between 1 and 9 inclusive.
    ibexa_blurhash.encode.blurhash_x_count: 4
    ibexa_blurhash.encode.blurhash_y_count: 3

在 GraphQL 中查询模糊哈希数据。

query {
  media {
    image(contentId: 19) {
      image {
        uri
        additionalData {
          blurhash
        }
      }
    }
  }
}

在浏览器中解码

注意

由于模糊哈希是在图片上传时生成的,所以只有在此捆绑包安装后上传的图片才能使用。

致谢