Last modified: 2012-05-17 17:26:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38932, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36932 - Pass -type Palette to ImageMagick 'convert', since the thumbnails are 8-bit anyway (makes PNG thumbnails much smaller)
Pass -type Palette to ImageMagick 'convert', since the thumbnails are 8-bit a...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.19
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-17 11:55 UTC by Edward Chernenko
Modified: 2012-05-17 17:26 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
this patch adds -type Palette to ImageMagick convert invocation (573 bytes, patch)
2012-05-17 11:56 UTC, Edward Chernenko
Details

Description Edward Chernenko 2012-05-17 11:55:10 UTC
ImageMagick 'convert' has problems when scaling PNG images: the resulting thumbnails can be really big.

[edward@localhost build]$ identify before.png after.png
before.png PNG 800x533 800x533+0+0 8-bit PseudoClass 256c 312KB 0.000u 0:00.010
after.png[1] PNG 400x267 400x267+0+0 8-bit DirectClass 302KB 0.000u 0:00.000

But since MediaWiki uses 8-bit thumbnails only, we have a perfect opportunity to make a workaround on MediaWiki side: we can force PseudoClass (i.e. paletted image with 256 colors).

When converting, pass "-type Palette" as an argument.

[edward@localhost build]$ identify after2.png
after2 PNG 400x267 400x267+0+0 8-bit PseudoClass 256c 87.4KB 0.000u 0:00.000

As you can see, this thumbnail is 4 times smaller.
Comment 1 Edward Chernenko 2012-05-17 11:56:10 UTC
Created attachment 10614 [details]
this patch adds -type Palette to ImageMagick convert invocation
Comment 2 Bawolff (Brian Wolff) 2012-05-17 12:05:13 UTC
Who says we only use images with 256 colours? I don't think that's an accurate statement.
Comment 3 Edward Chernenko 2012-05-17 12:10:16 UTC
But Bitmap.php is currently passing '-depth 8' to 'convert'.
Comment 4 Edward Chernenko 2012-05-17 13:28:32 UTC
Sorry, I've mistaken "8bit" per PNG8, while it's PNG24 (8 bits per color).

Obviously, the initial patch isn't enough then (this switch should only be passed if the original image was in PNG8).
Comment 5 Edward Chernenko 2012-05-17 17:26:05 UTC
Never mind though.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links