41 if ( isset(
$params[
'quality'] ) && !self::validateQuality(
$params[
'quality'] ) ) {
48 if ( $name ===
'quality' ) {
51 return parent::validateParam( $name,
$value );
67 $res =
"q{$params['quality']}-$res";
79 if ( preg_match(
'/q([^-]+)-(.*)$/', $str, $m ) ) {
81 if ( self::validateQuality( $v ) ) {
82 $res = parent::parseParamString( $m[2] );
88 $res = parent::parseParamString( $str );
95 if ( isset(
$params[
'quality'] ) ) {
104 if ( !is_array( $meta ) ) {
106 throw new MWException(
'Metadata array is not an array' );
111 }
catch ( Exception
$e ) {
114 wfDebug( __METHOD__ .
': ' .
$e->getMessage() .
"\n" );
147 wfDebug( __METHOD__ .
": running jpgtran: $cmd\n" );
158 return parent::rotate( $file,
$params );
170 if ( isset(
$params[
'quality'] ) ) {
216 realpath( __DIR__ ) .
'/tinyrgb.icc'
235 array $oldProfileStrings, $profileFilepath
245 '-ICC_Profile:ProfileDescription',
254 $data = explode(
"\t", trim(
$output ) );
262 $colorSpaceRegex =
'/'.preg_quote( $data[0],
'/' ).
'/i';
263 if ( empty( preg_grep( $colorSpaceRegex, $colorSpaces ) ) ) {
268 $profileRegex =
'/'.preg_quote( $data[1],
'/' ).
'/i';
269 if ( empty( preg_grep( $profileRegex, $oldProfileStrings ) ) ) {
275 '-overwrite_original',
276 '-icc_profile<=' . $profileFilepath,
$wgUseTinyRGBForJPGThumbnails
When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more lightweight (and ...
$wgJpegTran
used for lossless jpeg rotation
$wgExiftool
Path to exiftool binary.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfEscapeShellArg()
Version of escapeshellarg() that works better on Windows.
wfShellExecWithStderr( $cmd, &$retval=null, $environ=[], $limits=[])
Execute a shell command, returning both stdout and stderr.
Stuff specific to JPEG and (built-in) TIFF handler.
getRotation( $file)
On supporting image formats, try to read out the low-level orientation of the file and return the ang...
makeParamString( $params)
Merge a parameter array into a string appropriate for inclusion in filenames.
validateParam( $name, $value)
Validate a thumbnail parameter at parse time.
const SRGB_ICC_PROFILE_DESCRIPTION
getScriptParams( $params)
getMetadata( $image, $filename)
Get handler-specific metadata which will be saved in the img_metadata field.
swapICCProfile( $filepath, array $colorSpaces, array $oldProfileStrings, $profileFilepath)
Swaps an embedded ICC profile for another, if found.
static validateQuality( $value)
Validate and normalize quality value to be between 1 and 100 (inclusive).
supportsBucketing()
Returns whether or not this handler supports the chained generation of thumbnails according to bucket...
const SRGB_EXIF_COLOR_SPACE
parseParamString( $str)
Parse a param string made with makeParamString back into an array.
sanitizeParamsForBucketing( $params)
Returns a normalised params array for which parameters have been cleaned up for bucketing purposes.
normaliseParams( $image, &$params)
transformImageMagick( $image, $params)
@inheritDoc
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account incomplete not yet checked for validity & $retval
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check $image
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
returning false will NOT prevent logging $e