Unverified Commit 5000eac2 authored by Saturnino Abril's avatar Saturnino Abril Committed by GitHub

respect image orientation before saving height and width of FileInfo (#8710)

parent 14b65b99
......@@ -361,6 +361,14 @@ func (a *App) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string,
return nil, err
}
if orientation, err := getImageOrientation(bytes.NewReader(data)); err == nil &&
(orientation == RotatedCWMirrored ||
orientation == RotatedCCW ||
orientation == RotatedCCWMirrored ||
orientation == RotatedCW) {
info.Width, info.Height = info.Height, info.Width
}
info.Id = model.NewId()
info.CreatorId = userId
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment