Go to the documentation of this file.
41 if ( isset(
$params[
'quality'] ) && !self::validateQuality(
$params[
'quality'] ) ) {
48 if (
$name ===
'quality' ) {
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,
getMetadata( $image, $filename)
Get handler-specific metadata which will be saved in the img_metadata field.
Stuff specific to JPEG and (built-in) TIFF handler.
$wgExiftool
Path to exiftool binary.
const SRGB_EXIF_COLOR_SPACE
getScriptParams( $params)
Allows to change the fields on the form that will be generated $name
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
validateParam( $name, $value)
Validate a thumbnail parameter at parse time.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
supportsBucketing()
Returns whether or not this handler supports the chained generation of thumbnails according to bucket...
const SRGB_ICC_PROFILE_DESCRIPTION
when a variable name is used in a it is silently declared as a new masking the global
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in 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
normaliseParams( $image, &$params)
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
swapICCProfile( $filepath, array $colorSpaces, array $oldProfileStrings, $profileFilepath)
Swaps an embedded ICC profile for another, if found.
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 account incomplete not yet checked for validity & $retval
sanitizeParamsForBucketing( $params)
Returns a normalised params array for which parameters have been cleaned up for bucketing purposes.
wfEscapeShellArg()
Version of escapeshellarg() that works better on Windows.
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
$wgJpegTran
used for lossless jpeg rotation
getRotation( $file)
On supporting image formats, try to read out the low-level orientation of the file and return the ang...
$wgUseTinyRGBForJPGThumbnails
When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more lightweight (and ...
static validateQuality( $value)
Validate and normalize quality value to be between 1 and 100 (inclusive).
the array() calling protocol came about after MediaWiki 1.4rc1.
makeParamString( $params)
Merge a parameter array into a string appropriate for inclusion in filenames.
wfShellExecWithStderr( $cmd, &$retval=null, $environ=[], $limits=[])
Execute a shell command, returning both stdout and stderr.
transformImageMagick( $image, $params)
@inheritDoc
parseParamString( $str)
Parse a param string made with makeParamString back into an array.