Opened 20 months ago
Last modified 20 months ago
#58155 new enhancement
Add filter to allow large image scaling of PNGs
Reported by: | pelstudio | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.3.1 |
Component: | Upload | Keywords: | dev-feedback |
Focuses: | Cc: |
Description
Due to Issue #48736,large image downscaling of PNGs is disabled because sometimes the new images are larger in filesize than the originals (particularly with PNG-8).
This is reasonable but should be filterable with the current state as the default.
There are use cases where users rarely, if ever, upload PNG-8s but do upload massive PNG-24s that would benefit from downscaling. Devs should be able to turn this feature on for PNGs as needed.
Change History (3)
#3
in reply to:
↑ 1
@
20 months ago
Replying to costdev:
As this was introduced in 5.3.1, I'll update the
Version
property to note when this first became an issue.
Apologies for that. Still learning the system. We have a couple others potential issues to report so will hopefully do a better job.
It looks like we could change this condition:
to:
<?php if ( 'image/png' !== $imagesize['mime'] || apply_filters( 'big_image_scale_png', false, $imagesize, $file, $attachment_id ) ) {
That would do it from our perspective. Would love to see this!
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 this condition:
to:
@azaozz What do you think about this?