diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-09-23 09:36:45 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-09-23 09:36:45 +0200 |
commit | 566dc060676b41e1e58a446b7dcc4159e242fee6 (patch) | |
tree | 6eaeba1cf78d3f03b8a1d5bfa998eb104ca47425 /src/photos/PngSupport.vala | |
parent | 4ea2cc3bd4a7d9b1c54a9d33e6a1cf82e7c8c21d (diff) |
Imported Upstream version 0.20.0upstream/0.20.0
Diffstat (limited to 'src/photos/PngSupport.vala')
-rw-r--r-- | src/photos/PngSupport.vala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/photos/PngSupport.vala b/src/photos/PngSupport.vala index ffc7faa..2cde6a2 100644 --- a/src/photos/PngSupport.vala +++ b/src/photos/PngSupport.vala @@ -69,14 +69,17 @@ public class PngSniffer : GdkSniffer { return true; } - public override DetectedPhotoInformation? sniff() throws Error { + public override DetectedPhotoInformation? sniff(out bool is_corrupted) throws Error { + // Rely on GdkSniffer to detect corruption + is_corrupted = false; + if (!is_png_file(file)) return null; - - DetectedPhotoInformation? detected = base.sniff(); + + DetectedPhotoInformation? detected = base.sniff(out is_corrupted); if (detected == null) return null; - + return (detected.file_format == PhotoFileFormat.PNG) ? detected : null; } } |