Skip to content

Commit

Permalink
pngminus: Remove a workaround for an old printer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ctruta committed Jan 10, 2025
1 parent 8a28d05 commit 19a5a5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
1 change: 1 addition & 0 deletions contrib/pngminus/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 0 additions & 16 deletions contrib/pngminus/png2pnm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 19a5a5e

Please sign in to comment.