1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(preview): Don't log a warning on missing exif orientation metadata

libexif returns 0 for the orientation when orientation metadata isn't present.
Treat this the same as 1, i.e. no orientation change.
This commit is contained in:
Anthony Bilinski 2020-05-27 02:34:37 -07:00
parent 10d0cae80c
commit 9da1e3bbdf
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -45,6 +45,11 @@ namespace ExifTransform
exif_data_free(exifData);
switch (orientation){
case 0:
// Exif spec defines 1-8 only, but when the orientation field isn't explcitly defined, we read 0 from
// libexif. It seems like exif_data_get_entry should return null in that case rather than saying the entry
// is present but with a value of zero.
return Orientation::TopLeft;
case 1:
return Orientation::TopLeft;
case 2: