[f-spot/rubenv-gsoc-2009: 79/86] Kill PixbufStream, obsoleted by IImageLoader.



commit add7005c99be43118a01857812c7264c48a93774
Author: Ruben Vermeersch <ruben savanne be>
Date:   Thu Aug 13 20:31:05 2009 +0200

    Kill PixbufStream, obsoleted by IImageLoader.

 src/Imaging/Ciff.cs            |   10 ---
 src/Imaging/DCRawFile.cs       |  129 ----------------------------------------
 src/Imaging/ImageFile.cs       |    7 +--
 src/Imaging/InternalProcess.cs |   77 ------------------------
 src/Imaging/JpegFile.cs        |   14 ----
 src/Imaging/MrwFile.cs         |    5 --
 src/Imaging/PnmFile.cs         |   11 ----
 src/Imaging/RafFile.cs         |   10 ---
 src/Imaging/Tiff.cs            |   66 --------------------
 src/Imaging/X3fFile.cs         |    2 +-
 src/Makefile.am                |    2 -
 11 files changed, 2 insertions(+), 331 deletions(-)
---
diff --git a/src/Imaging/Ciff.cs b/src/Imaging/Ciff.cs
index 2114d31..fddd72e 100644
--- a/src/Imaging/Ciff.cs
+++ b/src/Imaging/Ciff.cs
@@ -446,16 +446,6 @@ namespace FSpot.Ciff {
 			}
 		}
 
