Am Wed, 30 Jun 2021 16:48:57 +0200 schrieb luigi scarso: > On Wed, Jun 30, 2021 at 3:02 PM Ulrike Fischer <[email protected]> wrote: > >> >> I lost transparency in a png used in a pdf 2.0 document. >> >> It looks as if luatex decides if to use a /Smask by looking only at >> the minor version. So 1.4-1.9 work, 2.0-2.3 fail, 2.4 works again >> >> >> \pdfvariable compresslevel=0 >> \pdfvariable objcompresslevel=0 >> \pdfvariable majorversion =2 >> \pdfvariable minorversion =0 % or 4 >> \saveimageresource {transparent.png} >> \useimageresource\lastsavedimageresourceindex >> xxx >> \bye >> >> Result >> >> minor 0: >> << /Type /XObject /Subtype /Image /Width 50 /Height 50 >> /BitsPerComponent 8 /ColorSpace /DeviceRGB /Length 7500 >> >> >> minor 4: >> << /Type /XObject /Subtype /Image /Width 50 /Height 50 >> /BitsPerComponent 8 /ColorSpace /DeviceRGB /SMask 7 0 R /Length 7500 >>>> >> >> transparent.png is an arbitrary image with transparency. >> > > yes, we assume majorversion=1 > 490 /*tex alpha channel support */ > 491 if (pdf->minor_version < 4 > 492 && png_get_color_type(png_p, info_p) | > PNG_COLOR_MASK_ALPHA) { > 493 png_set_strip_alpha(png_p); > 494 png_copy = false; > 495 } > > What are the rules for png when majorversion=2 ?
I don't think that anything changed compared to 1.7. I didn't check the full reference, but the SMask entry simply says SMask stream (Optional; PDF 1.4) .... I guess that the test was added to handle PDF <1.4 and simply wasn't adapted when the major version was added. -- Ulrike Fischer http://www.troubleshooting-tex.de/
