[tracker-miners] tracker-extract: Rename constant



commit 8aebafa9a152a67ab2f99b144921bb1b9b373872
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Jan 27 23:19:36 2018 +0100

    tracker-extract: Rename constant
    
    This factor is meant to convert pixels per centimetre to pixels per
    inch, not centimetres to inches.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792192

 src/tracker-extract/tracker-extract-jpeg.c |   10 +++++-----
 src/tracker-extract/tracker-extract-png.c  |    6 +++---
 src/tracker-extract/tracker-extract-tiff.c |    6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index 1097cfe..e845922 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -31,7 +31,7 @@
 
 #include "tracker-main.h"
 
-#define CM_TO_INCH              2.54
+#define CMS_PER_INCH            2.54
 
 #ifdef HAVE_LIBEXIF
 #define EXIF_NAMESPACE          "Exif"
@@ -540,14 +540,14 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 
                if (cinfo.density_unit == JPEG_RESOLUTION_UNIT_UNKNOWN) {
                        if (ed->resolution_unit == EXIF_RESOLUTION_UNIT_PER_CENTIMETER)
-                               value = g_strtod (ed->x_resolution, NULL) * CM_TO_INCH;
+                               value = g_strtod (ed->x_resolution, NULL) * CMS_PER_INCH;
                        else
                                value = g_strtod (ed->x_resolution, NULL);
                } else {
                        if (cinfo.density_unit == JPEG_RESOLUTION_UNIT_PER_INCH)
                                value = cinfo.X_density;
                        else
-                               value = cinfo.X_density * CM_TO_INCH;
+                               value = cinfo.X_density * CMS_PER_INCH;
                }
 
                tracker_resource_set_double (metadata, "nfo:horizontalResolution", value);
@@ -558,14 +558,14 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 
                if (cinfo.density_unit == JPEG_RESOLUTION_UNIT_UNKNOWN) {
                        if (ed->resolution_unit == EXIF_RESOLUTION_UNIT_PER_CENTIMETER)
-                               value = g_strtod (ed->y_resolution, NULL) * CM_TO_INCH;
+                               value = g_strtod (ed->y_resolution, NULL) * CMS_PER_INCH;
                        else
                                value = g_strtod (ed->y_resolution, NULL);
                } else {
                        if (cinfo.density_unit == JPEG_RESOLUTION_UNIT_PER_INCH)
                                value = cinfo.Y_density;
                        else
-                               value = cinfo.Y_density * CM_TO_INCH;
+                               value = cinfo.Y_density * CMS_PER_INCH;
                }
 
                tracker_resource_set_double (metadata, "nfo:verticalResolution", value);
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index 0c33d3c..2764915 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -27,7 +27,7 @@
 #include <libtracker-extract/tracker-extract.h>
 
 #define RFC1123_DATE_FORMAT "%d %B %Y %H:%M:%S %z"
-#define CM_TO_INCH          2.54
+#define CMS_PER_INCH        2.54
 
 typedef struct {
        const gchar *title;
@@ -533,7 +533,7 @@ read_metadata (TrackerResource      *metadata,
                gdouble value;
 
                if (ed->resolution_unit == EXIF_RESOLUTION_UNIT_PER_CENTIMETER)
-                       value = g_strtod (ed->x_resolution, NULL) * CM_TO_INCH;
+                       value = g_strtod (ed->x_resolution, NULL) * CMS_PER_INCH;
                else
                        value = g_strtod (ed->x_resolution, NULL);
 
@@ -544,7 +544,7 @@ read_metadata (TrackerResource      *metadata,
                gdouble value;
 
                if (ed->resolution_unit == EXIF_RESOLUTION_UNIT_PER_CENTIMETER)
-                       value = g_strtod (ed->y_resolution, NULL) * CM_TO_INCH;
+                       value = g_strtod (ed->y_resolution, NULL) * CMS_PER_INCH;
                else
                        value = g_strtod (ed->y_resolution, NULL);
 
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index 8c3ed61..7e8102a 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -33,7 +33,7 @@
 #include <libtracker-miners-common/tracker-common.h>
 #include <libtracker-extract/tracker-extract.h>
 
-#define CM_TO_INCH          2.54
+#define CMS_PER_INCH        2.54
 
 typedef enum {
        TAG_TYPE_UNDEFINED = 0,
@@ -633,7 +633,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
                gdouble value;
 
                if (ed->resolution_unit == EXIF_RESOLUTION_UNIT_PER_CENTIMETER)
-                       value = g_strtod (ed->x_resolution, NULL) * CM_TO_INCH;
+                       value = g_strtod (ed->x_resolution, NULL) * CMS_PER_INCH;
                else
                        value = g_strtod (ed->x_resolution, NULL);
 
@@ -644,7 +644,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
                gdouble value;
 
                if (ed->resolution_unit == EXIF_RESOLUTION_UNIT_PER_CENTIMETER)
-                       value = g_strtod (ed->y_resolution, NULL) * CM_TO_INCH;
+                       value = g_strtod (ed->y_resolution, NULL) * CMS_PER_INCH;
                else
                        value = g_strtod (ed->y_resolution, NULL);
 


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