posts: fix detection of exif_rotation tag.
`IFD0:Orientation` is the orientation of the main image. `IFD1:Orientation` is the orientation of the embedded thumbnail, if it has one. Using `IFD1:Orientation` was incorrect here because some images have a non-rotated main image but a rotated thumbnail. Post #1023563 is an example.
This commit is contained in:
@@ -49,8 +49,7 @@ class MediaAsset < ApplicationRecord
|
||||
|
||||
# https://exiftool.org/TagNames/EXIF.html
|
||||
def is_rotated?
|
||||
metadata["IFD0:Orientation"].in?(["Rotate 90 CW", "Rotate 270 CW", "Rotate 180"]) ||
|
||||
metadata["IFD1:Orientation"].in?(["Rotate 90 CW", "Rotate 270 CW", "Rotate 180"])
|
||||
metadata["IFD0:Orientation"].in?(["Rotate 90 CW", "Rotate 270 CW", "Rotate 180"])
|
||||
end
|
||||
|
||||
# Some animations technically have a finite loop count, but loop for hundreds
|
||||
|
||||
Reference in New Issue
Block a user