about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-03-20 17:41:45 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-03-20 17:41:45 +0000
commit9b104f7556d61c6dc868f4c35864c31f05f91626 (patch)
treeede342098f6bf8997455b7a3a640614b5efa456e
parentaae617322e0ff76b2f5660bfff307168222b6aef (diff)
downloadnetpbm-mirror-9b104f7556d61c6dc868f4c35864c31f05f91626.tar.gz
netpbm-mirror-9b104f7556d61c6dc868f4c35864c31f05f91626.tar.xz
netpbm-mirror-9b104f7556d61c6dc868f4c35864c31f05f91626.zip
Add -traceexif
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4519 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/jpegtopnm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c
index c2a9efdf..b7c94fde 100644
--- a/converter/other/jpegtopnm.c
+++ b/converter/other/jpegtopnm.c
@@ -112,6 +112,7 @@ struct CmdlineInfo {
     enum Inklevel inklevel;
     unsigned int  comments;
     unsigned int  dumpexif;
+    unsigned int  traceexif;
     unsigned int  multiple;
     unsigned int  repair;
 };
@@ -214,6 +215,7 @@ parseCommandLine(int                  const argc,
     OPTENT3(0, "dumpexif",    OPT_FLAG,   NULL, &cmdlineP->dumpexif,      0);
     OPTENT3(0, "multiple",    OPT_FLAG,   NULL, &cmdlineP->multiple,      0);
     OPTENT3(0, "repair",      OPT_FLAG,   NULL, &cmdlineP->repair,        0);
+    OPTENT3(0, "traceexif",   OPT_FLAG,   NULL, &cmdlineP->traceexif,     0);
 
     opt.opt_table = option_def;
     opt.short_allowed = false;  /* We have no short (old-fashioned) options */
@@ -651,13 +653,12 @@ printComments(struct jpeg_decompress_struct const cinfo) {
 
 
 static void
-printExifInfo(struct jpeg_marker_struct const marker) {
+printExifInfo(struct jpeg_marker_struct const marker,
+              bool                      const wantTagTrace) {
 /*----------------------------------------------------------------------------
    Dump as informational messages the contents of the Jpeg miscellaneous
    marker 'marker', assuming it is an Exif header.
 -----------------------------------------------------------------------------*/
-    bool const wantTagTrace = false;
-
     exif_ImageInfo imageInfo;
     const char * error;
 
@@ -696,7 +697,8 @@ isExif(struct jpeg_marker_struct const marker) {
 
 
 static void
-dumpExif(struct jpeg_decompress_struct const cinfo) {
+dumpExif(struct jpeg_decompress_struct const cinfo,
+         bool                          const wantTrace) {
 /*----------------------------------------------------------------------------
    Dump as informational messages the contents of all EXIF headers in
    the image, interpreted.  An EXIF header is an APP1 marker.
@@ -709,7 +711,7 @@ dumpExif(struct jpeg_decompress_struct const cinfo) {
          markerP = markerP->next)
         if (isExif(*markerP)) {
             pm_message("EXIF INFO:");
-            printExifInfo(*markerP);
+            printExifInfo(*markerP, wantTrace);
             foundOne = true;
         }
     if (!foundOne)
@@ -883,7 +885,7 @@ convertImage(FILE *                          const ofP,
     if (cmdline.comments)
         printComments(*cinfoP);
     if (cmdline.dumpexif)
-        dumpExif(*cinfoP);
+        dumpExif(*cinfoP, cmdline.traceexif);
     if (cmdline.exifFileName)
         saveExif(*cinfoP, cmdline.exifFileName);