From 19a5a5eba3e2e1cc21a4a38522d1a527cb2f0c89 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Fri, 10 Jan 2025 14:49:51 +0200 Subject: [PATCH] pngminus: Remove a workaround for an old printer A downgrade from 16-bit samples to 8-bit samples, or an expansion from 1- or 2-channel grayscale (or grayscale+alpha) to 3- or 4-channel RGB (or RGB+alpha), etc., may be deemed generally useful. Such image transforms could be made available to the user via command-line options. On the other hand, keeping the decision to disable or enable these transforms unconditionally at compile time (e.g. because they're needed to work around a specific printer's limitations) is less than ideal. --- contrib/pngminus/CHANGES.txt | 1 + contrib/pngminus/png2pnm.c | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/contrib/pngminus/CHANGES.txt b/contrib/pngminus/CHANGES.txt index 12535b13cf..b4b1a9a8b3 100644 --- a/contrib/pngminus/CHANGES.txt +++ b/contrib/pngminus/CHANGES.txt @@ -11,3 +11,4 @@ version 1.0 - 1999.10.15 - First version. 1.6 - 2018.08.05 - Improve portability and fix style (Cosmin Truta) 1.7 - 2019.01.22 - Change license to MIT (Willem van Schaik) 1.8 - 2024.01.09 - Fix, improve, modernize (Cosmin Truta) + 1.9 - 2025.01.10 - Delete conditionally-compiled code (Cosmin Truta) diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c index 6a1f52e1ac..3c47b91df5 100644 --- a/contrib/pngminus/png2pnm.c +++ b/contrib/pngminus/png2pnm.c @@ -235,22 +235,6 @@ BOOL do_png2pnm (png_struct *png_ptr, png_info *info_ptr, /* set up (if applicable) the expansion of grayscale images to bit-depth 8 */ png_set_expand_gray_1_2_4_to_8 (png_ptr); -#ifdef NJET - /* downgrade 16-bit images to 8-bit */ - if (bit_depth == 16) - png_set_strip_16 (png_ptr); - /* transform grayscale images into full-color */ - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb (png_ptr); - /* if the PNG image has a gAMA chunk then gamma-correct the output image */ - { - double file_gamma; - if (png_get_gAMA (png_ptr, info_ptr, &file_gamma)) - png_set_gamma (png_ptr, (double) 2.2, file_gamma); - } -#endif - /* read the image file, with all of the above image transforms applied */ png_read_png (png_ptr, info_ptr, 0, NULL);