-
-
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
New EXIF library returns an image orientation that doesn't pass (eq $o 6) #12733
Comments
I think you can work around this by:
A note mostly to myself here:
It's tempting to just change the EXIF types to |
Works in 0.131, and I haven't tested it in versions prior to 0.130 yet, but I suspect that works there as well. My hosting provider that runs hugo doesn't let me control when hugo is upgraded, so I need to support the older hugo version till they upgrade with my templates, but like to test with the newest version so I can see what changes I'll need in the future. I agree that the proper fix is to fix the comparisons so that eq int16(6) 6 is true for the appropriate operators and types. |
The above should work with "all" Hugo versions (including future).
I have checked, and the failing case was |
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. |
I have the following fragment in a render-image.html file to set aspect ratios on images. This works in hugo prior to the new EXIF library.
The warnings print out the orientation properly in 0.131, but the eq $o 6 test fails and so the aspect ratio on my image is wrong. Here are some example warnings where it doesn't flip an image.
In hugo 0.131 I have to use the following to get it to work. It looks like the type returned by .Orientation isn't the same type as before and now fails the eq test. Converting to a string with printf and comparing strings works in 0.131 and newer.
These are the example warnings from this changed code that properly flips the aspect ratio:
What I want is for the same template to work in both systems. Either document the changes I need to make to my templates to support both types (preferably in the release that breaks it). Or fix the new library to return types that are compatible with my existing template.
The text was updated successfully, but these errors were encountered: