gthumb r2188 - in trunk: . libgthumb src



Author: mjc
Date: Tue Jan 15 16:27:25 2008
New Revision: 2188
URL: http://svn.gnome.org/viewvc/gthumb?rev=2188&view=rev

Log:
2008-01-15  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/gth-exif-utils.h:
        * libgthumb/gth-exiv2-utils.cpp:
        * src/gth-exif-data-viewer.c:
        Re-order metadata categories slightly, to put MakerNotes further down
        the list. 

        * libgthumb/gth-exif-utils.c: Remove the get_exif_tag_short function.
        It is libexif based, and no longer used.

        * src/dlg-jpegtran.c: (apply_transformation__trim_response),
        (apply_transformation__step2):
        Stop using libexif to read orientation tags.
        Use our own internal function, read_orientation_field.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/gth-exif-utils.c
   trunk/libgthumb/gth-exif-utils.h
   trunk/libgthumb/gth-exiv2-utils.cpp
   trunk/src/dlg-jpegtran.c
   trunk/src/gth-exif-data-viewer.c

Modified: trunk/libgthumb/gth-exif-utils.c
==============================================================================
--- trunk/libgthumb/gth-exif-utils.c	(original)
+++ trunk/libgthumb/gth-exif-utils.c	Tue Jan 15 16:27:25 2008
@@ -98,52 +98,6 @@
 }
 
 
-ExifShort
-get_exif_tag_short (const char *uri,
-		    ExifTag     etag)
-{
-	ExifData     *edata;
-	unsigned int  i, j;
-
-	if (uri == NULL)
-		return 0;
-
-	edata = gth_exif_data_new_from_uri (uri);
-	if (edata == NULL) 
-		return 0;
-
-	for (i = 0; i < EXIF_IFD_COUNT; i++) {
-		ExifContent *content = edata->ifd[i];
-
-		if (! edata->ifd[i] || ! edata->ifd[i]->count) 
-			continue;
-
-		for (j = 0; j < content->count; j++) {
-			ExifEntry *e = content->entries[j];
-
-			if (! content->entries[j]) 
-				continue;
-
-			if (e->tag == etag) {
-				ExifByteOrder o;
-				ExifShort retval = 0;
-
-				o = exif_data_get_byte_order (e->parent->parent);
-				if (e->data != NULL)
-					retval = exif_get_short (e->data, o);
-				exif_data_unref (edata);
-
-				return retval;
-			}
-		}
-	}
-
-	exif_data_unref (edata);
-
-	return 0;
-}
-
-
 time_t
 exif_string_to_time_t (char *string) 
 {

Modified: trunk/libgthumb/gth-exif-utils.h
==============================================================================
--- trunk/libgthumb/gth-exif-utils.h	(original)
+++ trunk/libgthumb/gth-exif-utils.h	Tue Jan 15 16:27:25 2008
@@ -49,10 +49,10 @@
         GTH_METADATA_CATEGORY_FILE = 0, 
         GTH_METADATA_CATEGORY_EXIF_CAMERA, 
         GTH_METADATA_CATEGORY_EXIF_CONDITIONS, 
-        GTH_METADATA_CATEGORY_MAKERNOTE, 
-        GTH_METADATA_CATEGORY_GPS, 
         GTH_METADATA_CATEGORY_EXIF_IMAGE, 
         GTH_METADATA_CATEGORY_EXIF_THUMBNAIL, 
+        GTH_METADATA_CATEGORY_GPS, 
+        GTH_METADATA_CATEGORY_MAKERNOTE, 
         GTH_METADATA_CATEGORY_VERSIONS, 
 	GTH_METADATA_CATEGORY_IPTC,
         GTH_METADATA_CATEGORY_XMP_EMBEDDED, 
@@ -75,8 +75,6 @@
 ExifData     *gth_exif_data_new_from_uri  (const char   *path);
 char *        get_exif_tag                (const char   *filename,
 				           ExifTag       etag);
-ExifShort     get_exif_tag_short          (const char   *filename,
-				           ExifTag       etag);
 time_t        get_metadata_time           (const char   *mime_type,
 					   const char   *filename);
 char *        get_exif_aperture_value     (const char   *filename);

Modified: trunk/libgthumb/gth-exiv2-utils.cpp
==============================================================================
--- trunk/libgthumb/gth-exiv2-utils.cpp	(original)
+++ trunk/libgthumb/gth-exiv2-utils.cpp	Tue Jan 15 16:27:25 2008
@@ -131,48 +131,6 @@
 
 	  -1 },
 
-	/* GTH_METADATA_CATEGORY_MAKERNOTE */
-	/* These tags are semi-proprietary and vary from manufacturer to
-	   manufacturer, so we don't bother trying to sort them. They are
-	   listed in the order that they appear in the jpeg file. */
-	{ -1 },
-
-	/* GTH_METADATA_CATEGORY_GPS */
-	/* GPS data is stored in a special IFD (GPS) */
-	{ 
-	1,	//EXIF_TAG_GPS_LATITUDE_REF
-	2,	//EXIF_TAG_GPS_LATITUDE
-	3,	//EXIF_TAG_GPS_LONGITUDE_REF
-	4,	//EXIF_TAG_GPS_LONGITUDE
-	5,	//EXIF_TAG_GPS_ALTITUDE_REF
-	6,	//EXIF_TAG_GPS_ALTITUDE
-	7,	//EXIF_TAG_GPS_TIME_STAMP
-	8,	//EXIF_TAG_GPS_SATELLITES
-	9,	//EXIF_TAG_GPS_STATUS
-	10,	//EXIF_TAG_GPS_MEASURE_MODE
-	11,	//EXIF_TAG_GPS_DOP
-	12,	//EXIF_TAG_GPS_SPEED_REF
-	13,	//EXIF_TAG_GPS_SPEED
-	14,	//EXIF_TAG_GPS_TRACK_REF
-	15,	//EXIF_TAG_GPS_TRACK
-	16,	//EXIF_TAG_GPS_IMG_DIRECTION_REF
-	17,	//EXIF_TAG_GPS_IMG_DIRECTION
-	18,	//EXIF_TAG_GPS_MAP_DATUM
-	19,	//EXIF_TAG_GPS_DEST_LATITUDE_REF
-	20,	//EXIF_TAG_GPS_DEST_LATITUDE
-	21,	//EXIF_TAG_GPS_DEST_LONGITUDE_REF
-	22,	//EXIF_TAG_GPS_DEST_LONGITUDE
-	23,	//EXIF_TAG_GPS_DEST_BEARING_REF
-	24,	//EXIF_TAG_GPS_DEST_BEARING
-	25,	//EXIF_TAG_GPS_DEST_DISTANCE_REF
-	26,	//EXIF_TAG_GPS_DEST_DISTANCE
-	27,	//EXIF_TAG_GPS_PROCESSING_METHOD
-	28,	//EXIF_TAG_GPS_AREA_INFORMATION
-	29,	//EXIF_TAG_GPS_DATE_STAMP
-	30,	//EXIF_TAG_GPS_DIFFERENTIAL
- 	0,	//EXIF_TAG_GPS_VERSION_ID
-	  -1 },
-
 	/* GTH_METADATA_CATEGORY_EXIF_IMAGE */
 	/* These tags describe the main image data structures, and
 	   come from the IFD0 and EXIF blocks. */
@@ -231,6 +189,48 @@
 	   IFD1 tags are placed into this category. */
 	{ -1 },
 
+	/* GTH_METADATA_CATEGORY_GPS */
+	/* GPS data is stored in a special IFD (GPS) */
+	{ 
+	1,	//EXIF_TAG_GPS_LATITUDE_REF
+	2,	//EXIF_TAG_GPS_LATITUDE
+	3,	//EXIF_TAG_GPS_LONGITUDE_REF
+	4,	//EXIF_TAG_GPS_LONGITUDE
+	5,	//EXIF_TAG_GPS_ALTITUDE_REF
+	6,	//EXIF_TAG_GPS_ALTITUDE
+	7,	//EXIF_TAG_GPS_TIME_STAMP
+	8,	//EXIF_TAG_GPS_SATELLITES
+	9,	//EXIF_TAG_GPS_STATUS
+	10,	//EXIF_TAG_GPS_MEASURE_MODE
+	11,	//EXIF_TAG_GPS_DOP
+	12,	//EXIF_TAG_GPS_SPEED_REF
+	13,	//EXIF_TAG_GPS_SPEED
+	14,	//EXIF_TAG_GPS_TRACK_REF
+	15,	//EXIF_TAG_GPS_TRACK
+	16,	//EXIF_TAG_GPS_IMG_DIRECTION_REF
+	17,	//EXIF_TAG_GPS_IMG_DIRECTION
+	18,	//EXIF_TAG_GPS_MAP_DATUM
+	19,	//EXIF_TAG_GPS_DEST_LATITUDE_REF
+	20,	//EXIF_TAG_GPS_DEST_LATITUDE
+	21,	//EXIF_TAG_GPS_DEST_LONGITUDE_REF
+	22,	//EXIF_TAG_GPS_DEST_LONGITUDE
+	23,	//EXIF_TAG_GPS_DEST_BEARING_REF
+	24,	//EXIF_TAG_GPS_DEST_BEARING
+	25,	//EXIF_TAG_GPS_DEST_DISTANCE_REF
+	26,	//EXIF_TAG_GPS_DEST_DISTANCE
+	27,	//EXIF_TAG_GPS_PROCESSING_METHOD
+	28,	//EXIF_TAG_GPS_AREA_INFORMATION
+	29,	//EXIF_TAG_GPS_DATE_STAMP
+	30,	//EXIF_TAG_GPS_DIFFERENTIAL
+ 	0,	//EXIF_TAG_GPS_VERSION_ID
+	  -1 },
+
+	/* GTH_METADATA_CATEGORY_MAKERNOTE */
+	/* These tags are semi-proprietary and vary from manufacturer to
+	   manufacturer, so we don't bother trying to sort them. They are
+	   listed in the order that they appear in the jpeg file. */
+	{ -1 },
+
 	/* GTH_METADATA_CATEGORY_VERSIONS */
 	/* From IFD0, EXIF,or INTEROPERABILITY blocks. */
 	{ 

Modified: trunk/src/dlg-jpegtran.c
==============================================================================
--- trunk/src/dlg-jpegtran.c	(original)
+++ trunk/src/dlg-jpegtran.c	Tue Jan 15 16:27:25 2008
@@ -273,11 +273,11 @@
 	ApplyTransformData *at_data = callback_data;
 	FileData           *file = at_data->current_image->data;
 	char		   *local_file = NULL;
-	ExifShort           image_orientation;
+	GthTransform        image_orientation;
 	GthTransform	    required_transform;
 
 	local_file = get_cache_filename_from_uri (file->path);
-	image_orientation = get_exif_tag_short (local_file, EXIF_TAG_ORIENTATION);
+	image_orientation = read_orientation_field (local_file);
 	required_transform = get_next_transformation (image_orientation, at_data->data->transform);
 	
 	apply_transformation_jpeg (file, required_transform, action, NULL);
@@ -296,12 +296,12 @@
 	ApplyTransformData *at_data = callback_data;
 	FileData           *file = at_data->current_image->data;
 	char		   *local_file = NULL;
-	ExifShort           image_orientation;
+	GthTransform        image_orientation;
 	GthTransform	    required_transform;
 	gboolean            go_on = TRUE;
 	
 	local_file = get_cache_filename_from_uri (file->path);
-	image_orientation = get_exif_tag_short (local_file, EXIF_TAG_ORIENTATION);
+	image_orientation = read_orientation_field (local_file);
 	required_transform = get_next_transformation (image_orientation, at_data->data->transform);
 	if (mime_type_is (file->mime_type, "image/jpeg")) {
 		if (image_orientation && ! eel_gconf_get_boolean (PREF_ROTATE_RESET_EXIF_ORIENTATION, TRUE)) 

Modified: trunk/src/gth-exif-data-viewer.c
==============================================================================
--- trunk/src/gth-exif-data-viewer.c	(original)
+++ trunk/src/gth-exif-data-viewer.c	Tue Jan 15 16:27:25 2008
@@ -45,10 +45,10 @@
         N_("Filesystem"),  
         N_("Exif General"),  
         N_("Exif Conditions"),  
-        N_("Exif Maker Notes"),  
-        N_("Exif GPS"),  
         N_("Exif Structure"),  
         N_("Exif Thumbnail"),  
+        N_("Exif GPS"),  
+	N_("Exif Maker Notes"),  
         N_("Exif Versions"),  
 	N_("IPTC"),
         N_("XMP Embedded"),  



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