-		public override System.IO.Stream PixbufStream ()
-		{
-			byte [] data = GetEmbeddedJpeg ();
-			
-			if (data != null)
-				return new System.IO.MemoryStream (data);
-			else	
-				return DCRawFile.RawPixbufStream (uri);
-		}
-
 		public void Dump ()
 		{
 			Root.Dump ();
diff --git a/src/Imaging/ImageFile.cs b/src/Imaging/ImageFile.cs
index 6b255a7..3ca7a34 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Imaging/ImageFile.cs
@@ -47,11 +47,6 @@ namespace FSpot {
 			return new GLib.GioStream (GLib.FileFactory.NewForUri (uri).Read (null));
 		}
 
-		public virtual Stream PixbufStream ()
-		{
-			return Open ();
-		}
-
 		public static void AddExtension (string extension, Type type)
 		{
 			name_table [extension] = type;
@@ -67,7 +62,7 @@ namespace FSpot {
 			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 [".cr2"] = typeof (FSpot.Tiff.TiffFile);
 			name_table [".nef"] = typeof (FSpot.Tiff.NefFile);
 			name_table [".pef"] = typeof (FSpot.Tiff.NefFile);
 			name_table [".raw"] = typeof (FSpot.Tiff.NefFile);
diff --git a/src/Imaging/JpegFile.cs b/src/Imaging/JpegFile.cs
index 8c5ec5b..aed3632 100644
--- a/src/Imaging/JpegFile.cs
+++ b/src/Imaging/JpegFile.cs
@@ -55,20 +55,6 @@ namespace FSpot {
 			}
 		}
 
-		public override Stream PixbufStream ()
-		{
-			if (header != null)
-				return Open ();
-
-			Stream s = Open ();
-			if (s.CanSeek) {
-				header = new JpegHeader (s, true);
-				s.Position = 0;
-			} else
-				Console.WriteLine ("{0} can not seek :(", s);
-			return s;
-		}
-
 		public void Select (SemWeb.StatementSink sink)
 		{
 			Header.Select (sink);
diff --git a/src/Imaging/MrwFile.cs b/src/Imaging/MrwFile.cs
index 07dae42..4ded12f 100644
--- a/src/Imaging/MrwFile.cs
+++ b/src/Imaging/MrwFile.cs
@@ -213,11 +213,6 @@ namespace FSpot.Mrw {
 			this.Header.Select (sink);
 		}
 
-		public override System.IO.Stream PixbufStream ()
-		{
-			return DCRawFile.RawPixbufStream (uri);
-		}
-		
 		protected void LoadBlocks () 
 		{
 			using (System.IO.Stream file = Open ()) {
diff --git a/src/Imaging/PnmFile.cs b/src/Imaging/PnmFile.cs
index 8ca1c50..f68ffb3 100644
--- a/src/Imaging/PnmFile.cs
+++ b/src/Imaging/PnmFile.cs
@@ -61,17 +61,6 @@ namespace FSpot.Pnm {
 			}
 		}
 		
-		public override Stream PixbufStream ()
-		{
-			Stream stream = Open ();
-			Header header = new Header (stream);
-			if (header.IsDeep)
-				return null;
-
-			stream.Position = 0;
-			return stream;
-		}
-
 		static char EatComment (Stream stream)
 		{
 			char c;
diff --git a/src/Imaging/RafFile.cs b/src/Imaging/RafFile.cs
index cb63a00..7f55ae2 100644
--- a/src/Imaging/RafFile.cs
+++ b/src/Imaging/RafFile.cs
@@ -62,16 +62,6 @@ namespace FSpot.Raf {
 		{
 		}
 
-		public override System.IO.Stream PixbufStream ()
-		{
-			byte [] data = GetEmbeddedJpeg ();
-			
-			if (data != null)
-				return new System.IO.MemoryStream (data);
-			else
-				return DCRawFile.RawPixbufStream (uri);
-		}
- 
 		public void Select (SemWeb.StatementSink sink)
 		{
 			byte [] data = GetEmbeddedJpeg ();
diff --git a/src/Imaging/Tiff.cs b/src/Imaging/Tiff.cs
index c26ae24..507bdad 100644
--- a/src/Imaging/Tiff.cs
+++ b/src/Imaging/Tiff.cs
@@ -2078,11 +2078,6 @@ namespace FSpot.Tiff {
 					return base.Date;
 			}
 		}
-		
-		public override System.IO.Stream PixbufStream ()
-		{
-			return Open ();
-		}
 
 		public override PixbufOrientation GetOrientation ()
 		{
@@ -2139,21 +2134,6 @@ namespace FSpot.Tiff {
 		{
 		}
 
-		public override System.IO.Stream PixbufStream ()
-		{
-			try {
-				SubdirectoryEntry sub = (SubdirectoryEntry) Header.Directory.Lookup (TagId.SubIFDs);
-				ImageDirectory directory = sub.Directory [sub.Directory.Length - 1];
-
-				uint offset = directory.Lookup (TagId.StripOffsets).ValueAsLong [0];
-				System.IO.Stream file = Open ();
-				file.Position = offset;
-				return file;
-			} catch {
-				return DCRawFile.RawPixbufStream (uri);
-			}
-		}
-
 		public override void Select (SemWeb.StatementSink sink)
 		{
 			
@@ -2257,52 +2237,6 @@ namespace FSpot.Tiff {
 				i++;
 			} while (i < sub.Directory.Length);
 		}
-
-		public override System.IO.Stream PixbufStream ()
-		{
-			try {
-				SubdirectoryEntry sub = (SubdirectoryEntry) Header.Directory.Lookup (TagId.SubIFDs);
-				ImageDirectory jpeg_directory = sub.Directory [0];
-				return LookupJpegSubstream (jpeg_directory);
-			} catch (System.Exception) {
-				return DCRawFile.RawPixbufStream (uri);
-			}
-		}
 	}
-		
-
-	public class Cr2File : TiffFile, IRawFile {
-		public Cr2File (string path) : base (path) 
-		{
-		}
-
-		public Cr2File (Uri uri) : base (uri)
-		{
-//							Gtk.MessageDialog md = new Gtk.MessageDialog (null, 
-//							                                              Gtk.DialogFlags.DestroyWithParent,
-//							                                              Gtk.MessageType.Error, 
-//							                                              Gtk.ButtonsType.Close,
-//							                                              "bca");
-//	
-//							int result = md.Run ();
-//							md.Destroy();
-		}
-
-		/*
-		public override PixbufOrientation GetOrientation ()
-		{
-			return PixbufOrientation.TopLeft;
-		}
-		*/
-
-		public override System.IO.Stream PixbufStream ()
-		{
-			uint offset = Header.Directory.Lookup (TagId.StripOffsets).ValueAsLong [0];
-			System.IO.Stream file = Open ();
-			file.Position = offset;
-			return file;
-		}
-	}
-
 }
 
diff --git a/src/Imaging/X3fFile.cs b/src/Imaging/X3fFile.cs
index 372c27d..61852b9 100644
--- a/src/Imaging/X3fFile.cs
+++ b/src/Imaging/X3fFile.cs
@@ -73,7 +73,7 @@ namespace FSpot.X3f {
 
 	}
 
-	public class X3fFile : DCRawFile, IRawFile, SemWeb.StatementSource {
+	public class X3fFile : ImageFile, IRawFile, SemWeb.StatementSource {
 		Info info;
 
                 // false seems a safe default
diff --git a/src/Makefile.am b/src/Makefile.am
index c09f6f3..d668802 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,14 +42,12 @@ CORE_CSDISTFILES =				\
 
 IMAGING_CSDISTFILES =						\
 	$(srcdir)/Imaging/PixbufUtils.cs		\
-	$(srcdir)/Imaging/DCRawFile.cs			\
 	$(srcdir)/Imaging/BitConverter.cs		\
 	$(srcdir)/Imaging/Bim.cs				\
 	$(srcdir)/Imaging/Ciff.cs				\
 	$(srcdir)/Imaging/Exif.cs				\
 	$(srcdir)/Imaging/ImageFile.cs			\
 	$(srcdir)/Imaging/IptcFile.cs			\
-	$(srcdir)/Imaging/InternalProcess.cs	\
 	$(srcdir)/Imaging/IOChannel.cs			\
 	$(srcdir)/Imaging/IRawFile.cs			\
 	$(srcdir)/Imaging/IWritableImageFile.cs	\



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