-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
error calling Exif: metadata init failed: json: unsupported value: NaN
#12490
Comments
error calling Ex if: metadata init failed: json: unsupported value: NaN
error calling Exif: metadata init failed: json: unsupported value: NaN
Can you share the original image? |
when i move this image out of the way, it still fails on another. it seems like some images work, but quite a few fail. |
There appears to be something wrong with the GPSInfo:
This fixes it...
... but removing GPSLongitude fixes it as well, so maybe exiftool cleans up the whole GPSInfo block when updating any of its tags. Other than updating the image, I don't know of a way around this in Hugo. |
Correction: if you're willing to live without GPS data on all of your photos, you can do this in your site configuration:
|
I've tested this, and we can fix by changing this: hugo/resources/images/exif/exif.go Lines 141 to 143 in ee26e69
To this: if !d.noLatLong {
lat, long, _ = x.LatLong()
if math.IsNaN(lat) {
lat = 0
}
if math.IsNaN(long) {
long = 0
}
} It seems like setting the values to 0 is better than throwing an error that you can't work around unless you disable lat/long site wide. Reproducible example:
|
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. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
i'm not sure, but seems likely given #8996 and #8586
description
this template results in failure on some images. it's difficult to determine which images are failing because
i was able to determine the specific image this is failing on and the data looks fine using the
exif
command line tool. all photos were all taken using Google Camera on a Pixel 6 phone.is there a way to detect or somehow "catch" this error in my templates? it's fine if the data is blank for some images.
The text was updated successfully, but these errors were encountered: