[f-spot/taglib-metadata: 17/20] Remove a pile of unused code.



commit d934c102755b592708c065aa4200518eac017174
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat Jun 26 20:10:22 2010 +0200

    Remove a pile of unused code.

 src/Imaging/Ciff.cs    |   64 ++---------------------------------------------
 src/XmpTagsImporter.cs |   32 +-----------------------
 2 files changed, 4 insertions(+), 92 deletions(-)
---
diff --git a/src/Imaging/Ciff.cs b/src/Imaging/Ciff.cs
index b44e548..cd8fddc 100644
--- a/src/Imaging/Ciff.cs
+++ b/src/Imaging/Ciff.cs
@@ -201,7 +201,7 @@ namespace FSpot.Ciff {
 	}
 
 	/* See http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html */
-	public struct Entry {
+	internal struct Entry {
 		internal Tag Tag;
 		internal uint Size;
 		internal uint Offset;
@@ -268,16 +268,6 @@ namespace FSpot.Ciff {
 			}
 		}			
 
-		public void Dump ()
-		{
-			Log.DebugFormat ("Dumping directory with {0} entries", entry_list.Count);
-			for (int i = 0; i < entry_list.Count; i++) {
-				Entry e = (Entry) entry_list[i];
-				Log.DebugFormat ("\tentry[{0}] = {1}.{6}.{5}({4}).{2}-{3}",
-							  i, e.Tag, e.Size, e.Offset, e.Tag.ToString ("x"), (uint)e.Tag & ~(uint)Mask.StorageFormat, e.Type); 
-			}
-		}
-
 		public ImageDirectory ReadDirectory (Tag tag)
 		{
 			foreach (Entry e in entry_list) {
@@ -316,7 +306,6 @@ namespace FSpot.Ciff {
 	
 	public class CiffFile : FSpot.ImageFile , SemWeb.StatementSource {
 		public ImageDirectory root;
-		private uint version;
 		bool little;
 		System.IO.Stream stream;
 
@@ -380,19 +369,10 @@ namespace FSpot.Ciff {
 				MetadataStore.AddLiteral (sink, "tiff:Make", vals [0]); 
 				MetadataStore.AddLiteral (sink, "tiff:Model", vals [1]); 
 			}
-
-			/*
-			// FIXME this doesn't appear to be ascii.
-			data = camera.ReadEntry (Tag.OwnerName);
-			if (data != null) {
-				string name = System.Text.Encoding.ASCII.GetString (data, 0, data.Length - 1);
-				MetadataStore.AddLiteral (sink, "dc:creator", "rdf:Seq", new SemWeb.Literal (name));
-			}
-			*/
 		}
 
 
-		protected ImageDirectory Load (System.IO.Stream stream) 
+		private ImageDirectory Load (System.IO.Stream stream)
 		{
 			byte [] header = new byte [26];  // the spec reserves the first 26 bytes as the header block
 			stream.Read (header, 0, header.Length);
@@ -407,18 +387,10 @@ namespace FSpot.Ciff {
 			if (System.Text.Encoding.ASCII.GetString (header, 6, 8) != "HEAPCCDR") 
 				throw new ImageFormatException ("Invalid Ciff Header Block");
 			
-			version =  BitConverter.ToUInt32 (header, 14, little);
-
-			//
-			
 			long end = stream.Length;
 			return new ImageDirectory (stream, start, end, little);
 		}
 
-		public uint Version {
-			get { return version; }
-		}
-
 		public override ImageOrientation GetOrientation ()
 		{
 			var orientation = ImageOrientation.TopLeft;
@@ -451,41 +423,11 @@ namespace FSpot.Ciff {
 			return scaled;
 		}
 
-		public void Dump ()
-		{
-			Root.Dump ();
-			ImageDirectory props = Root.ReadDirectory (Tag.ImageProps);
-			props.Dump ();
-			/*
-				 string path = "out2.jpg";
-			System.IO.File.Delete (path);
-
-			System.IO.Stream output = System.IO.File.Open (path, System.IO.FileMode.OpenOrCreate);
-			byte [] data = GetEmbeddedThumbnail ();
-			Log.DebugFormat ("data length {0}", data != null ? data.Length : -1);
-			output.Write (data, 0, data.Length);
-			output.Close ();
-			*/
-		}
-
-		public byte [] GetEmbeddedJpeg ()
+		private byte [] GetEmbeddedJpeg ()
 		{
 			return Root.ReadEntry (Tag.JpgFromRaw);
 		}
 
-		public byte [] GetEmbeddedThumbnail ()
-		{
-			return Root.ReadEntry (Tag.ThumbnailImage); 
-		}
-		
-		/*
-		public static void Main (string [] args)
-		{
-			CiffFile ciff = new CiffFile (args [0]);
-			ciff.Dump ();
-		}
-		*/
-
 		protected override void Close ()
 		{
 			if (stream != null) {
diff --git a/src/XmpTagsImporter.cs b/src/XmpTagsImporter.cs
index 990eb38..34f6621 100644
--- a/src/XmpTagsImporter.cs
+++ b/src/XmpTagsImporter.cs
@@ -28,12 +28,9 @@ namespace FSpot.Xmp {
 		static private string LastImportIcon = "gtk-new";
 		static private string PlacesIcon = "emblem-places";
 
-	        const string UserComment = MetadataStore.ExifNS + "UserComment";
+		const string UserComment = MetadataStore.ExifNS + "UserComment";
 		const string Headline = MetadataStore.PhotoshopNS + "Headline";
 		const string Caption = MetadataStore.PhotoshopNS + "Caption";
-		const string CaptionWriter = MetadataStore.PhotoshopNS + "CaptionWriter";
-		const string Credit = MetadataStore.PhotoshopNS + "Credit";
-		const string Category = MetadataStore.PhotoshopNS + "Category";
 		const string Source = MetadataStore.PhotoshopNS + "Source";
 		const string State = MetadataStore.PhotoshopNS + "State";
 		const string Country = MetadataStore.PhotoshopNS + "Country";
@@ -245,30 +242,6 @@ namespace FSpot.Xmp {
 				photo.Rating = urgency;
 			if (rating < System.UInt32.MaxValue)
 				photo.Rating = rating;
-
-#if false	
-			//FIXME: looks like we are doing some questionable repurposing of tags here...
-
-			// We want to construct the following : Description = <Headline> :: <Caption>         
-
-			// only check for more title/comment if you still do not have one.
-			if ((photo.Description == null) || (photo.Description.Length == 0)) {
-				if (descriptions.Contains (Headline)) 
-					photo.Description = descriptions [Headline] as String;
-				// Lets add the Caption to the existing Description (Headline).
-				if (descriptions.Contains (Caption))
-					photo.Description += (( (photo.Description == null) ? "" : " :: ") + descriptions [Caption] as String);
-			}	
-			
-			// only check for more title/comment if you still do not have one. 
-			if ((photo.Description == null) || (photo.Description.Length == 0)) {
-				if (descriptions.Contains (Title)) 
-					photo.Description = descriptions [Title] as String;
-				// Lets add the Description  to the existing Description (Title).
-				if (descriptions.Contains (Description))
-					photo.Description += (( (photo.Description == null) ? "" : " :: ") + descriptions [Description] as String);
-			}
-#endif
 		}
 		
 		public bool Import (Photo photo, SafeUri uri, SafeUri orig_uri)
@@ -307,9 +280,6 @@ namespace FSpot.Xmp {
 			}
 
 			ProcessStore (xmp.Store, photo);
-#if enable_debug
-			xmp.Save (Console.OpenStandardOutput ());
-#endif			
 			return true;
 		}
 



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