From 55816e3b53d149a249fff96f262072da61e493dc Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 10 Apr 2022 21:59:23 +0000 Subject: Release 10.98.01 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4324 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pamdice.c | 6 ++++-- editor/pnmgamma.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'editor') 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); -- cgit 1.4.1