[f-spot] Detect and ignore empty files.



commit c4b8bb00686e052c9e025cbc1efb200910aa673a
Author: Ruben Vermeersch <ruben savanne be>
Date:   Thu Jul 22 15:20:40 2010 +0200

    Detect and ignore empty files.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=624933

 src/Imaging/ImageFile.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/Imaging/ImageFile.cs b/src/Imaging/ImageFile.cs
index 013d697..9394c6d 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Imaging/ImageFile.cs
@@ -105,8 +105,14 @@ namespace FSpot.Imaging {
             }
 
             // Detect mime-type
-            var info = file.QueryInfo ("standard::content-type", FileQueryInfoFlags.None, null);
+            var info = file.QueryInfo ("standard::content-type,standard::size", FileQueryInfoFlags.None, null);
             var mime = info.ContentType;
+            var size = info.Size;
+
+            if (size == 0) {
+                // Empty file
+                return null;
+            }
 
             Type t = null;
 



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