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

Unable to decode Exif metadata from image in Hugo 0.88 #8996

Closed
hvfrancesco opened this issue Sep 26, 2021 · 9 comments
Closed

Unable to decode Exif metadata from image in Hugo 0.88 #8996

hvfrancesco opened this issue Sep 26, 2021 · 9 comments
Assignees
Milestone

Comments

@hvfrancesco
Copy link

hugo version: hugo v0.88.1-5BC54738 linux/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio

Trying to read EXIF data from jpeg images I get similar warnings:
WARN 2021/09/26 13:16:45 Unable to decode Exif metadata from image: /images/2021_01_30/fulls/DSCF2441.jpg

The Images are accesible as resources and are correctly retrieved and used. An example code snippet that I'm trying to use:

{{ range (readDir ( print "assets/" .cartella "fulls") )  }} 
    {{ $title := ""}}
    {{ $content := ""}}
    {{ $image :=  resources.Get (print $path "fulls/" .Name) }}
    {{ $thumb :=  resources.Get (print $path "thumbs/" .Name) }}
    {{ with $image.Exif }}<li>{{ .Date}}</li>{{ end }}
    {{ $button := "guarda"}}
    {{ partial "picture" (dict "title" $title "content" $content "image" $image.Permalink "thumb" $thumb.Permalink "button" $button) }}
 {{ end }}

The images are Jpeg images taken with a Fujifilm camera and processed in Darktable. The exif data is perfectly readable using any othere tool or library I've tried and is apparently well formed according to standards.

@hvfrancesco
Copy link
Author

Here is an example image in case it could be of any use

DSCF7782

@swartz-k
Copy link

This error caused by exif.NewDecoder -> exifDecoder.Decode(image) -> _exif.Decode(r) -> /Users/jok1r/go/pkg/mod/github.com/rwcarlsen/goexif@v0.0.0-20190401172101-9e8deecbddbd/exif/exif.go:283 -> /Users/jok1r/go/pkg/mod/github.com/rwcarlsen/goexif@v0.0.0-20190401172101-9e8deecbddbd/tiff/tiff.go:84 -> /Users/jok1r/go/pkg/mod/github.com/rwcarlsen/goexif@v0.0.0-20190401172101-9e8deecbddbd/tiff/tiff.go:131

As below code t.Count is 0.

func DecodeTag(r ReadAtReader, order binary.ByteOrder) (*Tag, error) {
	....
        err = binary.Read(r, order, &t.Count)
	if err != nil {
		return nil, errors.New("tiff: tag component count read failed: " + err.Error())
	}

	// There seems to be a relatively common corrupt tag which has a Count of
	// MaxUint32. This is probably not a valid value, so return early.
	if t.Count == 1<<32-1 {
		return t, errors.New("invalid Count offset in tag")
	}

	valLen := typeSize[t.Type] * t.Count
	if valLen == 0 {
		return t, errors.New("zero length tag value")
	}
        ....
}

@swartz-k
Copy link

Maybe should change a exif lib. I use this one go-exif is ok

changed with https://github.com/dsoprea/go-exif/blob/master/exif-read-tool/main.go

image

@jmooring
Copy link
Member

See #8586 and #8761.

@swartz-k
Copy link

See #8586 and #8761.

Hope this PR will be merged soon.

@jmooring
Copy link
Member

@swartz-k #8761 is blocked by dsoprea/go-exif#63.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2022
@bep bep reopened this Aug 10, 2023
@bep
Copy link
Member

bep commented Aug 10, 2023

@bep bep added this to the v0.130.0 milestone Jul 9, 2024
@bep bep self-assigned this Jul 9, 2024
@bep bep modified the milestones: v0.130.0, v0.129.0 Jul 9, 2024
bep added a commit to bep/hugo that referenced this issue Jul 9, 2024
bep added a commit to bep/hugo that referenced this issue Jul 10, 2024
bep added a commit to bep/hugo that referenced this issue Jul 12, 2024
bep added a commit to bep/hugo that referenced this issue Jul 12, 2024
bep added a commit to bep/hugo that referenced this issue Jul 12, 2024
bep added a commit to bep/hugo that referenced this issue Jul 14, 2024
bep added a commit to bep/hugo that referenced this issue Jul 18, 2024
bep added a commit to bep/hugo that referenced this issue Jul 19, 2024
bep added a commit to bep/hugo that referenced this issue Jul 19, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
bep added a commit to bep/hugo that referenced this issue Jul 20, 2024
@bep bep closed this as completed in 72ff937 Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants