Instead of always generating thumbnails based on the original,
this adds the ability to generate thumbnails based on
references buckets. The buckets themselves have their
generation chained following the same process (smaller bucket
generated based on bigger bucket). In situations where no
suitable bucket is found, the original is used, like it used to.
This is entirely optional, as most non-WMF wikis would probably prefer
to keep generating all thumbnails based on originals.
The quality implications have been verified through a survey
aimed at Commons users and people actually preferred the chained version.
Presumably due to the multiple passes of sharpening which maintained
visual details better for small thumbnail sizes.
Change-Id: I285d56b2024c81365247338f85c1e0aa708cb21e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/600
Bug: 67525
The -layers merge option flattens all layers on to a canvas
of whatever color -background is set to. However -background
was white for the PNG bKGD chunk. Set it to transparent just
for the -layers merge operation.
This works well on most recent image magick. Older image magick
explodes on my test image (I tested 6.6.0-4), so unclear if it
works there, but it certainly didn't make anything worse.
Wikimedia uses a version between the two that I tested so hopefully
this will make things better, and if it doesn't, it eventually will
when we update image magick.
Bug: 35622
Change-Id: I77601cdf005a64ae8ea7516cc846620431917863
IM doesn't seem to properly interpret greyscale xcf files
as being greyscale. Tell it to just take the red channel
in such a case.
Bug: 66323
Change-Id: I46302d43e1029d815be99f481f3942481becd74f
Caused the animation warning to not be present on
image description pages
Also add unit tests. Since I'm adding an animated svg file for
this unit test, also add a metadata extraction test for animated
svgs, since we're missing one.
Change-Id: Id03e1a0e1c151d3c575a695a42c54b709187d10a
follow-up: 876128f8c9
Allows media handlers to signal that thumbnail generation
for this file is expensive and should be throttled more agressively.
For now this is only done for large TIFF files.
Bug: 65691
Change-Id: I01b34a1d46745649f179fdee435a8cfb19c5474e
MediaHandler::getLongDesc and getGeneralLongDesc have same
implementation, so forward one method to the other. Same for
short.
Also get rid of one unnecessary $wgLang global usage.
Change-Id: I688e27ce2b9cf950defa16ec6bce2e52c5959b03
If a file is broken, we don't want to spend time trying to find
its metadata over and over again.
Bug: 41090
Change-Id: Iad63b8942af99e1ec44530599a43ec1d6b2b8a62
This change causes wiki syntax like
[[File:Foo.djvu|thumb|Page 7 of document]]
to be interpreted as a caption instead, of saying select page 7
of the djvu. Previously it eventually ran intval( '7 of document' ),
so flipped to page 7.
Only possible downside I could see is this would cause things like
left-to-right marks and weird unicode spaces to no longer be ignored.
I don't think that's a big deal.
Change-Id: Ie8c953009a38557876a274bf0f71ab470f66ef4e
* Previously, the resulting thumbnail did not handle hasFile() and
stream() properly. This effected doCachedWork() in thumb.php
Change-Id: I8fd025204b5b41472be6c09924892fe8ee9dd260
These files have all had treatment before, and these occurrences have either
been missed or have been introduced after.
Change-Id: I06cdab4616b5bff47c85152df28f18c861730a23
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Previously metadata was stored as a string of XML. Some of the
code in File expects the metadata to be an array serialized using
PHP's serialization format. In particular, this fixes the api
query=imageinfo module, and by extension instantCommons.
This supersedes Icaa16eeb
Bug: 37764
Change-Id: I5c1d2d2434f70b57137837bade797d4133c47b70
It's the same, right? in_array() must search for a value and therefor
is expensive. array_key_exists() searches for a key and should be
much cheaper. Also easier to read.
Change-Id: Ide17d5af13c416c62a40029848ac17ba24eb5563
It was being called in File::getLength, but was only implemented
in a subclass, that's not even in core. Any method of a handler
class called from a method in File class should work on any
subclass of MediaHandler.
Change-Id: I94eda90ec3dd64b6ff2e3a5732aa539366cec521
Also have ImagePage check that the given language is actually
valid, before trying to transform with that language.
Change-Id: I62b8035b70f5cb3388f4c2a844f3bc1c7c92d01e