Libpng interlace warning
Maintainers usually reply within 5 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 18/100
Research direction
The payload names no source file; the only entry points are the reproduction's $mpdf->WriteHTML($html) call and the <img> tag with an interlaced PNG. Start by reproducing the libpng warning with the snippet, then find where mPDF reads PNG images and where libpng's read-image call is made. Done means the warning no longer appears for an interlaced PNG and the output PDF still embeds the image. The issue doesn't say what the expected fix is, so confirm the approach with maintainers first.
Written by the indexing model from the issue text.
Description
Guidelines
- I understand that if I fail to adhere to contribution guidelines and/or fail to provide all required details, this issue may be closed without review.
Description of the bug
When generating a PDF containing an interlaced PNG image, I get this warning:
libpng warning: Interlace handling should be turned on when using png_read_image
It's the same problem reported in issue #1589. The issue it's closed, but I still get the warning.
The output only contains the message, with no indication of where in the code it occurs.
I can't edit the png, along with all the HTML code, because it comes from a remote source that isn't mine.
In the PHP example to reproduce the error, I simplified the HTML source for testing purposes.
mPDF version
8.2.5
PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)
PHP 8.2 / PHP 8.3
Reproducible PHP+CSS+HTML snippet suffering by the error
<?php
// S
<img width="320" height="68" alt="Image" src="https://github.com/user-attachments/assets/8bfc112a-1d24-4df5-983b-3a1ab6b2d223" />
implified code for testing, in my real environment all html comes from a remote source.
require_once __DIR__ . '/vendor/autoload.php';
$html = '<html><head><title>test</title><body><img src="https://www.forthrightassets.com/images/FORUM_2022_DocLogo.png"></body></html>';
$mpdf = new \Mpdf\Mpdf;
$mpdf->WriteHTML($html);
$mpdf->Output(__DIR__ . '/test.pdf', 'F');
- Dominant language
- PHP
- Stars
- 4.7k
- Forks
- 1.1k
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mpdf/mpdf
-
SVG path arcs with an explicit zero radius throw DivisionByZeroErrorPossibly taken @Syed-Shehroz-Sohail claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 5 days
-
Closing a column set with an image in it leaves the cursor below the page, wasting the rest of itOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 5 days
-
8.3: Local fallback for external stylesheets is inverted in CssLoader (basepathIsLocal check negated) — CSS silently dropped when remote fetch failsPossibly taken @hemreduru claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 5 days
-
Tag/Td.php silently clears cell top/bottom borders when a row has a partial border (plus two warnings and a deprecation)Possibly taken @alizamani1616 claimed this 61 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 5 days
-
AdjustHTML() collapses multiple spaces inside quoted attribute values (src, href)Possibly taken @sornapudisuresh claimed this 130 days ago. Openbug/fix help wanted HTML/CSS support
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 5 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Перевод устарел
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day