Page MenuHomePhabricator

Offer a configuration option to specify desired JPEG (thumbnail) quality
Open, Needs TriagePublic

Description

JPEG images that are scaled down to smaller sizes tend to have significant artifacts. Can the quality setting be made customizable?

How to reproduce:

  1. Upload a JPEG image to the wiki.
  2. Use the JPEG image in a way that causes a thumbnail to be generated. For example, [[File:Filename.jpg|120px]].
  3. Observe the extreme quality loss. An unacceptable amount of JPEG artifacts (blockiness, blurriness, discoloration) are present.

JPEG artifacts are to be expected when using JPEG files, however one would expect a quality setting to be available for the administrator of a MediaWiki installation to specify just how much JPEG artifacting is introduced when scaling images.

In some cases, the quality loss is so bad that we are forced to convert JPEG images to PNG so the images can be thumbnailed properly and used on the wiki.

Here is a comparison we made on our wiki: https://splatoonwiki.org/wiki/User:Heddy/thumbnail_test

We are using MediaWiki 1.30 and ImageMagick is doing the thumbnailing.


convert --version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

Event Timeline

Prod created this task.Apr 16 2018, 12:36 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 16 2018, 12:36 AM
Aklapper changed the task status from Open to Stalled.Apr 16 2018, 8:14 AM

Hi @Prod, thanks for taking the time to report this!
Unfortunately this report lacks some information. If you have time and can still reproduce the problem: Please add a more complete description to this report.
That can be a clear list of specific steps to reproduce the situation, as little details sometimes matter, so that nobody needs to guess how you performed each step, describing actual results and expected results after performing the steps to reproduce, providing a link to a public website where the issue can be seen, if you see the same behavior when you are not logged in, information about your web browser(s), MediaWiki version information (if it is not on a Wikimedia wiki), etc.
You can edit the task description by clicking Edit Task.
Ideally, exact and clear steps to reproduce should allow any other person to follow these steps (without having to interpret those steps) and see the same results. Problems that others can reliably reproduce can get fixed faster. Thanks!

Prod changed the task status from Stalled to Open.Apr 17 2018, 1:42 AM
Prod updated the task description. (Show Details)
Prod added a comment.Apr 17 2018, 1:45 AM

I have updated the description with our MediaWiki version, imagemagick version, and some comments from some of the power users.

ImageMagick offers a quality parameter: https://www.imagemagick.org/script/command-line-options.php#quality

I don't see yet how MediaWiki is involved here...

Prod added a comment.Apr 18 2018, 2:54 AM

Although ImageMagick offers a quality parameter, MediaWiki does not give us access to it.

We request a MediaWiki configuration option that lets us specify our desired quality parameter. Alternatively, access to set the filter parameter in imagemagick could also help us improve the quality of the thumbnails.

Aklapper renamed this task from JPEG quality cannot be configured to Offer a configuration option to specify desired JPEG (thumbnail) quality.Apr 18 2018, 10:14 AM
Aklapper edited projects, added MediaWiki-File-management; removed Multimedia.
Restricted Application added projects: Commons, Multimedia. · View Herald TranscriptApr 18 2018, 10:14 AM

Change 427707 had a related patch set uploaded (by Skizzerz; owner: Skizzerz):
[mediawiki/core@master] Add $wgJpegQuality to control jpg thumb quality

https://gerrit.wikimedia.org/r/427707

Change 427707 merged by jenkins-bot:
[mediawiki/core@master] Add $wgJpegQuality to control jpg thumb quality

https://gerrit.wikimedia.org/r/427707

Ramsey-WMF moved this task from Untriaged to Tracking on the Multimedia board.Apr 30 2018, 6:11 PM