Browse Source

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.
reviewable/pr6160/r2
Anthony Bilinski 5 years ago
parent
commit
9da1e3bbdf
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 5
      src/model/exiftransform.cpp

5
src/model/exiftransform.cpp

@ -45,6 +45,11 @@ namespace ExifTransform
exif_data_free(exifData); exif_data_free(exifData);
switch (orientation){ 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: case 1:
return Orientation::TopLeft; return Orientation::TopLeft;
case 2: case 2:

Loading…
Cancel
Save