WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9887 closed enhancement (fixed)

Problem that PNG thumbnail size increases more than original

Reported by: madhyde Owned by: madhyde
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.8
Component: Media Keywords: has-patch tested blessed
Focuses: Cc:

Description

When index color PNG is uploaded, WordPress generates full color PNG as a thumbnail.
But, in many cases, the thumbnail file size is larger than the original.
so, I wrote improvement patch. thumbnail color reconvert to same colors as the original(index color).

Attachments (2)

indexPNG.patch (582 bytes) - added by madhyde 5 years ago.
improve index PNG's thumnail
screenshot.png (8.8 KB) - added by madhyde 5 years ago.
ScreenShot

Download all attachments as: .zip

Change History (18)

madhyde5 years ago

improve index PNG's thumnail

madhyde5 years ago

ScreenShot

comment:1 follow-up: dd325 years ago

  • Keywords has-patch added
  • Severity changed from major to normal

Couldn't this also be applied to non-png's as well?

comment:2 dd325 years ago

  • Milestone changed from Unassigned to Future Release

comment:3 Denis-de-Bernardy5 years ago

  • Milestone changed from Future Release to 2.8

comment:4 madhyde5 years ago

Replying to dd32:
I think It's only index PNG's problem.

comment:5 in reply to: ↑ 1 Denis-de-Bernardy5 years ago

Replying to dd32:

Couldn't this also be applied to non-png's as well?

maybe to gif images. trouble with the patch is that the resampling might be better done in true colors, with the number of colors reduced in the aftermath.

comment:6 Denis-de-Bernardy5 years ago

oh, nevermind that, I misread the patch and it seems you did just that.

comment:7 dd325 years ago

Gif was indeed what i was mainly thinking of.

comment:8 madhyde5 years ago

GIF is reduced automatically by the imagegif function.

comment:9 follow-up: azaozz5 years ago

  • Keywords needs-testing added
  • Milestone changed from 2.8 to Future Release

How much memory would that use for large image?

comment:10 in reply to: ↑ 9 madhyde5 years ago

Replying to azaozz:

How much memory would that use for large image?

Why do you warry about memory? This only applied the same flow as Gif to PNG. If a large image is even up-load, this doesn't use more work area than thumnail size.

comment:11 madhyde5 years ago

  • Keywords tested added; needs-testing removed
  • Milestone changed from Future Release to 2.8
  • Owner set to madhyde
  • Status changed from new to accepted

Did anyone test?
I tested all cases.
PNG(full-color and index-color), GIF(index-color), JPEG(full-color).
No problem.

comment:12 Denis-de-Bernardy5 years ago

haven't had time to test, sorry. but it definitely looks commit-worthy.

comment:13 Denis-de-Bernardy5 years ago

  • Milestone changed from 2.8 to 2.9

punting per IRC discussion

comment:14 Denis-de-Bernardy5 years ago

still applies clean

comment:15 matt5 years ago

  • Keywords blessed added

comment:16 azaozz5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [11737]) Generate same as original color depth thumbnails for PNG images, props madhyde, fixes #9887

Note: See TracTickets for help on using tickets.