Ticket #9887 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Problem that PNG thumbnail size increases more than original

Reported by: madhyde Owned by: madhyde
Priority: normal Milestone: 2.9
Component: Media Version: 2.8
Severity: normal Keywords: has-patch tested blessed
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

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

Change History

madhyde3 years ago

improve index PNG's thumnail

madhyde3 years ago

ScreenShot

comment:1 follow-up: ↓ 5   dd323 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   dd323 years ago

  • Milestone changed from Unassigned to Future Release
  • Milestone changed from Future Release to 2.8

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

comment:5 in reply to: ↑ 1   Denis-de-Bernardy3 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.

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

comment:7   dd323 years ago

Gif was indeed what i was mainly thinking of.

GIF is reduced automatically by the imagegif function.

comment:9 follow-up: ↓ 10   azaozz3 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   madhyde3 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.

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

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

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

  • Milestone changed from 2.8 to 2.9

punting per IRC discussion

still applies clean

  • Keywords blessed added
  • Status changed from accepted to closed
  • Resolution set to fixed

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

Note: See TracTickets for help on using tickets.