about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-04-13 23:46:39 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-04-13 23:46:39 +0000
commitd2e7482691c79a1bd3caa14719679537ebce3d89 (patch)
tree01308754431b72a0bb5212c0fa993aa12f0c81d6 /converter
parent88e61e1c4014a83bf60841cd0f1a9c89a4d5ee9e (diff)
downloadnetpbm-mirror-d2e7482691c79a1bd3caa14719679537ebce3d89.tar.gz
netpbm-mirror-d2e7482691c79a1bd3caa14719679537ebce3d89.tar.xz
netpbm-mirror-d2e7482691c79a1bd3caa14719679537ebce3d89.zip
Fix resolution
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2185 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r--converter/other/exif.c17
-rw-r--r--converter/other/exif.h3
2 files changed, 17 insertions, 3 deletions
diff --git a/converter/other/exif.c b/converter/other/exif.c
index 5dd21b32..f4caf92b 100644
--- a/converter/other/exif.c
+++ b/converter/other/exif.c
@@ -86,6 +86,9 @@ static int const bytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8};
 
 #define TAG_ORIENTATION       0x0112
 
+#define TAG_XRESOLUTION       0x011A
+#define TAG_YRESOLUTION       0x011B
+
 #define TAG_EXPOSURETIME      0x829A
 #define TAG_FNUMBER           0x829D
 
@@ -502,6 +505,16 @@ processDirEntry(const unsigned char *  const dirEntry,
         strncpy(imageInfoP->CameraModel, (const char*)valuePtr, 39);
         break;
 
+    case TAG_XRESOLUTION:
+        imageInfoP->XResolution = 
+            convertAnyFormat(valuePtr, format, byteOrder);
+        break;
+
+    case TAG_YRESOLUTION:
+        imageInfoP->YResolution = 
+            convertAnyFormat(valuePtr, format, byteOrder);
+        break;
+
     case TAG_DATETIME_ORIGINAL:
         strncpy(imageInfoP->DateTime, (const char*)valuePtr, 19);
         imageInfoP->DatePointer = (const char*)valuePtr;
@@ -927,8 +940,8 @@ exif_showImageInfo(const exif_ImageInfo * const imageInfoP,
     if (imageInfoP->DateTime[0])
         fprintf(fileP, "Date/Time    : %s\n", imageInfoP->DateTime);
 
-    fprintf(fileP, "Resolution   : %d x %d\n",
-            imageInfoP->Width, imageInfoP->Height);
+    fprintf(fileP, "Resolution   : %f x %f\n",
+            imageInfoP->XResolution, imageInfoP->YResolution);
 
     if (imageInfoP->Orientation > 1) {
 
diff --git a/converter/other/exif.h b/converter/other/exif.h
index 3882f822..57eb745b 100644
--- a/converter/other/exif.h
+++ b/converter/other/exif.h
@@ -19,7 +19,8 @@ typedef struct {
     char  CameraMake   [32];
     char  CameraModel  [40];
     char  DateTime     [20];
-    int   Height, Width;
+    float XResolution;
+    float YResolution;
     int   Orientation;
     int   IsColor;
     int   FlashUsed;