diff --git a/frontend/src/components/TiffImageViewer.tsx b/frontend/src/components/TiffImageViewer.tsx index 8160daee..e84b3af4 100644 --- a/frontend/src/components/TiffImageViewer.tsx +++ b/frontend/src/components/TiffImageViewer.tsx @@ -133,7 +133,7 @@ function TiffImageViewer({ url, variant, height = 460 }: MyProps) { if (variant === "value") { const stops = CMAPS[cmapName] ?? CMAPS.Viridis; - const span = hi - lo || 1; + const span = hi - lo > 0 ? hi - lo : 1; // guard zero/negative (e.g. Min>Max or a cleared field) for (let i = 0; i < data.length; i++) { const v = data[i]; const j = i * 4;