[shotwell] Properly handle Gdk fallback sniffer



commit 8a860f4e0942e22b589fa94359c804ec75080442
Author: Jens Georg <mail jensge org>
Date:   Wed Oct 23 21:51:45 2019 +0200

    Properly handle Gdk fallback sniffer

 src/photos/JfifSupport.vala | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/photos/JfifSupport.vala b/src/photos/JfifSupport.vala
index 2f33849f..c9b687d8 100644
--- a/src/photos/JfifSupport.vala
+++ b/src/photos/JfifSupport.vala
@@ -111,8 +111,13 @@ public class JfifSniffer : GdkSniffer {
                 return null;
             }
 
-            return base.sniff (out is_corrupted);
+            // Rely on GdkSniffer to detect corruption
 
+            DetectedPhotoInformation? detected = base.sniff(out is_corrupted);
+            if (detected == null)
+                return null;
+
+            return (detected.file_format == PhotoFileFormat.JFIF) ? detected : null;
         }
     }
 
@@ -168,8 +173,7 @@ public class JfifSniffer : GdkSniffer {
             is_corrupted = true;
         }
 
-        return (detected.file_format == PhotoFileFormat.JFIF) ? detected : null;
-
+        return detected;
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]