Commit graph

22 commits

Author SHA1 Message Date
Antoine Musso
c5d736bcad media: Capture stderr when running 'convert --version'
At Wikimedia, $wgImageMagickConvertCommand points to a shell wrapper
that invokes ImageMagick convert with:

  firejail --profile=/etc/firejail/mediawiki-converters.profile

firejail emits to stderr an information message:

  Reading profile /etc/firejail/mediawiki-converters.profile

That ends up in HHVM stderr and is populated up to logstash as an error.

MediaWiki does check imagemagick version by running `convert -version`,
switch from wfShellExec() to wfShellExecWithStderr().

Bug: T158649
Change-Id: I78d1ef59533c605f59b42e10556bb595d6c2cc15
2017-04-15 03:22:33 +00:00
Timo Tijhof
3a2a707546 Clean up remaining get_class() uses
* get_class()        -> __CLASS__ (same as self::class)
* get_called_class() -> static::class
* get_class($this)   -> static::class

Change-Id: I1888a1897ecf4548a2e5a67a942e5c080dd7e3d3
2017-03-07 22:03:47 +00:00
Brad Jorsch
645266fe3e Fix MediaTransformError message handling
Give access to the raw Message instead of only to the HTML or text in
the RequestContext language.

Pass Message objects instead of strings from calling ->text() as the
parameters of Messages so if the outer Message's language is changed
things get parsed sensibly.

Change-Id: Ibd6c1217b6fed839c888b66e02900f8e21ed3e6b
2016-11-30 10:56:03 -05:00
Bartosz Dziewoński
e474bdca31 TransformationalImageHandler: Fix use of __METHOD__ in closure
Change-Id: Idff6303fac1f494ea59b88fd73245c63f2cf4a76
2016-11-10 14:18:48 +01:00
Aaron Schulz
88aa91f84a Clean up some ObjectCache factory callers
* Use services container in more places.
* Undeprecated getLocalServerInstance() since $fallback is not
  handled elsewhere.

Change-Id: Id1fcd1c465d2d92653357523f4225f1c4d1ace2f
2016-10-03 11:44:55 -07:00
Amir Sarabadani
9850c542c6 Clean up array() syntax in docs, part VII
Last part

Change-Id: I38f015e2122ef4fd2d2141718bd889794c29f06c
2016-09-27 06:53:25 +03:30
Ricordisamoa
e64035522d Fix and standardize Doxygen tags
* Use "@param datatype $paramname description" format

* String → string, Integer → int etc.

* @return $string → @return string

Change-Id: I860d222382cb4c5699d313b0600bd22503c8c385
2016-04-30 12:10:17 +02:00
Reedy
b5656b6953 Many more function case mismatches
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
2016-03-19 00:20:58 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Andrew H
695a93dd33 Add support for image interlacing of Bitmap type images
Add 'interlace' parameter and $wgMaxInterlacingSizes global.

Bug: T120032
Change-Id: I40dee74060026513f1c2be8c22dfe41a0b4a18df
2016-01-16 05:48:27 +00:00
Aaron Schulz
17c91ad610 Replace newAccelerator() with getLocalServerInstance()
The name is clearer and more consistent, with simpler arguments.

Change-Id: I7205a99ce033e8b086a52cd02c8a721e99c84b1e
2015-11-02 21:39:08 +00:00
Timo Tijhof
e8275758fe objectcache: Introduce IExpiringStore for convenient TTL constants
Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.

Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742
2015-10-28 04:07:25 +00:00
Aaron Schulz
33765cb8dd Convert getMagickVersion() to using APC
Shelling out on my slow vagrant VM takes about ~3-4ms
so it's probably not worth a  fallback.

Change-Id: Ifd5758264cc15f1ae07972e839a243f5f891503e
2015-10-26 01:15:09 -07:00
umherirrender
516265fa17 Bypass TransformTooBigImageAreaError for ForeignApiFile
The check if the image area is smaller than $wgMaxImageArea can be
bypassed for ForeignApiFile, because the transform of the file is done
on another physical server and therefore has it own check for
$wgMaxImageArea.
A possible TransformTooBigImageAreaError from the foreign server will be
shown when needed (Prepended by message 'thumbnail_error_remote').

Bug: T34387
Change-Id: Iccb25c00e132a4fe744840b7b8db7d9af620bce2
2015-05-26 05:05:00 +00:00
Roan Kattouw
016d617bc3 Followup cf5f641: pass $params by reference again
&$params was changed to $params, but hooks.txt still documents
this parameter as being passed by reference, and VipsScaler expects this.

Giuseppe and I suspect this may be what's causing the HHVM segfaults
we're seeing in beta labs.

Change-Id: Ib018f23bc44c247aefc277a0c75ff8577f309ab4
2014-12-15 16:07:55 +00:00
umherirrender
cf5f6414ce Add better error message for files which exceeds $wgMaxImageArea
Added a TransformTooBigImageAreaError to allow setting an extra message.
Added also size-*pixel messages to show the value of $wgMaxImageArea
with some formatting.

This error is still throwing for all files, to fix bug T34387 this needs
a follow up with a proper check. I am not sure, if a File::isLocal() is
okay, because files from a DBForeignRepo maybe transformed on the same
server, so the check needs to be done also for this. For APIForeignRepo
the check is done on the foreign server.

Change-Id: Ieba12e424c8bddb1961a30d3f9ea5c8ff241abb5
2014-12-15 08:25:04 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Gilles Dubuc
27f6596a86 Don't re-apply EXIF rotation to chained thumbnails
Change-Id: I2f0674e4aea508ad7e00b7742a9d47bd0659e399
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/600
Bug: 67525
Bug: 73352
2014-11-13 11:26:15 +01:00
jenkins-bot
ce08c62552 Merge "Array to string conversion in TransformationalImageHandler.php:167" 2014-09-17 17:29:22 +00:00
Reedy
d033d1749d Undefined $scaler in TransformationalImageHandler::rotate()
Bug: 70903
Change-Id: I25899d9a3435150c97bc94d80004fc19d38b3638
2014-09-17 17:01:23 +01:00
Reedy
e99e2ea076 Array to string conversion in TransformationalImageHandler.php:167
Bug: 70902
Change-Id: Ia5e0949fc18275955dd1d320f8d538e3f2a7855b
2014-09-17 16:55:42 +01:00
Brian Wolff
757a70ae0a Split BitmapHandler into two classes.
BitmapHandler has a lot of generic-ish functionality that could
be re-usable by extension classes (Such as how it organizes
$scalerParams array, or various image magick escaping methods).
However it's combined with a lot of very format specific things,
such as the shell-out call to image magick.

Try to separate out the more generic stuff into
TransformationalImageHandler. In order to do this, I also made
canRotate, autoRotateEnabled, and getScalerType non-static. No
extensions in our repo appeared to be using these methods, and they
don't really make sense to be static (imo).

In particular, I think code duplication can be reduced in
PagedTiffHandler by extending this new class. See comments
on I1b9a77a4a56eeb65.

Change-Id: Id3a8b25a598942572cb5791a95e86054d7784961
2014-09-14 22:10:37 +00:00