[f-spot/taglib-metadata] Remove unused and unneeded code for a bunch of RAW formats.



commit 23e9a92a3dcb0942f5d15af15d6437457c5f06d1
Author: Ruben Vermeersch <ruben savanne be>
Date:   Tue Jul 6 00:01:23 2010 +0200

    Remove unused and unneeded code for a bunch of RAW formats.

 src/Imaging/Ciff.cs      |   19 ----
 src/Imaging/DCRawFile.cs |   97 -------------------
 src/Imaging/Exif.cs      |    1 -
 src/Imaging/ImageFile.cs |    4 +-
 src/Imaging/MrwFile.cs   |  236 ----------------------------------------------
 src/Imaging/Tiff.cs      |    2 -
 src/Imaging/X3fFile.cs   |  105 --------------------
 src/Makefile.am          |    2 -
 8 files changed, 2 insertions(+), 464 deletions(-)
---
diff --git a/src/Imaging/Ciff.cs b/src/Imaging/Ciff.cs
index c793132..fd2022f 100644
--- a/src/Imaging/Ciff.cs
+++ b/src/Imaging/Ciff.cs
@@ -94,7 +94,6 @@ namespace FSpot.Imaging.Ciff {
 		public uint ImageWidth;  // Number of horizontal pixels
 		public uint ImageHeight; // Number of vertical pixels
 		public float PixelAspectRatio;
-		public int RotationAngle;  // degrees counter clockwise to rotate (orientation)
 		public uint ComponentBitDepth; // bits per component
 		public uint ColorBitDepth; // bits per component * channels
 		public uint ColorBW; //  byte wise:  0 gray - 1 color ; byte 2 use aspect ratio ; 3 and 4 reserved
@@ -105,29 +104,12 @@ namespace FSpot.Imaging.Ciff {
 			ImageHeight = BitConverter.ToUInt32 (data, 4, little);
 
 			PixelAspectRatio = BitConverter.ToSingle (data, 8, little);
-			RotationAngle = BitConverter.ToInt32 (data, 12, little);
 			ComponentBitDepth = BitConverter.ToUInt32 (data, 16, little);
 			ColorBitDepth = BitConverter.ToUInt32 (data, 20, little);
 			ColorBW = BitConverter.ToUInt32 (data, 24, little);
 			Log.DebugFormat ("0x{0}", ColorBW.ToString ("x"));
 		}
 
-		public ImageOrientation Orientation {
-			get {
-				int angle = RotationAngle % 360;
-				if (angle < 45)
-					return ImageOrientation.TopLeft;
-				else if (angle < 135)
-					return ImageOrientation.RightTop;
-				else if (angle < 225)
-					return ImageOrientation.BottomRight;
-				else if (angle < 315)
-					return ImageOrientation.LeftBottom;
-				else
-					return ImageOrientation.TopLeft;
-			}
-		}
-
 		public bool IsColor {
 			get {
 				return (ColorBW & 1) > 0;
@@ -342,7 +324,6 @@ namespace FSpot.Imaging.Ciff {
 			data = props.ReadEntry (Tag.ImageSpec);
 			if (data != null) {
 				ImageSpec spec = new ImageSpec (data, little);
-				MetadataStore.AddLiteral (sink, "tiff:Orientation", ((int)spec.Orientation).ToString ());
 				MetadataStore.AddLiteral (sink, "tiff:ImageWidth", spec.ImageWidth.ToString ());
 				MetadataStore.AddLiteral (sink, "tiff:ImageLength", spec.ImageHeight.ToString ());
 				string comp = spec.ComponentBitDepth.ToString ();
diff --git a/src/Imaging/DCRawFile.cs b/src/Imaging/DCRawFile.cs
index fd8e5b9..971b3f1 100644
--- a/src/Imaging/DCRawFile.cs
+++ b/src/Imaging/DCRawFile.cs
@@ -4,74 +4,6 @@ using System;
 using Hyena;
 
 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
-		// the stream.
-		Process process;
-		Stream stream;
-
-		public override bool CanRead {
-			get { return stream.CanRead; }
-		}
-
-		public override bool CanSeek {
-			get { return stream.CanSeek; }
-		}
-
-		public override bool CanWrite {
-			get { return stream.CanWrite; }
-		}
-		
-		public override long Length {
-			get { return stream.Length; }
-		}
-
-		public override long Position {
-			get { return stream.Position; }
-			set { stream.Position = value; }
-		}
-
-		public Pipe (Process p, Stream stream)
-		{
-			this.process = p;
-			this.stream = stream;
-		}
-		
-		public override void Flush ()
-		{
-			stream.Flush ();
-		}
-
-		public override int Read (byte [] b, int s, int l)
-		{
-			return stream.Read (b, s, l);
-		}
-
-		public override long Seek (long l, SeekOrigin origin)
-		{
-			return stream.Seek(l, origin);
-		}
-		
-		public override void SetLength (long l)
-		{
-			stream.SetLength (l);
-		}
-
-		public override void Write (byte [] b, int s, int l)
-		{
-			stream.Write (b, s, l);
-		}
-		
-		public override void Close ()
-		{
-			stream.Close ();
-			stream = null;
-			process.Dispose ();
-			process = null;
-		}
-	}
-
 	public class DCRawFile : BaseImageFile {
 		const string dcraw_command = "dcraw";
 
@@ -93,34 +25,5 @@ namespace FSpot.Imaging {
 			proc.StandardInput.Close ();
 			return proc.StandardOutput;
 		}
-		
-		public static System.IO.Stream RawPixbufStreamOld (string path)
-		{
-			// FIXME this filename quoting is super lame
-			string args = System.String.Format ("-h -w -c -t 0 \"{0}\"", path);
-
-			System.Diagnostics.Process process = new System.Diagnostics.Process ();
-			process.StartInfo = new System.Diagnostics.ProcessStartInfo (dcraw_command, args);
-			process.StartInfo.RedirectStandardOutput = true;
-			process.StartInfo.UseShellExecute = false;
-			process.Start ();
-			return new Pipe (process, process.StandardOutput.BaseStream);
-		}
-		
-		public static Gdk.Pixbuf Load (string path, string args)
-		{
-			// FIXME this filename quoting is super lame
-			args = System.String.Format ("-h -w -c \"{0}\"", path);
-
-			Log.DebugFormat ("path = {0}, args = \"{1}\"", path, args);
-			 
-			using (System.Diagnostics.Process process = new System.Diagnostics.Process ()) {
-				process.StartInfo = new System.Diagnostics.ProcessStartInfo (dcraw_command, args);
-				process.StartInfo.RedirectStandardOutput = true;
-				process.StartInfo.UseShellExecute = false;
-				process.Start ();
-				return PixbufUtils.LoadFromStream (process.StandardOutput.BaseStream);
-			}
-		}
 	}
 }
diff --git a/src/Imaging/Exif.cs b/src/Imaging/Exif.cs
index b11c1f2..28a2574 100644
--- a/src/Imaging/Exif.cs
+++ b/src/Imaging/Exif.cs
@@ -31,7 +31,6 @@ namespace FSpot.Imaging.Exif {
 		Make 				= 0x010f,
 		Model 				= 0x0110,
 		StripOffsets 			= 0x0111,
-		Orientation 			= 0x0112,
 		SamplesPerPixel 		= 0x0115,
 		RowsPerStrip    		= 0x0116,
 		StripByteCounts 		= 0x0117,
diff --git a/src/Imaging/ImageFile.cs b/src/Imaging/ImageFile.cs
index f374092..47fb40f 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Imaging/ImageFile.cs
@@ -51,9 +51,9 @@ namespace FSpot.Imaging {
 			name_table [".dng"] = typeof (FSpot.Imaging.Tiff.DngFile);
 			name_table [".crw"] = typeof (FSpot.Imaging.Ciff.CiffFile);
 			name_table [".ppm"] = typeof (BaseImageFile);
-			name_table [".mrw"] = typeof (FSpot.Imaging.Mrw.MrwFile);
+			name_table [".mrw"] = typeof (FSpot.Imaging.DCRawFile);
 			name_table [".raf"] = typeof (FSpot.Imaging.Raf.RafFile);
-			name_table [".x3f"] = typeof (FSpot.Imaging.X3f.X3fFile);
+			name_table [".x3f"] = typeof (FSpot.Imaging.DCRawFile);
 
 			// add mimetypes for fallback
 			name_table ["image/bmp"]     = name_table ["image/x-bmp"] = name_table [".bmp"];
diff --git a/src/Imaging/Tiff.cs b/src/Imaging/Tiff.cs
index fae7d8e..2a4ae69 100644
--- a/src/Imaging/Tiff.cs
+++ b/src/Imaging/Tiff.cs
@@ -82,7 +82,6 @@ namespace FSpot.Imaging.Tiff {
 		Make 				= 0x010f,
 		Model 				= 0x0110,
 		StripOffsets 			= 0x0111,
-		Orientation 			= 0x0112,
 		SamplesPerPixel 		= 0x0115,
 		RowsPerStrip    		= 0x0116,
 		StripByteCounts 		= 0x0117,
@@ -1056,7 +1055,6 @@ namespace FSpot.Imaging.Tiff {
 				case TagId.BitsPerSample:
 					MetadataStore.Add (sink, "tiff:" + e.Id.ToString (), "rdf:Seq", e.ValueAsString);
 					break;
-				case TagId.Orientation:
 				case TagId.Compression:
 				case TagId.PhotometricInterpretation:					
 				case TagId.SamplesPerPixel:
diff --git a/src/Makefile.am b/src/Makefile.am
index e7408b6..2a07666 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -90,11 +90,9 @@ SOURCES = \
 	Imaging/InternalProcess.cs \
 	Imaging/IptcFile.cs \
 	Imaging/IOChannel.cs \
-	Imaging/MrwFile.cs \
 	Imaging/OrderedWriter.cs \
 	Imaging/PixelBuffer.cs \
 	Imaging/RafFile.cs \
-	Imaging/X3fFile.cs \
 	Imaging/XmpFile.cs \
 	Imaging/Tiff.cs \
 	JobStore.cs \



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