Changeset 60669
- Timestamp:
- 08/26/2025 09:03:16 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-imagick.php
r60667 r60669 445 445 446 446 try { 447 /* 448 * We need to perform some special handling for certain types ofimages:447 /** 448 * Special handling for certain types of PNG images: 449 449 * 1. For PNG images, we need to specify compression settings and remove unneeded chunks. 450 450 * 2. For indexed PNG images, the number of colors must not exceed 256. 451 451 * 3. For indexed PNG images with an alpha channel, the tRNS chunk must be preserved. 452 * 4. For indexed PNG images with true alpha transparency (an alpha channel > 1 bit), 453 * we need to avoid saving the image using ImageMagick's 'png8' format, 454 * because that supports only binary (1 bit) transparency. 452 * 4. For indexed PNG images with true alpha transparency (an alpha channel > 1 bit), we need to avoid saving 453 * the image using ImageMagick's 'png8' format, because that supports only binary (1 bit) transparency. 455 454 * 456 * For #4 we want to check whether the image has a 1-bit alpha channel before resizing, 457 * because resizing may cause the number of alpha values to multiply due to antialiasing. 458 * (We're assuming that, if the original image had only a 1-bit alpha channel, 459 * then a 1-bit alpha channel should be good enough for the resized images too.) 460 * So we're going to perform all the necessary checks before resizing the image 461 * and store the results in variables for later use. 455 * For #4 we want to check whether the image has a 1-bit alpha channel before resizing, because resizing 456 * may cause the number of alpha values to multiply due to antialiasing. If the original image had only a 457 * 1-bit alpha channel, then a 1-bit alpha channel should be good enough for the resized images. 458 * 459 * Perform all the necessary checks before resizing the image and store the results in variables for later use. 462 460 */ 463 461 $is_png = false;
Note: See TracChangeset
for help on using the changeset viewer.