[wp-trac] [WordPress Trac] #58155: Add filter to allow large image scaling of PNGs

WordPress Trac noreply at wordpress.org
Tue Apr 18 21:50:05 UTC 2023


#58155: Add filter to allow large image scaling of PNGs
-------------------------+------------------------------
 Reporter:  pelstudio    |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Upload       |     Version:  5.3.1
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------
Changes (by costdev):

 * version:  6.2 => 5.3.1


Comment:

 Hi @pelstudio, welcome to Trac and thanks for opening this ticket!

 As this was introduced in 5.3.1, I'll update the `Version` property to
 note when this first became an issue.

 It looks like we could change [https://github.com/WordPress/wordpress-
 develop/blob/trunk/src/wp-admin/includes/image.php#L261 this condition]:

 {{{#!php
 <?php
 if ( $imagesize['mime'] !== 'image/png' ) {
 }}}

 to:
 {{{#!php
 <?php
 if ( 'image/png' !== $imagesize['mime'] || apply_filters(
 'big_image_scale_png', false, $imagesize, $file, $attachment_id ) ) {
 }}}

 @azoazz What do you think about this?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58155#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list