Index: PhotoStore.cs
===================================================================
--- PhotoStore.cs	(revision 3601)
+++ PhotoStore.cs	(working copy)
@@ -832,8 +832,34 @@
 		}
 		return photo;
 	}
+	
+	public Photo Create (System.Uri new_uri, System.Uri orig_uri, uint roll_id)
+	{
+		Photo photo;
+		using (FSpot.ImageFile img = FSpot.ImageFile.Create (orig_uri)) {
+			long unix_time = DbUtils.UnixTimeFromDateTime (img.Date);
+			string description = img.Description != null  ? img.Description.Split ('\0') [0] : String.Empty;
+	
+	 		uint id = (uint) Database.Execute (new DbCommand (
+				"INSERT INTO photos (time, uri, description, roll_id, default_version_id, rating) "	+
+	 			"VALUES (:time, :uri, :description, :roll_id, :default_version_id, :rating)",
+	 			"time", unix_time,
+				"uri", new_uri.ToString (),
+	 			"description", description,
+				"roll_id", roll_id,
+	 			"default_version_id", Photo.OriginalVersionId,
+	 			"rating", null));
+	
+			photo = new Photo (id, unix_time, new_uri);
+			AddToCache (photo);
+			photo.Loaded = true;
+	
+			EmitAdded (photo);
+		}
+		return photo;
+	}
+	
 
-
 	private void GetVersions (Photo photo)
 	{
 		SqliteDataReader reader = Database.Query(new DbCommand("SELECT version_id, name, uri, protected FROM photo_versions WHERE photo_id = :id", "id", photo.Id));
Index: FileImportBackend.cs
===================================================================
--- FileImportBackend.cs	(revision 3601)
+++ FileImportBackend.cs	(working copy)
@@ -198,10 +198,8 @@
 		return dest;
 	}
 
-	public override bool Step (out Photo photo, out Pixbuf thumbnail, out int count)
+	public override bool Step (out Photo photo, out int count)
 	{
-		thumbnail = null;
-
 		if (import_info == null)
 			throw new ImportException ("Prepare() was not called");
 
@@ -220,12 +218,12 @@
 			// Don't copy if we are already home
 			if (info.OriginalPath == destination) {
 				info.DestinationPath = destination;
-				photo = store.Create (info.DestinationPath, roll.Id, out thumbnail);
+				photo = store.Create (UriList.PathToFileUri (info.DestinationPath), UriList.PathToFileUri (info.DestinationPath), roll.Id);
 			} else {
 				System.IO.File.Copy (info.OriginalPath, destination);
 				info.DestinationPath = destination;
 
-				photo = store.Create (info.DestinationPath, info.OriginalPath, roll.Id, out thumbnail);
+				photo = store.Create (UriList.PathToFileUri (info.DestinationPath), UriList.PathToFileUri (info.OriginalPath), roll.Id);
 
 				try {
 					File.SetAttributes (destination, File.GetAttributes (info.DestinationPath) & ~FileAttributes.ReadOnly);
@@ -253,10 +251,7 @@
 			info.Photo = photo;
 		} catch (System.Exception e) {
 			System.Console.WriteLine ("Error importing {0}{2}{1}", info.OriginalPath, e.ToString (), Environment.NewLine);
-			if (thumbnail != null)
-				thumbnail.Dispose ();
 
-			thumbnail = null;
 			photo = null;
 
 			HigMessageDialog errordialog = new HigMessageDialog (parent,
Index: ImportCommand.cs
===================================================================
--- ImportCommand.cs	(revision 3601)
+++ ImportCommand.cs	(working copy)
@@ -433,7 +433,6 @@
 	private bool Step ()
 	{			
 		Photo photo;
-		Pixbuf thumbnail;
 		int count;
 		bool ongoing = true;
 
@@ -443,25 +442,19 @@
 		try {
 			// FIXME this is really just an incredibly ugly way of dealing
 			// with the recursive DoImport loops we sometimes get into
-			ongoing = importer.Step (out photo, out thumbnail, out count);
+			ongoing = importer.Step (out photo, out count);
 		} catch (ImportException e){
 			System.Console.WriteLine (e);
 			return false;
 		}
 
-		if (photo == null || thumbnail == null) {
+		if (photo == null) {
 			Console.WriteLine ("Could not import file");
 		} else {
 			//icon_scrolled.Visible = true;
 			collection.Add (photo);
-		
-			//grid.AddThumbnail (thumbnail);
-
 		}
 
-		if (thumbnail != null)
-			thumbnail.Dispose ();
-		
 		if (count < total)
 			UpdateProgressBar (count + 1, total);
 
Index: ImportBackend.cs
===================================================================
--- ImportBackend.cs	(revision 3601)
+++ ImportBackend.cs	(working copy)
@@ -6,7 +6,8 @@
 	public abstract int Prepare ();
 
 	// Import one picture.  Returns false when done; then you have to call Finish().
-	public abstract bool Step (out Photo photo, out Pixbuf thumbnail, out int count);
+	//public abstract bool Step (out Photo photo, out Pixbuf thumbnail, out int count);
+	public abstract bool Step (out Photo photo, out int count);
 
 	// Cancel importing.
 	public abstract void Cancel ();
Index: Imaging/JpegFile.cs
===================================================================
--- Imaging/JpegFile.cs	(revision 3601)
+++ Imaging/JpegFile.cs	(working copy)
@@ -69,7 +69,13 @@
 
 		public override string Description {
 			get {
+				if (ExifHeader == null)
+					return "";
+					
 #if USE_TIFF
+				if (ExifHeader.Directory == null)
+					return "";
+
 				try {
 					SubdirectoryEntry sub = (SubdirectoryEntry) ExifHeader.Directory.Lookup (TagId.ExifIfdPointer);
 					if (sub != null) {
@@ -78,7 +84,7 @@
 							return entry.ValueAsString [0];
 					}
 				} catch (System.Exception e) {
-					Console.WriteLine (e);
+					Console.WriteLine ("Error while reading Description (TIFF){1}{0}", e.ToString(), Environment.NewLine);
 				}
 				return null;
 #else
@@ -93,6 +99,7 @@
 					return comment.Value;
 				} catch (Exception e) {
 					// errors here shouldn't be fatal
+					Console.WriteLine ("Error while reading Description{1}{0}", e.ToString(), Environment.NewLine);
 					return null;
 				}
 #endif				
@@ -266,7 +273,12 @@
 		public override PixbufOrientation GetOrientation () 
 		{
 			PixbufOrientation orientation = PixbufOrientation.TopLeft;
+			if (ExifHeader == null)
+				return orientation;
 #if USE_TIFF
+			if (ExifHeader.Directory == null)
+				return orientation;
+
 			try {
 				DirectoryEntry e = ExifHeader.Directory.Lookup (TagId.Orientation);
 				orientation = (PixbufOrientation)e.ValueAsLong [0];
@@ -312,23 +324,29 @@
 
 		public override System.DateTime Date {
 			get {
+				if (ExifHeader == null)
+					return base.Date;
+
 				System.DateTime time;
 				try {
 #if USE_TIFF
+					if (ExifHeader.Directory == null)
+						return base.Date;
+						
 					SubdirectoryEntry sub = (SubdirectoryEntry) ExifHeader.Directory.Lookup (TagId.ExifIfdPointer);
-					DirectoryEntry e;
+					DirectoryEntry Entry;
 					
 					if (sub != null) {
-						e = sub.Directory [0].Lookup (TagId.DateTimeOriginal);
+						Entry = sub.Directory [0].Lookup (TagId.DateTimeOriginal);
 						
-						if (e != null)
-							return DirectoryEntry.DateTimeFromString (e.StringValue).ToUniversalTime ();
+						if (Entry != null)
+							return DirectoryEntry.DateTimeFromString (Entry.StringValue).ToUniversalTime ();
 					}
 					
-					e = ExifHeader.Directory.Lookup (TagId.DateTime);
+					Entry = ExifHeader.Directory.Lookup (TagId.DateTime);
 					
-					if (e != null)
-						return DirectoryEntry.DateTimeFromString (e.StringValue).ToUniversalTime ();
+					if (Entry != null)
+						return DirectoryEntry.DateTimeFromString (Entry.StringValue).ToUniversalTime ();
 					
 					return base.Date;
 #else
@@ -341,7 +359,7 @@
 					time = Exif.ExifUtil.DateTimeFromString (time_str).ToUniversalTime (); 
 #endif
 				} catch (System.Exception e) {
-					Console.WriteLine (e);
+					Console.WriteLine ("Error while reading Date{1}{0}", e.ToString(), Environment.NewLine);
 					time = base.Date;
 				}
 				return time;
