[f-spot] Don't import completely unparseable files.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot] Don't import completely unparseable files.
- Date: Fri, 22 Oct 2010 16:08:36 +0000 (UTC)
commit 4a9f811d387a44a6392d76e3b7dc5579fe415731
Author: Ruben Vermeersch <ruben savanne be>
Date: Fri Oct 22 18:06:22 2010 +0200
Don't import completely unparseable files.
Makes sure we don't import garbled files or files with image extensions, which aren't actually images.
https://bugzilla.gnome.org/show_bug.cgi?id=632908
.../MainApp/FSpot.Import/ImportController.cs | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Clients/MainApp/FSpot.Import/ImportController.cs b/src/Clients/MainApp/FSpot.Import/ImportController.cs
index 6dd986c..db1b362 100644
--- a/src/Clients/MainApp/FSpot.Import/ImportController.cs
+++ b/src/Clients/MainApp/FSpot.Import/ImportController.cs
@@ -372,6 +372,10 @@ namespace FSpot.Import
void ImportPhoto (IPhoto item, Roll roll)
{
+ var metadata = Metadata.Parse (item.DefaultVersion.Uri);
+ if (metadata == null)
+ throw new Exception ("Failed to parse metadata, probably not a photo");
+
var destination = FindImportDestination (item);
// Do duplicate detection
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]