[php-src] PR #17380: Fix libgd 223: gdImageRotateGeneric() does not properly interpolate
| From: | cmb69 | Date: | Mon, 06 Jan 2025 12:59:11 +0000 |
| Subject: | [php-src] PR #17380: Fix libgd 223: gdImageRotateGeneric() does not properly interpolate | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30272@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17380
Author: cmb69
We port the respective upstream fix[1]. We only run the test against bundled libgd, since external
libgd may yield different results.
Cf. <https://github.com/libgd/libgd/commit/2b26be874d0c0987c4906a40ef8f0e8fee04ae8f>.
---
Test outputs prior to the fix:

After the fix:

Rather notable difference, even without enlarging. When enlarging with nearest neighbor, one can see
that there are only black and white pixels, but no grey pixels (i.e. antialiasing is missing).
I have not ported the relevant part of the follow-up https://github.com/libgd/libgd/commit/6267414dc2e58a84b331c53bfc6a5c5bdb0dbfaf;
namely the removal of the rounding, since this appears to slightly decrease quality (artifacts
noticeable when enlarging with nearest neighbor):

I'll have a closer look at this, but I think this PR is a relevant fix on its own.