From 566dc060676b41e1e58a446b7dcc4159e242fee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 23 Sep 2014 09:36:45 +0200 Subject: Imported Upstream version 0.20.0 --- src/photos/GdkSupport.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/photos/GdkSupport.vala') diff --git a/src/photos/GdkSupport.vala b/src/photos/GdkSupport.vala index 4ca0893..ed2ff63 100644 --- a/src/photos/GdkSupport.vala +++ b/src/photos/GdkSupport.vala @@ -34,7 +34,7 @@ public abstract class GdkSniffer : PhotoFileSniffer { base (file, options); } - public override DetectedPhotoInformation? sniff() throws Error { + public override DetectedPhotoInformation? sniff(out bool is_corrupted) throws Error { detected = new DetectedPhotoInformation(); Gdk.PixbufLoader pixbuf_loader = new Gdk.PixbufLoader(); @@ -53,7 +53,7 @@ public abstract class GdkSniffer : PhotoFileSniffer { // no metadata detected detected.metadata = null; } - + if (calc_md5 && detected.metadata != null) { uint8[]? flattened_sans_thumbnail = detected.metadata.flatten_exif(false); if (flattened_sans_thumbnail != null && flattened_sans_thumbnail.length > 0) @@ -102,6 +102,9 @@ public abstract class GdkSniffer : PhotoFileSniffer { if (calc_md5) detected.md5 = md5_checksum.get_string(); + // if size and area are not ready, treat as corrupted file (entire file was read) + is_corrupted = !size_ready || !area_prepared; + return detected; } -- cgit v1.2.3