Thanks to visit codestin.com
Credit goes to github.com

Skip to content

reflect.IsImageResourceWithMeta returns true for BMP and GIF #14568

@jmooring

Description

@jmooring

structure:

assets/
├── image.avif
├── image.bmp
├── image.gif
├── image.heic
├── image.heif
├── image.jpg
├── image.png
├── image.svg
├── image.tiff
└── image.webp

template:

{{ range resources.Match "**" }}
  {{ printf "Name: %s, IsImageResourceWithMeta: %t" .Name (reflect.IsImageResourceWithMeta .) }}
{{ end }}

output:

Name: /image.webp, IsImageResourceWithMeta: true
Name: /image.tiff, IsImageResourceWithMeta: true
Name: /image.svg, IsImageResourceWithMeta: false
Name: /image.png, IsImageResourceWithMeta: true
Name: /image.jpg, IsImageResourceWithMeta: true
Name: /image.heif, IsImageResourceWithMeta: true
Name: /image.heic, IsImageResourceWithMeta: true
Name: /image.gif, IsImageResourceWithMeta: true   ** unexpected **
Name: /image.bmp, IsImageResourceWithMeta: true   ** unexpected **
Name: /image.avif, IsImageResourceWithMeta: true

I used exiftool to verify that the image types match their extension.

My "thick finger" testing yesterday did not test these two image formats.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions