[f-spot/taglib-metadata: 20/29] Move all Imaging code in its own namespace.



commit c8127955f1f4ea970dfc61cb8c392dfed01fed46
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat Jun 26 21:32:22 2010 +0200

    Move all Imaging code in its own namespace.
    
    This code should be removed and replaced by their respective better
    replacements.

 extensions/Exporters/FolderExport/FolderExport.cs  |   19 ++--
 .../Exporters/PicasaWebExport/PicasaWebExport.cs   |    1 +
 extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs  |    1 +
 extensions/Tools/RawPlusJpeg/RawPlusJpeg.cs        |    1 +
 src/Core/Photo.cs                                  |    3 +-
 src/Editors/Editor.cs                              |    3 +-
 src/Filters/JpegFilter.cs                          |   11 ++-
 src/Filters/ResizeFilter.cs                        |    7 +-
 src/Filters/SharpFilter.cs                         |    7 +-
 src/ImageLoaderThread.cs                           |    3 +-
 src/Imaging/Bim.cs                                 |    9 +-
 src/Imaging/Ciff.cs                                |    4 +-
 src/Imaging/DCRawFile.cs                           |    2 +-
 src/Imaging/Exif.cs                                |    2 +-
 src/Imaging/IOChannel.cs                           |    2 +-
 src/Imaging/ImageFile.cs                           |   40 ++++----
 src/Imaging/InternalProcess.cs                     |    2 +-
 src/Imaging/IptcFile.cs                            |    2 +-
 src/Imaging/JpegFile.cs                            |    3 +-
 src/Imaging/JpegUtils.cs                           |    2 +
 src/Imaging/MrwFile.cs                             |   13 +--
 src/Imaging/OrderedWriter.cs                       |    2 +-
 src/Imaging/PngFile.cs                             |   42 ++++----
 src/Imaging/PnmFile.cs                             |    4 +-
 src/Imaging/RafFile.cs                             |    2 +-
 src/Imaging/SvgFile.cs                             |    2 +-
 src/Imaging/Tiff.cs                                |   97 +-------------------
 src/Imaging/X3fFile.cs                             |    2 +-
 src/Imaging/XmpFile.cs                             |    2 +-
 src/Import/FileImportSource.cs                     |    1 +
 src/Loaders/GdkImageLoader.cs                      |    1 +
 src/Loaders/ImageLoader.cs                         |    1 +
 src/MetadataStore.cs                               |   46 +++++-----
 src/PhotoLoader.cs                                 |    1 +
 src/PixbufUtils.cs                                 |   22 +++--
 src/PrintOperation.cs                              |    1 +
 src/RotateCommand.cs                               |    2 +-
 src/UI.Dialog/EditTagIconDialog.cs                 |    3 +-
 src/UriCollection.cs                               |    8 +-
 src/Widgets/ImageInfo.cs                           |    1 +
 src/Widgets/InfoBox.cs                             |   29 +-----
 src/Widgets/MetadataDisplay.cs                     |   14 ++-
 src/Widgets/SlideShow.cs                           |    1 +
 src/XmpTagsImporter.cs                             |    3 +-
 src/main.cs                                        |    1 +
 45 files changed, 177 insertions(+), 248 deletions(-)
---
diff --git a/extensions/Exporters/FolderExport/FolderExport.cs b/extensions/Exporters/FolderExport/FolderExport.cs
index d3f3cf1..538bf3b 100644
--- a/extensions/Exporters/FolderExport/FolderExport.cs
+++ b/extensions/Exporters/FolderExport/FolderExport.cs
@@ -37,6 +37,7 @@ using FSpot.Filters;
 using FSpot.Widgets;
 using FSpot.Utils;
 using FSpot.UI.Dialog;
+using FSpot.Imaging.Exif;
 
 namespace FSpotFolderExport {
 	public class FolderExport : FSpot.Extensions.IExporter {
@@ -486,7 +487,7 @@ namespace FSpotFolderExport {
 								      new SafeUri (path).ToString ());
 				}
 
-				using (Exif.ExifData data = new Exif.ExifData (photo_path)) {
+				using (ExifData data = new ExifData (photo_path)) {
 					for (int i = 1; i < requests.Length; i++) {
 
 						req = requests [i];
@@ -779,7 +780,7 @@ namespace FSpotFolderExport {
 				// identify tags present in these photos
 				i = 0;
 				foreach (IBrowsableItem photo in photos) {
-					foreach (Tag tag in photo.Tags) {
+					foreach (var tag in photo.Tags) {
 						if (!tagSets.ContainsKey (tag.Name)) {
 							tagSets.Add (tag.Name, new ArrayList ());
 							allTags.Add (tag.Name, tag);
@@ -1079,10 +1080,10 @@ namespace FSpotFolderExport {
 			writer.RenderEndTag (); //div styleboxcontainer
 		}
 
-		public void WriteTagsLinks (System.Web.UI.HtmlTextWriter writer, Tag[] tags)
+		public void WriteTagsLinks (System.Web.UI.HtmlTextWriter writer, FSpot.Tag[] tags)
 		{
 			ArrayList tagsList = new ArrayList (tags.Length);
-			foreach (Tag tag in tags) {
+			foreach (var tag in tags) {
 				tagsList.Add (tag);
 			}
 			WriteTagsLinks (writer, tagsList);
@@ -1102,7 +1103,7 @@ namespace FSpotFolderExport {
 			writer.RenderEndTag (); //h1
 			writer.AddAttribute ("id", "innertagbox");
 			writer.RenderBeginTag ("ul");
-			foreach (Tag tag in tags) {
+			foreach (FSpot.Tag tag in tags) {
 				writer.AddAttribute ("class", "tag");
 				writer.RenderBeginTag ("li");
 				writer.AddAttribute ("href", TagIndexPath (tag.Name, 0));
@@ -1300,11 +1301,11 @@ namespace FSpotFolderExport {
 		public void SaveTagIcons ()
 		{
 			MakeDir (SubdirPath ("tags"));
-			foreach (Tag tag in allTags.Values)
+			foreach (FSpot.Tag tag in allTags.Values)
 				SaveTagIcon (tag);
 		}
 
-		public void SaveTagIcon (Tag tag) {
+		public void SaveTagIcon (FSpot.Tag tag) {
 			Gdk.Pixbuf icon = tag.Icon;
 			Gdk.Pixbuf scaled = null;
 			if (icon.Height != 52 || icon.Width != 52) {
@@ -1315,12 +1316,12 @@ namespace FSpotFolderExport {
 			scaled.Dispose ();
 		}
 
-		public string TagPath (Tag tag)
+		public string TagPath (FSpot.Tag tag)
 		{
 			return System.IO.Path.Combine("tags",TagName(tag));
 		}
 
-		public string TagName (Tag tag)
+		public string TagName (FSpot.Tag tag)
 		{
 			return "tag_"+ ((DbItem)tag).Id+".png";
 		}
diff --git a/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs b/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
index 1702461..1061f33 100644
--- a/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
+++ b/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
@@ -22,6 +22,7 @@ using FSpot;
 using FSpot.Filters;
 using FSpot.Widgets;
 using FSpot.Utils;
+using FSpot.Imaging;
 using FSpot.UI.Dialog;
 
 using Gnome.Keyring;
diff --git a/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs b/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs
index 6e67a0c..e9ecb39 100644
--- a/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs
+++ b/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs
@@ -16,6 +16,7 @@ using Hyena;
 using FSpot;
 using FSpot.Utils;
 using FSpot.Extensions;
+using FSpot.Imaging;
 using FSpot.UI.Dialog;
 
 namespace DevelopInUFRawExtension
diff --git a/extensions/Tools/RawPlusJpeg/RawPlusJpeg.cs b/extensions/Tools/RawPlusJpeg/RawPlusJpeg.cs
index 906050b..d33c90a 100644
--- a/extensions/Tools/RawPlusJpeg/RawPlusJpeg.cs
+++ b/extensions/Tools/RawPlusJpeg/RawPlusJpeg.cs
@@ -15,6 +15,7 @@ using Gtk;
 using FSpot;
 using FSpot.UI.Dialog;
 using FSpot.Extensions;
+using FSpot.Imaging;
 
 using Hyena;
 using Hyena.Widgets;
diff --git a/src/Core/Photo.cs b/src/Core/Photo.cs
index cb7078e..db3367f 100644
--- a/src/Core/Photo.cs
+++ b/src/Core/Photo.cs
@@ -21,6 +21,7 @@ using Mono.Unix;
 
 using FSpot.Utils;
 using FSpot.Platform;
+using FSpot.Imaging;
 
 namespace FSpot
 {
@@ -219,7 +220,7 @@ namespace FSpot
 			uint version = DefaultVersionId;
 			using (ImageFile img = ImageFile.Create (DefaultVersion.Uri)) {
 				// Always create a version if the source is not a jpeg for now.
-				create_version = create_version || !(img is FSpot.JpegFile);
+				create_version = create_version || !(img is FSpot.Imaging.JpegFile);
 	
 				if (buffer == null)
 					throw new ApplicationException ("invalid (null) image");
diff --git a/src/Editors/Editor.cs b/src/Editors/Editor.cs
index b83f86c..6f4dc43 100644
--- a/src/Editors/Editor.cs
+++ b/src/Editors/Editor.cs
@@ -7,9 +7,10 @@
  * This is free software. See COPYING for details.
  */
 
-using FSpot;
 using Hyena;
+
 using FSpot.Widgets;
+using FSpot.Imaging;
 
 using Gdk;
 using Gtk;
diff --git a/src/Filters/JpegFilter.cs b/src/Filters/JpegFilter.cs
index e80ab15..d315d1f 100644
--- a/src/Filters/JpegFilter.cs
+++ b/src/Filters/JpegFilter.cs
@@ -7,7 +7,10 @@
  * This is free software. See COPYING for details.
  *
  */
+
 using System;
+using FSpot.Imaging;
+using FSpot.Imaging.Exif;
 
 namespace FSpot.Filters {
 	public class JpegFilter : IFilter {
@@ -33,17 +36,17 @@ namespace FSpot.Filters {
 			string source = req.Current.LocalPath;
 
 			using (ImageFile img = ImageFile.Create (req.Current)) {
-				if (img is JpegFile)
+				if (img is Imaging.JpegFile)
 					return false;
 
 				req.Current = req.TempUri ("jpg");
 				string dest = req.Current.LocalPath;
 
-				Exif.ExifData exif_data;
+				ExifData exif_data;
 				try {
-					exif_data = new Exif.ExifData (source);
+					exif_data = new ExifData (source);
 				} catch (Exception) {
-					exif_data = new Exif.ExifData();
+					exif_data = new ExifData();
 				}
 
 				PixbufUtils.SaveJpeg (img.Load(), dest, (int) quality, exif_data);
diff --git a/src/Filters/ResizeFilter.cs b/src/Filters/ResizeFilter.cs
index 1a4945d..ea8dbc4 100644
--- a/src/Filters/ResizeFilter.cs
+++ b/src/Filters/ResizeFilter.cs
@@ -12,7 +12,8 @@
 using System;
 using System.IO;
 
-using FSpot;
+using FSpot.Imaging;
+using FSpot.Imaging.Exif;
 
 using Mono.Unix;
 
@@ -61,9 +62,9 @@ namespace FSpot.Filters {
 						// FIXME this is a bit of a nasty hack to work around
 						// the lack of being able to change the path in this filter
 						// and the lack of proper metadata copying yuck
-						Exif.ExifData exif_data;
+						ExifData exif_data;
 	
-						exif_data = new Exif.ExifData (source);
+						exif_data = new ExifData (source);
 						
 						PixbufUtils.SaveJpeg (pixbuf, dest, 95, exif_data);
 					} else 
diff --git a/src/Filters/SharpFilter.cs b/src/Filters/SharpFilter.cs
index f103d7e..2959738 100644
--- a/src/Filters/SharpFilter.cs
+++ b/src/Filters/SharpFilter.cs
@@ -14,6 +14,9 @@ using Gdk;
 
 using Mono.Unix;
 
+using FSpot.Imaging;
+using FSpot.Imaging.Exif;
+
 namespace FSpot.Filters {
 	public class SharpFilter : IFilter 
 	{	
@@ -43,9 +46,9 @@ namespace FSpot.Filters {
 							// FIXME this is a bit of a nasty hack to work around
 							// the lack of being able to change the path in this filter
 							// and the lack of proper metadata copying yuck
-							Exif.ExifData exif_data;
+							ExifData exif_data;
 		
-							exif_data = new Exif.ExifData (req.Current.LocalPath);
+							exif_data = new ExifData (req.Current.LocalPath);
 							
 							PixbufUtils.SaveJpeg (out_pixbuf, dest_uri.LocalPath, 90, exif_data);
 						} else 
diff --git a/src/ImageLoaderThread.cs b/src/ImageLoaderThread.cs
index 626b19f..d0ea239 100644
--- a/src/ImageLoaderThread.cs
+++ b/src/ImageLoaderThread.cs
@@ -16,6 +16,7 @@ using System;
 
 using Hyena;
 
+using FSpot.Imaging;
 
 public class ImageLoaderThread {
 
@@ -179,7 +180,7 @@ public class ImageLoaderThread {
 	{
 		Pixbuf orig_image;
 		try {
-			using (FSpot.ImageFile img = FSpot.ImageFile.Create (request.Uri)) {
+			using (var img = ImageFile.Create (request.Uri)) {
 				if (request.Width > 0) {
 					orig_image = img.Load (request.Width, request.Height);
 				} else {
diff --git a/src/Imaging/Bim.cs b/src/Imaging/Bim.cs
index 56e5a1a..c99d38e 100644
--- a/src/Imaging/Bim.cs
+++ b/src/Imaging/Bim.cs
@@ -1,6 +1,9 @@
 using Hyena;
 
-namespace FSpot.Bim {
+using FSpot.Imaging.Xmp;
+using FSpot.Imaging.Iptc;
+
+namespace FSpot.Imaging.Bim {
 	public enum EntryType : ushort {
 		ObsoleteImageInfo = 0x03e8,  
 		MacPrintManager = 0x03e9,
@@ -162,12 +165,12 @@ namespace FSpot.Bim {
 				switch (type) {
 				case EntryType.IPTCNAA:
 					System.IO.Stream iptcstream = new System.IO.MemoryStream (e.Data);
-					FSpot.Iptc.IptcFile iptc = new FSpot.Iptc.IptcFile (iptcstream);
+					IptcFile iptc = new IptcFile (iptcstream);
 					iptc.Select (sink);
 					break;
 				case EntryType.XMP:
 					System.IO.Stream xmpstream = new System.IO.MemoryStream (e.Data);
-					FSpot.Xmp.XmpFile xmp = new FSpot.Xmp.XmpFile (xmpstream);
+					XmpFile xmp = new XmpFile (xmpstream);
 					xmp.Select (sink);
 					break;
 				default:
diff --git a/src/Imaging/Ciff.cs b/src/Imaging/Ciff.cs
index cd8fddc..3935c4f 100644
--- a/src/Imaging/Ciff.cs
+++ b/src/Imaging/Ciff.cs
@@ -3,7 +3,7 @@ using FSpot.Utils;
 using Hyena;
 using TagLib.Image;
 
-namespace FSpot.Ciff {
+namespace FSpot.Imaging.Ciff {
 	public enum Tag {
 		// Byte valuesad
 		NullRecord = 0x0000,
@@ -304,7 +304,7 @@ namespace FSpot.Ciff {
 		}
 	}
 	
-	public class CiffFile : FSpot.ImageFile , SemWeb.StatementSource {
+	public class CiffFile : ImageFile , SemWeb.StatementSource {
 		public ImageDirectory root;
 		bool little;
 		System.IO.Stream stream;
diff --git a/src/Imaging/DCRawFile.cs b/src/Imaging/DCRawFile.cs
index ad104e8..6b6d4ff 100644
--- a/src/Imaging/DCRawFile.cs
+++ b/src/Imaging/DCRawFile.cs
@@ -3,7 +3,7 @@ using System.IO;
 using System;
 using Hyena;
 
-namespace FSpot {
+namespace FSpot.Imaging {
 	public class Pipe : System.IO.Stream {
 		// This class is a hack to make sure mono doesn't dispose the process
 		// and by extension the stream from the pipe when we are still using the
diff --git a/src/Imaging/Exif.cs b/src/Imaging/Exif.cs
index 55c9152..76c754f 100644
--- a/src/Imaging/Exif.cs
+++ b/src/Imaging/Exif.cs
@@ -16,7 +16,7 @@ using System.Runtime.InteropServices;
 using Mono.Unix;
 using Hyena;
 
-namespace Exif {
+namespace FSpot.Imaging.Exif {
 	public enum Tag {
 		InteroperabilityIndex		= 0x0001,
 		InteroperabilityVersion	        = 0x0002,
diff --git a/src/Imaging/IOChannel.cs b/src/Imaging/IOChannel.cs
index 30498c3..c27d08b 100644
--- a/src/Imaging/IOChannel.cs
+++ b/src/Imaging/IOChannel.cs
@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
 using GLib;
 using Hyena;
 
-namespace FSpot {
+namespace FSpot.Imaging {
 
 	[Flags]
 	public enum IOFlags {
diff --git a/src/Imaging/ImageFile.cs b/src/Imaging/ImageFile.cs
index 0ef7ebc..2990a90 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Imaging/ImageFile.cs
@@ -13,7 +13,7 @@ using TagLib.Image;
 
 using GFileInfo = GLib.FileInfo;
 
-namespace FSpot {
+namespace FSpot.Imaging {
 	public class ImageFormatException : ApplicationException {
 		public ImageFormatException (string msg) : base (msg)
 		{
@@ -52,30 +52,30 @@ namespace FSpot {
 		static ImageFile ()
 		{
 			name_table = new Hashtable ();
-			name_table [".svg"] = typeof (FSpot.Svg.SvgFile);
+			name_table [".svg"] = typeof (FSpot.Imaging.Svg.SvgFile);
 			name_table [".gif"] = typeof (ImageFile);
 			name_table [".bmp"] = typeof (ImageFile);
 			name_table [".pcx"] = typeof (ImageFile);
 			name_table [".jpeg"] = typeof (JpegFile);
 			name_table [".jpg"] = typeof (JpegFile);
-			name_table [".png"] = typeof (FSpot.Png.PngFile);
-			name_table [".cr2"] = typeof (FSpot.Tiff.Cr2File);
-			name_table [".nef"] = typeof (FSpot.Tiff.NefFile);
-			name_table [".pef"] = typeof (FSpot.Tiff.NefFile);
-			name_table [".raw"] = typeof (FSpot.Tiff.NefFile);
-			name_table [".kdc"] = typeof (FSpot.Tiff.NefFile);
-			name_table [".arw"] = typeof (FSpot.Tiff.NefFile);
-			name_table [".rw2"] = typeof (FSpot.DCRawFile);
-			name_table [".tiff"] = typeof (FSpot.Tiff.TiffFile);
-			name_table [".tif"] = typeof (FSpot.Tiff.TiffFile);
-			name_table [".orf"] =  typeof (FSpot.Tiff.NefFile);
-			name_table [".srf"] = typeof (FSpot.Tiff.NefFile);
-			name_table [".dng"] = typeof (FSpot.Tiff.DngFile);
-			name_table [".crw"] = typeof (FSpot.Ciff.CiffFile);
-			name_table [".ppm"] = typeof (FSpot.Pnm.PnmFile);
-			name_table [".mrw"] = typeof (FSpot.Mrw.MrwFile);
-			name_table [".raf"] = typeof (FSpot.Raf.RafFile);
-			name_table [".x3f"] = typeof (FSpot.X3f.X3fFile);
+			name_table [".png"] = typeof (FSpot.Imaging.Png.PngFile);
+			name_table [".cr2"] = typeof (FSpot.Imaging.Tiff.Cr2File);
+			name_table [".nef"] = typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".pef"] = typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".raw"] = typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".kdc"] = typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".arw"] = typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".rw2"] = typeof (FSpot.Imaging.DCRawFile);
+			name_table [".tiff"] = typeof (FSpot.Imaging.Tiff.TiffFile);
+			name_table [".tif"] = typeof (FSpot.Imaging.Tiff.TiffFile);
+			name_table [".orf"] =  typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".srf"] = typeof (FSpot.Imaging.Tiff.NefFile);
+			name_table [".dng"] = typeof (FSpot.Imaging.Tiff.DngFile);
+			name_table [".crw"] = typeof (FSpot.Imaging.Ciff.CiffFile);
+			name_table [".ppm"] = typeof (FSpot.Imaging.Pnm.PnmFile);
+			name_table [".mrw"] = typeof (FSpot.Imaging.Mrw.MrwFile);
+			name_table [".raf"] = typeof (FSpot.Imaging.Raf.RafFile);
+			name_table [".x3f"] = typeof (FSpot.Imaging.X3f.X3fFile);
 
 			// add mimetypes for fallback
 			name_table ["image/bmp"]     = name_table ["image/x-bmp"] = name_table [".bmp"];
diff --git a/src/Imaging/InternalProcess.cs b/src/Imaging/InternalProcess.cs
index e1154c7..96b7f04 100644
--- a/src/Imaging/InternalProcess.cs
+++ b/src/Imaging/InternalProcess.cs
@@ -3,7 +3,7 @@ using System.IO;
 using System.Runtime.InteropServices;
 using GLib;
 
-namespace FSpot {
+namespace FSpot.Imaging {
 	[Flags]
 	internal enum InternalProcessFlags {
 		LeaveDescriptorsOpen =       1 << 0,
diff --git a/src/Imaging/IptcFile.cs b/src/Imaging/IptcFile.cs
index f67a583..3058d71 100644
--- a/src/Imaging/IptcFile.cs
+++ b/src/Imaging/IptcFile.cs
@@ -1,7 +1,7 @@
 using SemWeb;
 using Mono.Unix;
 
-namespace FSpot.Iptc {
+namespace FSpot.Imaging.Iptc {
 	public enum Format
 	{
 		Unknown,
diff --git a/src/Imaging/JpegFile.cs b/src/Imaging/JpegFile.cs
index c2ffb80..d93576f 100644
--- a/src/Imaging/JpegFile.cs
+++ b/src/Imaging/JpegFile.cs
@@ -1,13 +1,12 @@
 using System;
 using System.IO;
 using FSpot.Xmp;
-using FSpot.Tiff;
 using FSpot.Utils;
 using Hyena;
 using TagLib;
 using TagLib.Image;
 
-namespace FSpot {
+namespace FSpot.Imaging {
 	public interface IThumbnailContainer {
 		Gdk.Pixbuf GetEmbeddedThumbnail ();
 	}
diff --git a/src/Imaging/JpegUtils.cs b/src/Imaging/JpegUtils.cs
index 981b1e9..2596b75 100644
--- a/src/Imaging/JpegUtils.cs
+++ b/src/Imaging/JpegUtils.cs
@@ -2,6 +2,7 @@ using System.Runtime.InteropServices;
 using System;
 using Gdk;
 
+namespace FSpot.Imaging {
 public class JpegUtils {
 
 	[DllImport ("libfspot")]
@@ -32,3 +33,4 @@ public class JpegUtils {
 			throw new Exception (error_message);
 	}
 }
+}
diff --git a/src/Imaging/MrwFile.cs b/src/Imaging/MrwFile.cs
index edc71d5..d069ee3 100644
--- a/src/Imaging/MrwFile.cs
+++ b/src/Imaging/MrwFile.cs
@@ -1,7 +1,6 @@
-using FSpot.Tiff;
 using Hyena;
 
-namespace FSpot.Mrw {
+namespace FSpot.Imaging.Mrw {
 	// Minolta raw format
 	// see http://www.dalibor.cz/minolta/raw_file_format.htm for details
 	// note that the blocks can be in any order.
@@ -117,7 +116,7 @@ namespace FSpot.Mrw {
 	}
 
 	internal class TtwBlock : Block {
-		FSpot.Tiff.Header header;
+		FSpot.Imaging.Tiff.Header header;
 
 		public TtwBlock (System.IO.Stream stream) : base (stream)
 		{
@@ -125,13 +124,13 @@ namespace FSpot.Mrw {
 				throw new System.Exception (System.String.Format ("invalid block name {0}", this.Name));
 		}
 		
-		public FSpot.Tiff.Header TiffHeader {
+		public FSpot.Imaging.Tiff.Header TiffHeader {
 			get {
 				if (header == null) {
 					try {
 						System.IO.MemoryStream mem = new System.IO.MemoryStream (this.Data);
 						Log.Debug ("before header");
-						header = new Header (mem);
+						header = new Tiff.Header (mem);
 					} catch (System.Exception e) {
 						Log.Exception (e);
 					}
@@ -172,7 +171,7 @@ namespace FSpot.Mrw {
 	
 	public class MrwFile : ImageFile, SemWeb.StatementSource {
 		MrmBlock mrm;
-		FSpot.Tiff.Header header;
+		FSpot.Imaging.Tiff.Header header;
 
 		public MrwFile (SafeUri uri) : base (uri)
 		{
@@ -183,7 +182,7 @@ namespace FSpot.Mrw {
                         get { return false; }
                 }
 
-		public FSpot.Tiff.Header Header {
+		public Tiff.Header Header {
 			get {
 				if (mrm == null)
 					LoadBlocks ();
diff --git a/src/Imaging/OrderedWriter.cs b/src/Imaging/OrderedWriter.cs
index b86c9ca..cee618d 100644
--- a/src/Imaging/OrderedWriter.cs
+++ b/src/Imaging/OrderedWriter.cs
@@ -1,6 +1,6 @@
 using System.IO;
 
-namespace FSpot {
+namespace FSpot.Imaging {
 	public class OrderedWriter {
 		Stream stream;
 		bool is_little;
diff --git a/src/Imaging/PngFile.cs b/src/Imaging/PngFile.cs
index ea07d9d..1f37b97 100644
--- a/src/Imaging/PngFile.cs
+++ b/src/Imaging/PngFile.cs
@@ -2,12 +2,12 @@ using ICSharpCode.SharpZipLib.Zip.Compression;
 using SemWeb;
 using Cms;
 using System.IO;
-using FSpot.Xmp;
+using FSpot.Imaging.Xmp;
 using System.Collections;
 using System.Reflection;
 using Hyena;
 
-namespace FSpot.Png {
+namespace FSpot.Imaging.Png {
 	public class PngFile : ImageFile, SemWeb.StatementSource {
 		PngHeader header;
 
@@ -71,7 +71,7 @@ namespace FSpot.Png {
 					case "XMP":
 					case "XML:com.adobe.xmp":
 						using (System.IO.Stream xmpstream = new System.IO.MemoryStream (text.TextData)) {
-							FSpot.Xmp.XmpFile xmp = new FSpot.Xmp.XmpFile (xmpstream);
+							FSpot.Imaging.Xmp.XmpFile xmp = new FSpot.Imaging.Xmp.XmpFile (xmpstream);
 							xmp.Select (sink);
 						}
 						break;
@@ -124,8 +124,8 @@ namespace FSpot.Png {
 					uint denominator = (uint) (phys.InMeters ? 100 : 1);
 					
 					MetadataStore.AddLiteral (sink, "tiff:ResolutionUnit", phys.InMeters ? "3" : "1");
-					MetadataStore.AddLiteral (sink, "tiff:XResolution", new FSpot.Tiff.Rational (phys.PixelsPerUnitX, denominator).ToString ());
-					MetadataStore.AddLiteral (sink, "tiff:YResolution", new FSpot.Tiff.Rational (phys.PixelsPerUnitY, denominator).ToString ());
+					MetadataStore.AddLiteral (sink, "tiff:XResolution", new Tiff.Rational (phys.PixelsPerUnitX, denominator).ToString ());
+					MetadataStore.AddLiteral (sink, "tiff:YResolution", new Tiff.Rational (phys.PixelsPerUnitY, denominator).ToString ());
 				}
 			}
 		}
@@ -432,44 +432,44 @@ namespace FSpot.Png {
 
 			public ColorChunk (string name, byte [] data) : base (name, data) {}
 
-			public FSpot.Tiff.Rational WhiteX {
+			public Tiff.Rational WhiteX {
 				get {
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 0, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 0, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational WhiteY {
+			public Tiff.Rational WhiteY {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 4, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 4, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational RedX {
+			public Tiff.Rational RedX {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 8, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 8, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational RedY {
+			public Tiff.Rational RedY {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 12, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 12, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational GreenX {
+			public Tiff.Rational GreenX {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 16, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 16, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational GreenY {
+			public Tiff.Rational GreenY {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 20, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 20, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational BlueX {
+			public Tiff.Rational BlueX {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 24, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 24, false), Denominator);
 				}
 			}
-			public FSpot.Tiff.Rational BlueY {
+			public Tiff.Rational BlueY {
 				get { 
-					return new FSpot.Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 28, false), Denominator);
+					return new Tiff.Rational (FSpot.BitConverter.ToUInt32 (data, 28, false), Denominator);
 				}
 			}
 		}
diff --git a/src/Imaging/PnmFile.cs b/src/Imaging/PnmFile.cs
index 304f4a4..b2d2275 100644
--- a/src/Imaging/PnmFile.cs
+++ b/src/Imaging/PnmFile.cs
@@ -4,7 +4,7 @@ using System;
 using System.IO;
 using Hyena;
 
-namespace FSpot.Pnm {
+namespace FSpot.Imaging.Pnm {
 	public class PnmFile : ImageFile, StatementSource {
 
                 // false seems a safe default
@@ -244,7 +244,7 @@ namespace FSpot.Pnm {
 					return LoadRGB16 (stream, header.Width, header.Height);
 #else
 					stream.Position = 0;
-					FSpot.Imaging.PixelBuffer image = FSpot.Pnm.PnmFile.LoadBuffer (stream);
+					Imaging.PixelBuffer image = PnmFile.LoadBuffer (stream);
 					Gdk.Pixbuf result = image.ToPixbuf (Cms.Profile.CreateStandardRgb ());
 					return result;
 #endif
diff --git a/src/Imaging/RafFile.cs b/src/Imaging/RafFile.cs
index fa2ac2a..262d1a6 100644
--- a/src/Imaging/RafFile.cs
+++ b/src/Imaging/RafFile.cs
@@ -2,7 +2,7 @@ using FSpot.Utils;
 using Hyena;
 using TagLib.Image;
 
-namespace FSpot.Raf {
+namespace FSpot.Imaging.Raf {
 	// This is reverse engineered from looking at the sample files I have
 	// from what I can tell the file is always BigEndian, although the embedded jpeg may not be
 	// and there is a start long offset at 0x54 (or possibly 0x56 if it is a short) that points to
diff --git a/src/Imaging/SvgFile.cs b/src/Imaging/SvgFile.cs
index bf51ec5..14a6db3 100644
--- a/src/Imaging/SvgFile.cs
+++ b/src/Imaging/SvgFile.cs
@@ -1,7 +1,7 @@
 using System;
 using Hyena;
 
-namespace FSpot.Svg {
+namespace FSpot.Imaging.Svg {
 	public class SvgFile : ImageFile // SemWeb.StatementSource 
 	{
 		MetadataStore store;
diff --git a/src/Imaging/Tiff.cs b/src/Imaging/Tiff.cs
index 75816c8..5a91b49 100644
--- a/src/Imaging/Tiff.cs
+++ b/src/Imaging/Tiff.cs
@@ -1,4 +1,3 @@
-//#define DEBUG_LOADER
 using FSpot;
 using FSpot.Utils;
 using SemWeb;
@@ -8,7 +7,7 @@ using System.Collections.Generic;
 using Hyena;
 using TagLib.Image;
 
-namespace FSpot.Tiff {
+namespace FSpot.Imaging.Tiff {
 
 	// This is primarily to preserve the names from the specification
 	// because they differ from the tiff standard names
@@ -844,9 +843,6 @@ namespace FSpot.Tiff {
 			byte [] tmp = new byte [4];
 
 		        if (stream.Read (tmp, 0, tmp.Length) < 4) {
-#if DEBUG_LOADER
-				Log.Debug ("short read XXXXXXXXXXXXXXXXXXXXXXx");
-#endif
 				throw new ShortReadException ();
 			}
 			return BitConverter.ToUInt32 (tmp, 0, endian == Endian.Little);
@@ -857,9 +853,6 @@ namespace FSpot.Tiff {
 			byte [] tmp = new byte [2];
 
 		        if (stream.Read (tmp, 0, tmp.Length) < 2) {
-#if DEBUG_LOADER
-				Log.Debug ("Short read");
-#endif
 				throw new ShortReadException ();
 			}
 
@@ -910,9 +903,6 @@ namespace FSpot.Tiff {
 			if (directory_offset < 8)
 				throw new ParseException ("Invalid IFD0 Offset [" + directory_offset.ToString () + "]"); 
 			
-#if DEBUG_LOADER
-			Log.Debug ("Reading First IFD");
-#endif
 			Directory = new ImageDirectory (stream, directory_offset, endian); 
 			//}
 		}
@@ -928,23 +918,20 @@ namespace FSpot.Tiff {
 		public void SelectDirectory (ImageDirectory dir, StatementSink sink)
 		{
 			foreach (DirectoryEntry e in dir.Entries) {
-#if DEBUG_LOADER
-				Log.DebugFormat ("{0}", e.Id);
-#endif
 				switch (e.Id) {
 				case TagId.IPTCNAA:
 					System.IO.Stream iptcstream = new System.IO.MemoryStream (e.RawData);
-					FSpot.Iptc.IptcFile iptc = new FSpot.Iptc.IptcFile (iptcstream);
+					FSpot.Imaging.Iptc.IptcFile iptc = new FSpot.Imaging.Iptc.IptcFile (iptcstream);
 					iptc.Select (sink);
 					break;
 				case TagId.PhotoshopPrivate:
 					System.IO.Stream bimstream = new System.IO.MemoryStream (e.RawData);
-					FSpot.Bim.BimFile bim = new FSpot.Bim.BimFile (bimstream);
+					FSpot.Imaging.Bim.BimFile bim = new FSpot.Imaging.Bim.BimFile (bimstream);
 					bim.Select (sink);
 					break;
 				case TagId.XMP:
 					System.IO.Stream xmpstream = new System.IO.MemoryStream (e.RawData);
-					FSpot.Xmp.XmpFile xmp = new FSpot.Xmp.XmpFile (xmpstream);
+					FSpot.Imaging.Xmp.XmpFile xmp = new FSpot.Imaging.Xmp.XmpFile (xmpstream);
 					xmp.Select (sink);
 					break;
 				case TagId.ImageDescription:
@@ -1181,17 +1168,11 @@ namespace FSpot.Tiff {
 		protected virtual void ReadEntries (System.IO.Stream stream) 
 		{
 			num_entries = Converter.ReadUShort (stream, endian);
-#if DEBUG_LOADER
-			Log.DebugFormat ("reading {0} entries", num_entries);
-#endif			
 			entries = new List<DirectoryEntry> (num_entries);
 			int entry_length = num_entries * 12;
 			byte [] content = new byte [entry_length];
 			
 			if (stream.Read (content, 0, content.Length) < content.Length) {
-#if DEBUG_LOADER
-				Log.Debug ("short read XXXXXXXXXXXXXXXXXXXXXXx");
-#endif
 				throw new ShortReadException ();
 			}
 
@@ -1199,9 +1180,6 @@ namespace FSpot.Tiff {
 			for (int pos = 0; pos < entry_length; pos += 12) {
 				DirectoryEntry entry = CreateEntry (this, content, pos, this.endian);
 				entries.Add (entry);		
-#if DEBUG_LOADER
-				Log.DebugFormat ("Added Entry {0} {1} - {2} * {3}", entry.Id.ToString (), entry.Id.ToString ("x"), entry.Type, entry.Count);
-#endif
 				if (entry.Id == TagId.NewSubfileType) {
 					
 				}
@@ -1222,10 +1200,6 @@ namespace FSpot.Tiff {
 		
 		protected void LoadNextDirectory (System.IO.Stream stream)
 		{
-#if DEBUG_LOADER
-			Log.DebugFormat ("start_position = {1} next_directory_offset = {0}",
-						  next_directory_offset, orig_position);
-#endif
 			next_directory = null;
 			try {
 				if (next_directory_offset != 0 && next_directory_offset != orig_position)
@@ -1454,10 +1428,6 @@ namespace FSpot.Tiff {
 
 		public override uint Save (OrderedWriter writer, uint position)
 		{
-#if DEBUG_LOADER			
-			Log.DebugFormat ("writing entry {0} {1} {2} - value offset = {3}", Id, Type, Count, position);
-#endif
-
 			writer.Write ((ushort)Id);
 			writer.Write ((ushort)Type);
 			writer.Write ((uint)Count);
@@ -1619,9 +1589,6 @@ namespace FSpot.Tiff {
 
 		public virtual uint Save (OrderedWriter writer, uint position)
 		{
-#if DEBUG_LOADER			
-			Log.DebugFormat ("writing entry {0} {1} {2}", Id, Type, Count);
-#endif
 			writer.Write ((ushort)Id);
 			writer.Write ((ushort)Type);
 			writer.Write ((uint)Count);
@@ -1709,60 +1676,10 @@ namespace FSpot.Tiff {
 				stream.Seek ((long)Position, System.IO.SeekOrigin.Begin);
 				byte [] data = new byte [count * GetTypeSize ()];
 				if (stream.Read (data, 0, data.Length) < data.Length) {
-#if DEBUG_LOADER
-					Log.Debug ("Short read");
-#endif
 					throw new ShortReadException ();
 				}
 				raw_data = data;
 			}
-
-#if DEBUG_LOADER
-			switch ((int)this.Id) {
-			case (int)TagId.NewSubfileType:
-				System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX new NewSubFileType {0}", (NewSubfileType) this.ValueAsLong [0]);
-				break;
-			case (int)TagId.SubfileType:
-				System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX new SubFileType {0}", (SubfileType) this.ValueAsLong [0]);
-				break;
-			case (int)TagId.Compression:
-				//System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX new Compression {0}", (Compression) this.ValueAsLong [0]);
-				
-				break;
-			case (int)TagId.JPEGProc:
-				//System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX new JPEGProc {0}", (JPEGProc) this.ValueAsLong [0]);
-				
-				break;
-			case (int)TagId.PhotometricInterpretation:
-				//System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX new PhotometricInterpretation {0}", (PhotometricInterpretation) this.ValueAsLong [0]);
-				break;
-			case (int)TagId.ImageWidth:
-			case (int)TagId.ImageLength:
-				//System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX new {1} {0}", this.ValueAsLong [0], this.Id);
-				break;
-			case 50648:
-			case 50656:
-			case 50752:
-				System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXX {0}({1}) - {2} {3}", this.Id, this.Id.ToString ("x"), this.type, raw_data.Length);
-				System.Console.WriteLine ("XXXX ", System.Text.Encoding.ASCII.GetString (raw_data));
-				switch (this.type) {
-				case EntryType.Long:
-					foreach (uint val in ((LongEntry)this).Value)
-						System.Console.Write (" {0}", val);
-					break;
-				case EntryType.Short:
-					foreach (ushort val in ((ShortEntry)this).ShortValue)
-						System.Console.Write (" {0}", val);
-					break;
-				case EntryType.Byte:
-					foreach (byte val in this.RawData)
-						System.Console.Write (" {0}", val);
-					break;
-				}
-				System.Console.WriteLine (String.Empty);
-				break;
-			}
-#endif
 		}
 
 		public virtual void Dump (string name)
@@ -2022,10 +1939,6 @@ namespace FSpot.Tiff {
 				using (System.IO.Stream input = Open ()) {
 					this.Header = new Header (input);
 				}
-
-#if DEBUG_LOADER
-				Header.Dump (this.ToString () + ":");
-#endif
 			} catch (System.Exception e) {
 				Log.Error (e.ToString ());
 			}
@@ -2121,7 +2034,7 @@ namespace FSpot.Tiff {
 			e = Header.Directory.Lookup (TagId.XMP);
 			if (e != null) {
 				System.IO.Stream xmpstream = new System.IO.MemoryStream (e.RawData);
-				FSpot.Xmp.XmpFile xmp = new FSpot.Xmp.XmpFile (xmpstream);
+				var xmp = new FSpot.Imaging.Xmp.XmpFile (xmpstream);
 				xmp.Select (sink);
 			}
 
diff --git a/src/Imaging/X3fFile.cs b/src/Imaging/X3fFile.cs
index 486d704..06b0fbb 100644
--- a/src/Imaging/X3fFile.cs
+++ b/src/Imaging/X3fFile.cs
@@ -6,7 +6,7 @@ using SemWeb;
 using Hyena;
 using TagLib.Image;
 
-namespace FSpot.X3f {
+namespace FSpot.Imaging.X3f {
 	internal class Info {
 		ushort major_version;
 		ushort minor_version;
diff --git a/src/Imaging/XmpFile.cs b/src/Imaging/XmpFile.cs
index b28d602..ff20334 100644
--- a/src/Imaging/XmpFile.cs
+++ b/src/Imaging/XmpFile.cs
@@ -4,7 +4,7 @@ using SemWeb;
 
 using Hyena;
 
-namespace FSpot.Xmp {
+namespace FSpot.Imaging.Xmp {
 	public class XmpFile : SemWeb.StatementSource, SemWeb.StatementSink
 	{
 		MetadataStore store;
diff --git a/src/Import/FileImportSource.cs b/src/Import/FileImportSource.cs
index 76a66e8..1030a9a 100644
--- a/src/Import/FileImportSource.cs
+++ b/src/Import/FileImportSource.cs
@@ -3,6 +3,7 @@ using System;
 using System.Threading;
 using System.Collections.Generic;
 using FSpot.Utils;
+using FSpot.Imaging;
 using Gtk;
 using Mono.Unix.Native;
 
diff --git a/src/Loaders/GdkImageLoader.cs b/src/Loaders/GdkImageLoader.cs
index e88f7bf..475a3b3 100644
--- a/src/Loaders/GdkImageLoader.cs
+++ b/src/Loaders/GdkImageLoader.cs
@@ -14,6 +14,7 @@ using System.Threading;
 using Gdk;
 using FSpot.Utils;
 using FSpot.Platform;
+using FSpot.Imaging;
 using Hyena;
 using TagLib.Image;
 
diff --git a/src/Loaders/ImageLoader.cs b/src/Loaders/ImageLoader.cs
index 9bab51f..b4b3b85 100644
--- a/src/Loaders/ImageLoader.cs
+++ b/src/Loaders/ImageLoader.cs
@@ -11,6 +11,7 @@
 //
 
 using FSpot.Utils;
+using FSpot.Imaging;
 using System;
 using System.Collections.Generic;
 using Gdk;
diff --git a/src/MetadataStore.cs b/src/MetadataStore.cs
index 3a65705..494ad8d 100644
--- a/src/MetadataStore.cs
+++ b/src/MetadataStore.cs
@@ -3,6 +3,8 @@ using SemWeb.Util;
 using Mono.Unix;
 using FSpot.Xmp;
 using FSpot.Utils;
+using FSpot.Imaging;
+using FSpot.Imaging.Tiff;
 using Hyena;
 
 namespace FSpot {
@@ -21,55 +23,55 @@ namespace FSpot {
 				new Description ("dc:rights", Catalog.GetString ("Copyright")),
 				new Description ("dc:subject", Catalog.GetString ("Subject and Keywords")),
 				new Description ("tiff:Compression", Catalog.GetString ("Compression"), 
-						 typeof (FSpot.Tiff.Compression)),
+						 typeof (FSpot.Imaging.Tiff.Compression)),
 						 /* Translators: Planar Configuration is the label for the tiff:PlanarConfiguration tag
 						    "when Planar Configuration=1, this implies that all components must have
 						    the same BitsPerSample value; when Planar Configuration=2, different
 						    components could have different bit depths." */
 				new Description ("tiff:PlanarConfiguration", Catalog.GetString ("Planar Configuration"), 
-						 typeof (FSpot.Tiff.PlanarConfiguration)),
+						 typeof (FSpot.Imaging.Tiff.PlanarConfiguration)),
 				new Description ("tiff:Orientation", Catalog.GetString ("Orientation"), 
 						 typeof (TagLib.Image.ImageOrientation)),
 				new Description ("tiff:PhotometricInterpretation", Catalog.GetString ("Photometric Interpretation"), 
-						 typeof (FSpot.Tiff.PhotometricInterpretation)),
+						 typeof (FSpot.Imaging.Tiff.PhotometricInterpretation)),
 				new Description ("tiff:ResolutionUnit", Catalog.GetString ("Resolution Unit"),
-						 typeof (FSpot.Tiff.ResolutionUnit)),
+						 typeof (FSpot.Imaging.Tiff.ResolutionUnit)),
 				new Description ("exif:ExposureProgram", Catalog.GetString ("Exposure Program"), 
-						 typeof (FSpot.Tiff.ExposureProgram)),
+						 typeof (FSpot.Imaging.Tiff.ExposureProgram)),
 				new Description ("exif:MeteringMode", Catalog.GetString ("Metering Mode"), 
-						 typeof (FSpot.Tiff.MeteringMode)),
+						 typeof (FSpot.Imaging.Tiff.MeteringMode)),
 				new Description ("exif:ExposureMode", Catalog.GetString ("Exposure Mode"), 
-						 typeof (FSpot.Tiff.ExposureMode)),
+						 typeof (FSpot.Imaging.Tiff.ExposureMode)),
 				new Description ("exif:CustomRendered", Catalog.GetString ("Custom Rendered"), 
-						 typeof (FSpot.Tiff.CustomRendered)),
+						 typeof (FSpot.Imaging.Tiff.CustomRendered)),
 				new Description ("exif:ComponentsConfiguration", Catalog.GetString ("Components Configuration"),
-						 typeof (FSpot.Tiff.ComponentsConfiguration)),
+						 typeof (FSpot.Imaging.Tiff.ComponentsConfiguration)),
 				new Description ("exif:LightSource", Catalog.GetString ("Light Source"),
-						 typeof (FSpot.Tiff.LightSource)),
+						 typeof (FSpot.Imaging.Tiff.LightSource)),
 				new Description ("exif:SensingMethod", Catalog.GetString ("Sensing Method"),
-						 typeof (FSpot.Tiff.SensingMethod)),
+						 typeof (FSpot.Imaging.Tiff.SensingMethod)),
 				new Description ("exif:ColorSpace", Catalog.GetString ("Color Space"),
-						 typeof (FSpot.Tiff.ColorSpace)),
+						 typeof (FSpot.Imaging.Tiff.ColorSpace)),
 				new Description ("exif:WhiteBalance", Catalog.GetString ("White Balance"),
-						 typeof (FSpot.Tiff.WhiteBalance)),
+						 typeof (FSpot.Imaging.Tiff.WhiteBalance)),
 				new Description ("exif:FocalPlaneResolutionUnit", Catalog.GetString ("Focal Plane Resolution Unit"),
-						 typeof (FSpot.Tiff.ResolutionUnit)),
+						 typeof (FSpot.Imaging.Tiff.ResolutionUnit)),
 				new Description ("exif:FileSource", Catalog.GetString ("File Source Type"),
-						 typeof (FSpot.Tiff.FileSource)),
+						 typeof (FSpot.Imaging.Tiff.FileSource)),
 				new Description ("exif:SceneCaptureType", Catalog.GetString ("Scene Capture Type"),
-						 typeof (FSpot.Tiff.SceneCaptureType)),
+						 typeof (FSpot.Imaging.Tiff.SceneCaptureType)),
 						 /* Translators: Gain Control is the label for the exif:GainControl tag
 						    "This tag indicates the degree of overall image gain adjustment." */
 				new Description ("exif:GainControl", Catalog.GetString ("Gain Control"),
-						 typeof (FSpot.Tiff.GainControl)),
+						 typeof (FSpot.Imaging.Tiff.GainControl)),
 				new Description ("exif:Contrast", Catalog.GetString ("Contrast"),
-						 typeof (FSpot.Tiff.Contrast)),
+						 typeof (FSpot.Imaging.Tiff.Contrast)),
 				new Description ("exif:Saturation", Catalog.GetString ("Saturation"),
-						 typeof (FSpot.Tiff.Saturation)),
+						 typeof (FSpot.Imaging.Tiff.Saturation)),
 				new Description ("exif:Sharpness", Catalog.GetString ("Sharpness"),
-						 typeof (FSpot.Tiff.Sharpness)),
+						 typeof (FSpot.Imaging.Tiff.Sharpness)),
 				new Description ("exif:SceneType", Catalog.GetString ("Scene Type"),
-						 typeof (FSpot.Tiff.SceneType))
+						 typeof (FSpot.Imaging.Tiff.SceneType))
 
 
 
@@ -151,7 +153,7 @@ namespace FSpot {
 			}
 			/*
 			else if (type == typeof (Rational)) {
-				object o = FSpot.Tiff.Rational.Parse (obj.Value);
+				object o = Tiff.Rational.Parse (obj.Value);
 			} 
 			*/
 			return result;
diff --git a/src/PhotoLoader.cs b/src/PhotoLoader.cs
index 9a6eedb..38b9cad 100644
--- a/src/PhotoLoader.cs
+++ b/src/PhotoLoader.cs
@@ -1,6 +1,7 @@
 using System;
 
 using FSpot.Platform;
+using FSpot.Imaging;
 using Hyena;
 
 namespace FSpot {
diff --git a/src/PixbufUtils.cs b/src/PixbufUtils.cs
index 2ab1044..7b44a92 100644
--- a/src/PixbufUtils.cs
+++ b/src/PixbufUtils.cs
@@ -16,6 +16,8 @@ using System;
 using System.IO;
 using FSpot;
 using FSpot.Utils;
+using FSpot.Imaging;
+using FSpot.Imaging.Exif;
 using Hyena;
 using TagLib.Image;
 
@@ -291,7 +293,7 @@ public class PixbufUtils {
 	
 	public static Pixbuf TagIconFromPixbuf (Pixbuf source)
 	{
-		return IconFromPixbuf (source, (int) Tag.IconSize.Large);
+		return IconFromPixbuf (source, (int) FSpot.Tag.IconSize.Large);
 	}
 
 	public static Pixbuf IconFromPixbuf (Pixbuf source, int size)
@@ -415,7 +417,7 @@ public class PixbufUtils {
 	[DllImport ("libfspot")]
 	static extern bool f_pixbuf_save_jpeg (IntPtr src, string path, int quality, FPixbufJpegMarker [] markers, int num_markers);
 
-	public static void SaveJpeg (Pixbuf pixbuf, string path, int quality, Exif.ExifData exif_data)
+	public static void SaveJpeg (Pixbuf pixbuf, string path, int quality, ExifData exif_data)
 	{
 		Pixbuf temp = null;
 		if (pixbuf.HasAlpha) {
@@ -436,16 +438,16 @@ public class PixbufUtils {
 			exif_data.Data = thumb_data;
 
 			// Most of the things we will set will be in the 0th ifd
-			Exif.ExifContent content = exif_data.GetContents (Exif.Ifd.Zero);
+			var content = exif_data.GetContents (FSpot.Imaging.Exif.Ifd.Zero);
 
 			// reset the orientation tag the default is top/left
-			content.GetEntry (Exif.Tag.Orientation).Reset ();
+			content.GetEntry (FSpot.Imaging.Exif.Tag.Orientation).Reset ();
 
 			// set the write time in the datetime tag
-			content.GetEntry (Exif.Tag.DateTime).Reset ();
+			content.GetEntry (FSpot.Imaging.Exif.Tag.DateTime).Reset ();
 
 			// set the software tag
-			content.GetEntry (Exif.Tag.Software).SetData (FSpot.Defines.PACKAGE + " version " + FSpot.Defines.VERSION);
+			content.GetEntry (FSpot.Imaging.Exif.Tag.Software).SetData (FSpot.Defines.PACKAGE + " version " + FSpot.Defines.VERSION);
 
 			data = exif_data.Save ();
 		}
@@ -639,7 +641,7 @@ public class PixbufUtils {
 		}
 	}
 
-	public static Gdk.Pixbuf GetThumbnail (Exif.ExifData data)
+	public static Gdk.Pixbuf GetThumbnail (ExifData data)
 	{
 		byte [] thumb_data = data.Data;
 		if (thumb_data.Length > 0) {
@@ -658,11 +660,11 @@ public class PixbufUtils {
 		return null;
 	}
 
-	public static ImageOrientation GetOrientation (Exif.ExifData data)
+	public static ImageOrientation GetOrientation (ExifData data)
 	{
 		ImageOrientation orientation = ImageOrientation.TopLeft;
 		
-		Exif.ExifEntry e = data.GetContents (Exif.Ifd.Zero).Lookup (Exif.Tag.Orientation);
+		FSpot.Imaging.Exif.ExifEntry e = data.GetContents (FSpot.Imaging.Exif.Ifd.Zero).Lookup (FSpot.Imaging.Exif.Tag.Orientation);
 
 		if (e != null) {
 			ushort [] value = e.GetDataUShort ();
@@ -674,7 +676,7 @@ public class PixbufUtils {
 
 	public static ImageOrientation GetOrientation (SafeUri uri)
 	{
-		using (FSpot.ImageFile img = FSpot.ImageFile.Create (uri)) {
+		using (ImageFile img = ImageFile.Create (uri)) {
 			return img.Orientation;
 		}	
 	}
diff --git a/src/PrintOperation.cs b/src/PrintOperation.cs
index a917db8..7c3045b 100644
--- a/src/PrintOperation.cs
+++ b/src/PrintOperation.cs
@@ -13,6 +13,7 @@ using System.Runtime.InteropServices;
 using Mono.Unix;
 
 using FSpot.Widgets;
+using FSpot.Imaging;
 using Hyena;
 
 namespace FSpot
diff --git a/src/RotateCommand.cs b/src/RotateCommand.cs
index 1126411..f095d84 100644
--- a/src/RotateCommand.cs
+++ b/src/RotateCommand.cs
@@ -15,7 +15,7 @@ using Gtk;
 using Gdk;
 
 using FSpot;
-using FSpot.Png;
+using FSpot.Imaging.Png;
 using FSpot.UI.Dialog;
 
 using Hyena;
diff --git a/src/UI.Dialog/EditTagIconDialog.cs b/src/UI.Dialog/EditTagIconDialog.cs
index 663da78..e58d206 100644
--- a/src/UI.Dialog/EditTagIconDialog.cs
+++ b/src/UI.Dialog/EditTagIconDialog.cs
@@ -16,6 +16,7 @@ using Mono.Unix;
 using Gtk;
 using FSpot.Widgets;
 using FSpot.Utils;
+using FSpot.Imaging;
 using Hyena;
 using Hyena.Widgets;
 
@@ -156,7 +157,7 @@ namespace FSpot.UI.Dialog
 		void CreateTagIconFromExternalPhoto ()
 		{
 			try {
-				using (FSpot.ImageFile img = FSpot.ImageFile.Create (new SafeUri(external_photo_chooser.Uri, true))) {
+				using (ImageFile img = ImageFile.Create (new SafeUri(external_photo_chooser.Uri, true))) {
 					using (Gdk.Pixbuf external_image = img.Load ()) {
 						PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (external_image);
 					}
diff --git a/src/UriCollection.cs b/src/UriCollection.cs
index 367a112..a6a2623 100644
--- a/src/UriCollection.cs
+++ b/src/UriCollection.cs
@@ -20,6 +20,8 @@ using System.Xml;
 using Hyena;
 using GLib;
 
+using FSpot.Imaging;
+
 namespace FSpot {
 	public class UriCollection : PhotoList {
 		public UriCollection () : base (new IBrowsableItem [0])
@@ -38,7 +40,7 @@ namespace FSpot {
 
 		public void Add (SafeUri uri)
 		{
-			if (FSpot.ImageFile.HasLoader (uri)) {
+			if (ImageFile.HasLoader (uri)) {
 				//Console.WriteLine ("using image loader {0}", uri.ToString ());
 				Add (new FileBrowsableItem (uri));
 			} else {
@@ -128,7 +130,7 @@ namespace FSpot {
 				foreach (GLib.FileInfo info in file.EnumerateChildrenFinish (res)) {
 					SafeUri i = new SafeUri (file.GetChild (info.Name).Uri);
 					Hyena.Log.DebugFormat ("testing uri = {0}", i);
-					if (FSpot.ImageFile.HasLoader (i))
+					if (ImageFile.HasLoader (i))
 						items.Add (new FileBrowsableItem (i));
 				}
 				Gtk.Application.Invoke (items, System.EventArgs.Empty, delegate (object sender, EventArgs args) {
@@ -141,7 +143,7 @@ namespace FSpot {
 		{
 			List<IBrowsableItem> items = new List<IBrowsableItem> ();
 			foreach (var f in files) {
-				if (FSpot.ImageFile.HasLoader (new SafeUri (f.FullName))) {
+				if (ImageFile.HasLoader (new SafeUri (f.FullName))) {
 					Hyena.Log.Debug (f.FullName);
 					items.Add (new FileBrowsableItem (new SafeUri (f.FullName)));
 				}
diff --git a/src/Widgets/ImageInfo.cs b/src/Widgets/ImageInfo.cs
index 6ca6ccb..12a7a81 100644
--- a/src/Widgets/ImageInfo.cs
+++ b/src/Widgets/ImageInfo.cs
@@ -11,6 +11,7 @@ using Cairo;
 using Gdk;
 using Gtk;
 using FSpot.Utils;
+using FSpot.Imaging;
 using Hyena;
 
 namespace FSpot.Widgets {
diff --git a/src/Widgets/InfoBox.cs b/src/Widgets/InfoBox.cs
index a8084ea..9c2043a 100644
--- a/src/Widgets/InfoBox.cs
+++ b/src/Widgets/InfoBox.cs
@@ -16,7 +16,8 @@
 using Gtk;
 using System;
 using System.IO;
-using FSpot;
+using FSpot.Imaging;
+using FSpot.Imaging.Tiff;
 using SemWeb;
 using Mono.Unix;
 using FSpot.Utils;
@@ -305,9 +306,6 @@ namespace FSpot.Widgets
 	
 			MemoryStore store;
 			
-	#if USE_EXIF_DATE
-			DateTime date;
-	#endif
 			public ImageInfo (ImageFile img) 
 			{
 				// FIXME We use the memory store to hold the anonymous statements
@@ -330,7 +328,7 @@ namespace FSpot.Widgets
 					}
 				}
 	
-				if (img is JpegFile) {
+				if (img is Imaging.JpegFile) {
 					int real_width;
 					int real_height;
 	
@@ -338,9 +336,6 @@ namespace FSpot.Widgets
 					width = real_width.ToString ();
 					height = real_height.ToString ();
 				}
-	#if USE_EXIF_DATE
-				date = img.Date;
-	#endif
 			}
 	
 			public bool Add (SemWeb.Statement stmt)
@@ -385,7 +380,7 @@ namespace FSpot.Widgets
 	
 					if  (fnumber != null && fnumber != String.Empty) {
 						try {
-							FSpot.Tiff.Rational rat = new FSpot.Tiff.Rational (fnumber);
+							var rat = new Rational (fnumber);
 							info += String.Format ("f/{0:.0} ", rat.Value);
 						} catch (FormatException) {
 							return Catalog.GetString("(wrong format)");
@@ -393,7 +388,7 @@ namespace FSpot.Widgets
 					} else if (aperture != null && aperture != String.Empty) {
 						try {
 							// Convert from APEX to fnumber
-							FSpot.Tiff.Rational rat = new FSpot.Tiff.Rational (aperture);
+							var rat = new Rational (aperture);
 							info += String.Format ("f/{0:.0} ", Math.Pow (2, rat.Value / 2));
 						} catch (FormatException) {
 							return Catalog.GetString ("(wrong format)");
@@ -452,16 +447,6 @@ namespace FSpot.Widgets
 						return Catalog.GetString ("(Unknown)");
 				}
 			}
-	#if USE_EXIF_DATE
-			public string Date {
-				get {
-					if (date > DateTime.MinValue && date < DateTime.MaxValue)
-						return date.ToShortDateString () + Environment.NewLine + date.ToShortTimeString ();
-					else 
-						return Catalog.GetString ("(Unknown)");
-				}
-			}
-	#endif
 		}
 			
 	
@@ -522,16 +507,12 @@ namespace FSpot.Widgets
 			size_value_label.Visible = show_size;
 
 			if (show_date) {
-	#if USE_EXIF_DATE
-				date_value_label.Text = info.Date;
-	#else
 				DateTime local_time = photo.Time;
 				date_value_label.Text = String.Format ("{0}{2}{1}",
 				                                       local_time.ToShortDateString (),
 				                                       local_time.ToShortTimeString (),
 				                                       Environment.NewLine
 				                                       );
-	#endif
 			}
 			date_label.Visible = show_date;
 			date_value_label.Visible = show_date;
diff --git a/src/Widgets/MetadataDisplay.cs b/src/Widgets/MetadataDisplay.cs
index 1d21776..c23b3e9 100644
--- a/src/Widgets/MetadataDisplay.cs
+++ b/src/Widgets/MetadataDisplay.cs
@@ -18,6 +18,8 @@ using Gtk;
 using Mono.Unix;
 
 using FSpot.Extensions;
+using FSpot.Imaging;
+using FSpot.Imaging.Exif;
 
 namespace FSpot.Widgets {
 	public class MetadataDisplayPage : SidebarPage {
@@ -115,7 +117,7 @@ namespace FSpot.Widgets {
 			update_delay.Start ();
 		}
 		
-		private Exif.ExifData exif_info;
+		private ExifData exif_info;
 
 		private IBrowsableItem photo;
 		public IBrowsableItem Photo {
@@ -132,7 +134,7 @@ namespace FSpot.Widgets {
 
 				if (photo != null) {
 					if (File.Exists (photo.DefaultVersion.Uri.LocalPath))
-						exif_info = new Exif.ExifData (photo.DefaultVersion.Uri.LocalPath);
+						exif_info = new ExifData (photo.DefaultVersion.Uri.LocalPath);
 				} else {
 					exif_info = null;
 				}
@@ -275,8 +277,8 @@ namespace FSpot.Widgets {
 			
 			// Write Exif-Data
 			if (exif_info != null) {
-				foreach (Exif.ExifContent content in exif_info.GetContents ()) {
-					Exif.ExifEntry [] entries = content.GetEntries ();
+				foreach (ExifContent content in exif_info.GetContents ()) {
+					ExifEntry [] entries = content.GetEntries ();
 					
 					i++;
 					
@@ -285,7 +287,7 @@ namespace FSpot.Widgets {
 					
 					empty = false;
 										
-					name = Exif.ExifUtil.GetIfdNameExtended ((Exif.Ifd)i - 1);
+					name = ExifUtil.GetIfdNameExtended ((Ifd)i - 1);
 					
 					if (index_of_expander >= exif_vbox.Children.Length)
 						model = AddExpander (name, index_of_expander);
@@ -300,7 +302,7 @@ namespace FSpot.Widgets {
 					
 					model.GetIterFirst(out iter);
 				
-					foreach (Exif.ExifEntry entry in entries) {
+					foreach (ExifEntry entry in entries) {
 						string s;
 						
 						if (entry.Title != null)
diff --git a/src/Widgets/SlideShow.cs b/src/Widgets/SlideShow.cs
index f6d9d22..851053d 100644
--- a/src/Widgets/SlideShow.cs
+++ b/src/Widgets/SlideShow.cs
@@ -15,6 +15,7 @@ using Gdk;
 using Mono.Addins;
 using FSpot.Bling;
 using FSpot.Extensions;
+using FSpot.Imaging;
 
 namespace FSpot.Widgets
 {
diff --git a/src/XmpTagsImporter.cs b/src/XmpTagsImporter.cs
index 34f6621..589bbdb 100644
--- a/src/XmpTagsImporter.cs
+++ b/src/XmpTagsImporter.cs
@@ -14,7 +14,8 @@ using System.Collections;
 using System.Collections.Generic;
 using System.IO;
 using System.Xml;
-using FSpot.Xmp;
+using FSpot.Imaging;
+using FSpot.Imaging.Xmp;
 using SemWeb;
 using SemWeb.Util;
 using Mono.Unix;
diff --git a/src/main.cs b/src/main.cs
index a95625c..a99a214 100644
--- a/src/main.cs
+++ b/src/main.cs
@@ -12,6 +12,7 @@ using Mono.Addins.Setup;
 using FSpot.Utils;
 using FSpot.UI.Dialog;
 using FSpot.Extensions;
+using FSpot.Imaging;
 using Hyena;
 using Hyena.CommandLine;
 using Hyena.Gui;



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