Last modified: 2012-11-25 02:15:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 24855 - Black color is always taken as transparent when downsampling GIF images using GD
Black color is always taken as transparent when downsampling GIF images using GD
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.17.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: gif
  Show dependency treegraph
 
Reported: 2010-08-18 15:52 UTC by Vitaliy Filippov
Modified: 2012-11-25 02:15 UTC (History)
5 users (show)

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


Attachments
includes/media/Bitmap.php.diff (545 bytes, patch)
2010-08-18 15:53 UTC, Vitaliy Filippov
Details
Always resample setting + correct imagecolorallocatealpha (876 bytes, patch)
2011-06-06 14:26 UTC, Vitaliy Filippov
Details

Description Vitaliy Filippov 2010-08-18 15:52:57 UTC
Although code comments tell us "Initialise the destination image to transparent _instead_ of the default solid black, to support PNG and GIF transparency nicely", the black color is always taken as transparent when downsampling GIF images.
See the patch attached.
Comment 1 Vitaliy Filippov 2010-08-18 15:53:14 UTC
Created attachment 7636 [details]
includes/media/Bitmap.php.diff
Comment 2 Seth 2010-10-26 19:50:57 UTC
I was able to workaround this by changing $wgUseImageMagick to true in LocalSettings.
And then I just wiped out the images/thumbs directory and it redid all the gifs correctly.
Comment 3 p858snake 2011-04-30 00:10:16 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 4 Vitaliy Filippov 2011-06-06 14:21:56 UTC
Still actual for svn89562. Any progress?

(In reply to comment #2)
> I was able to workaround this by changing $wgUseImageMagick to true in
> LocalSettings.
> And then I just wiped out the images/thumbs directory and it redid all the gifs
> correctly.

That's not very good to use external converter when there's standard PHP GD available.
Comment 5 Vitaliy Filippov 2011-06-06 14:26:34 UTC
Created attachment 8622 [details]
Always resample setting + correct imagecolorallocatealpha

Additional comment: I think MW should have a setting for always downsampling paletted images with "imagecopyresampled" instead of "imagecopyresized" as the latter preserves transparency, but makes images ugly because of NearestNeighbor interpolation.
Comment 6 Sumana Harihareswara 2012-01-11 21:26:39 UTC
Comment on attachment 7636 [details]
includes/media/Bitmap.php.diff

Obsoleted by Vitaliy's next patch.
Comment 7 Sumana Harihareswara 2012-09-06 19:18:04 UTC
Vitaliy, I am so sorry for the wait for a response. To get this reviewed faster, I'd love to get it moved into Gerrit, our code review system.  https://www.mediawiki.org/wiki/Git/Tutorial gives you instructions on how to do that.  If this issue is still reproducible, could you submit it that way?

Thank you for the patch.
Comment 8 Alex Monk 2012-09-06 19:23:21 UTC
Moved in Gerrit change #22945
Comment 9 Alex Monk 2012-09-13 21:57:27 UTC
Vitaliy, could you please address the concerns posted by Brian Wolff on that Gerrit changeset?

>$wgGDAlwaysResample needs entry in DefaultSettings.php.
>Also should justify why a global is needed (what circumstances would you want the behaviour overriden)
Comment 10 Alex Monk 2012-11-25 02:15:55 UTC
(In reply to comment #8)
> Moved in Gerrit change #22945

Abandoned.

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


Navigation
Links