Merge pull request #12 from lgaribaldi/rotate-tag

Add check for rotate tag
This commit is contained in:
Alex Eidt 2024-01-07 09:53:36 -08:00 committed by GitHub
commit cf92b10b6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,6 +168,9 @@ func (video *Video) addVideoData(data map[string]string) {
if height, ok := data["height"]; ok {
video.height = int(parse(height))
}
if rotation, ok := data["tag:rotate"]; ok && (rotation == "90" || rotation == "270") {
video.width, video.height = video.height, video.width
}
if duration, ok := data["duration"]; ok {
video.duration = float64(parse(duration))
}