mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
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.
This commit is contained in:
parent
8a28d0558e
commit
19a5a5eba3
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user