MediaWiki  REL1_24
JpegHandler Class Reference

JPEG specific handler. More...

Inheritance diagram for JpegHandler:
Collaboration diagram for JpegHandler:

List of all members.

Public Member Functions

 getMetadata ($image, $filename)
 Get handler-specific metadata which will be saved in the img_metadata field.
 getScriptParams ($params)
 makeParamString ($params)
 Merge a parameter array into a string appropriate for inclusion in filenames.
 normaliseParams ($image, &$params)
 parseParamString ($str)
 Parse a param string made with makeParamString back into an array.
 rotate ($file, $params)
 sanitizeParamsForBucketing ($params)
 Returns a normalised params array for which parameters have been cleaned up for bucketing purposes.
 supportsBucketing ()
 Returns whether or not this handler supports the chained generation of thumbnails according to buckets.
 validateParam ($name, $value)
 Validate a thumbnail parameter at parse time.

Static Private Member Functions

static validateQuality ($value)
 Validate and normalize quality value to be between 1 and 100 (inclusive).

Detailed Description

JPEG specific handler.

Inherits most stuff from BitmapHandler, just here to do the metadata handler differently.

Metadata stuff common to Jpeg and built-in Tiff (not PagedTiffHandler) is in ExifBitmapHandler.

Definition at line 33 of file Jpeg.php.


Member Function Documentation

JpegHandler::getMetadata ( image,
path 
)

Get handler-specific metadata which will be saved in the img_metadata field.

Parameters:
File$imageThe image object, or false if there isn't one. Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
string$pathThe filename
Returns:
string A string of metadata in php serialized form (Run through serialize())

Reimplemented from MediaHandler.

Definition at line 99 of file Jpeg.php.

References $e, ExifBitmapHandler\BROKEN_FILE, BitmapMetadataHandler\Jpeg(), version, and wfDebug().

Reimplemented from ImageHandler.

Definition at line 91 of file Jpeg.php.

References $params, and $res.

Merge a parameter array into a string appropriate for inclusion in filenames.

Parameters:
array$paramsArray of parameters that have been through normaliseParams.
Returns:
string

Reimplemented from ImageHandler.

Definition at line 61 of file Jpeg.php.

References $params, and $res.

JpegHandler::normaliseParams ( image,
&$  params 
)
Parameters:
File$image
array$paramsTransform parameters. Entries with the keys 'width' and 'height' are the respective screen width and height, while the keys 'physicalWidth' and 'physicalHeight' indicate the thumbnail dimensions.
Returns:
bool

Reimplemented from TransformationalImageHandler.

Definition at line 35 of file Jpeg.php.

References $params.

Parse a param string made with makeParamString back into an array.

Parameters:
string$strThe parameter string without file name (e.g. 122px)
Returns:
array|bool Array of parameters or false on failure.

Reimplemented from ImageHandler.

Definition at line 70 of file Jpeg.php.

References $res.

JpegHandler::rotate ( file,
params 
)
Parameters:
File$file
array$paramsRotate parameters. 'rotation' clockwise rotation in degrees, allowed are multiples of 90
Since:
1.21
Returns:
bool

Reimplemented from BitmapHandler.

Definition at line 135 of file Jpeg.php.

References $file, $params, $retval, ExifBitmapHandler\getRotation(), global, MediaHandler\logErrorForExternalProcess(), wfDebug(), wfEscapeShellArg(), wfProfileIn(), wfProfileOut(), and wfShellExecWithStderr().

Returns a normalised params array for which parameters have been cleaned up for bucketing purposes.

Parameters:
array$params
Returns:
array

Reimplemented from ImageHandler.

Definition at line 166 of file Jpeg.php.

References $params.

Returns whether or not this handler supports the chained generation of thumbnails according to buckets.

Returns:
bool
Since:
1.24

Reimplemented from MediaHandler.

Definition at line 162 of file Jpeg.php.

JpegHandler::validateParam ( name,
value 
)

Validate a thumbnail parameter at parse time.

Return true to accept the parameter, and false to reject it. If you return false, the parser will do something quiet and forgiving.

Parameters:
string$name
mixed$value

Reimplemented from ImageHandler.

Definition at line 45 of file Jpeg.php.

References $name, $value, and validateQuality().

static JpegHandler::validateQuality ( value) [static, private]

Validate and normalize quality value to be between 1 and 100 (inclusive).

Parameters:
int$valueQuality value, will be converted to integer or 0 if invalid
Returns:
bool True if the value is valid

Definition at line 57 of file Jpeg.php.

References $value.

Referenced by validateParam().


The documentation for this class was generated from the following file: