about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-04-10 21:59:23 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-04-10 21:59:23 +0000
commit55816e3b53d149a249fff96f262072da61e493dc (patch)
tree1a1dbc15e47d5892e71646938300096bee73ea12
parent772c4792d998deb70f1719c1a2ad82f2defde5f0 (diff)
downloadnetpbm-mirror-55816e3b53d149a249fff96f262072da61e493dc.tar.gz
netpbm-mirror-55816e3b53d149a249fff96f262072da61e493dc.tar.xz
netpbm-mirror-55816e3b53d149a249fff96f262072da61e493dc.zip
Release 10.98.01
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4324 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY9
-rw-r--r--editor/pamdice.c6
-rw-r--r--editor/pnmgamma.c6
-rw-r--r--version.mk2
4 files changed, 17 insertions, 6 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 6e0ca9c9..8900bf3f 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,15 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+22.04.10 BJH  Release 10.98.01
+
+              pnmgamma -srgbtobt709, -bt709tosrgb: fix bug; incorrect output.
+              Always broken (These options were new in Netpbm 10.32 (February
+              2006)).  Thanks Alexander Shpilkin <ashpilkin@gmail.com>.
+
+              pamdice: Fix incorrect output file name with PAM input.  Always
+              broken (pamdice was new in Netpbm 9.25 (March 2002).
+
 22.03.27 BJH  Release 10.98.00
 
               pamtopdbimg: Add -fixedtime.
diff --git a/editor/pamdice.c b/editor/pamdice.c
index 9063c4bd..58e24e5b 100644
--- a/editor/pamdice.c
+++ b/editor/pamdice.c
@@ -227,12 +227,14 @@ computeOutputFilenameFormat(int           const format,
 
     const char * filenameSuffix;
 
-    switch(PNM_FORMAT_TYPE(format)) {
+    switch(PAM_FORMAT_TYPE(format)) {
     case PPM_TYPE: filenameSuffix = "ppm"; break;
     case PGM_TYPE: filenameSuffix = "pgm"; break;
     case PBM_TYPE: filenameSuffix = "pbm"; break;
     case PAM_TYPE: filenameSuffix = "pam"; break;
-    default:       filenameSuffix = "";    break;
+    default:
+        pm_error("INTERNAL ERROR: impossible value for libnetpbm image "
+                 "fomat code: %d", format);
     }
 
     pm_asprintf(filenameFormatP, "%%s_%%0%uu_%%0%uu.%s",
diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c
index 1fdf20eb..e10e138b 100644
--- a/editor/pnmgamma.c
+++ b/editor/pnmgamma.c
@@ -516,7 +516,7 @@ buildBt709ToSrgbGamma(xelval       table[],
         if (radiance < linearCutoffSrgb * normalizer)
             srgb = radiance * linearExpansionSrgb;
         else
-            srgb = 1.055 * pow(normalized, oneOverGammaSrgb) - 0.055;
+            srgb = 1.055 * pow(radiance, oneOverGammaSrgb) - 0.055;
 
         assert(srgb <= 1.0);
 
@@ -567,14 +567,14 @@ buildSrgbToBt709Gamma(xelval       table[],
         if (i < linearCutoffSrgb / linearCompressionSrgb)
             radiance = normalized * linearCompressionSrgb;
         else
-            radiance = pow((normalized + 0.099) / 1.099, gammaSrgb);
+            radiance = pow((normalized + 0.055) / 1.055, gammaSrgb);
 
         assert(radiance <= 1.0);
 
         if (radiance < linearCutoff709 * normalizer)
             bt709 = radiance * linearExpansion709;
         else
-            bt709 = 1.055 * pow(normalized, oneOverGamma709) - 0.055;
+            bt709 = 1.099 * pow(radiance, oneOverGamma709) - 0.099;
 
         assert(bt709 <= 1.0);
 
diff --git a/version.mk b/version.mk
index e72d68a9..f5f37e74 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 98
-NETPBM_POINT_RELEASE = 0
+NETPBM_POINT_RELEASE = 1