From f95e420aced2e04fcdcbc495fe9ec689bc838098 Mon Sep 17 00:00:00 2001 From: Scott Dyer Date: Wed, 30 Oct 2024 13:44:49 -0700 Subject: [PATCH] fix a divide by zero error that can occur in the inverse compression function, improving the roundtrip especially for HDR fix issue #158 --- lib/Lib.Academy.OutputTransform.ctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Lib.Academy.OutputTransform.ctl b/lib/Lib.Academy.OutputTransform.ctl index 4b059e99..21f28a43 100644 --- a/lib/Lib.Academy.OutputTransform.ctl +++ b/lib/Lib.Academy.OutputTransform.ctl @@ -493,7 +493,7 @@ float compressionFunction(float v, if (invert) { - if (v < thr || lim < 1.0001 || v > thr + s) + if (v < thr || lim <= 1.0001 || v > thr + s) { vCompressed = v; } @@ -504,7 +504,7 @@ float compressionFunction(float v, } else { - if (v < thr || lim < 1.0001) + if (v < thr || lim <= 1.0001) { vCompressed = v; }