Newer
Older
Import / applications / MakePDF / 3rdParty / libharu / pr-patches / 0001-Reajust-bit_depth-of-png-image-after-striping-depth-.patch
@John John on 29 Dec 2020 753 bytes bulk import from macbookpro checkouts
From 3ca944de0c823baa6b82752ba0a5b0eca51d4ef8 Mon Sep 17 00:00:00 2001
From: joelhecht <joel.hecht@laposte.net>
Date: Fri, 18 Mar 2016 15:51:41 +0100
Subject: [PATCH] Reajust bit_depth of png image after striping depth from 16
 to 8 so the generated PDF to contain the right BitsPerComponent value.

---
 src/hpdf_image_png.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/hpdf_image_png.c b/src/hpdf_image_png.c
index 3f20a77..86e50f9 100644
--- a/src/hpdf_image_png.c
+++ b/src/hpdf_image_png.c
@@ -460,6 +460,7 @@ LoadPngData  (HPDF_Dict     image,
 	/* 16bit images are not supported. */
 	if (bit_depth == 16) {
 		png_set_strip_16(png_ptr);
+		bit_depth = 8;
 	}
 
 	png_read_update_info(png_ptr, info_ptr);
-- 
2.21.1 (Apple Git-122.3)