Inherited by BitmapHandler_ClientOnly, BmpHandler, GIFHandler, and TiffHandler.
Public Member Functions | |
normaliseParams ($image, &$params) | |
Changes the parameter array as necessary, ready for transformation. | |
getImageArea ($image, $width, $height) | |
doTransform ($image, $dstPath, $dstUrl, $params, $flags=0) | |
Get a MediaTransformOutput object representing the transformed output. | |
escapeMagickProperty ($s) | |
Escape a string for ImageMagick's property input (e.g. | |
escapeMagickInput ($path, $scene=false) | |
Escape a string for ImageMagick's input filenames. | |
escapeMagickOutput ($path, $scene=false) | |
Escape a string for ImageMagick's output filename. | |
getMetadata ($image, $filename) | |
Get handler-specific metadata which will be saved in the img_metadata field. | |
getMetadataType ($image) | |
Get a string describing the type of metadata, for display purposes. | |
isMetadataValid ($image, $metadata) | |
Check if the metadata string is valid for this handler. | |
visibleMetadataFields () | |
Get a list of EXIF metadata items which should be displayed when the metadata table is collapsed. | |
formatMetadata ($image) | |
Get an array structure that looks like this:. | |
Static Public Member Functions | |
static | imageJpegWrapper ($dst_image, $thumbPath) |
Protected Member Functions | |
escapeMagickPath ($path, $scene=false) | |
Armour a string against ImageMagick's GetPathComponent(). |
Definition at line 10 of file Bitmap.php.
BitmapHandler::doTransform | ( | $ | image, | |
$ | dstPath, | |||
$ | dstUrl, | |||
$ | params, | |||
$ | flags = 0 | |||
) |
Get a MediaTransformOutput object representing the transformed output.
Does the transform unless $flags contains self::TRANSFORM_LATER.
$image | File: the image object | |
$dstPath | String: filesystem destination path | |
$dstUrl | String: destination URL to use in output HTML | |
$params | Array: arbitrary set of parameters validated by $this->validateParam() | |
$flags | Integer: a bitfield, may contain self::TRANSFORM_LATER |
Reimplemented from MediaHandler.
Reimplemented in BitmapHandler_ClientOnly.
Definition at line 50 of file Bitmap.php.
References $src, $wgCustomConvertCommand, $wgImageMagickConvertCommand, $wgImageMagickTempDir, $wgMaxAnimatedGifArea, $wgSharpenParameter, $wgSharpenReductionThreshold, $wgUseImageMagick, $wgUseImageResize, escapeMagickInput(), escapeMagickOutput(), escapeMagickProperty(), normaliseParams(), MediaHandler::removeBadFile(), wfDebug(), wfDebugLog(), wfEscapeShellArg(), wfHostname(), wfMkdirParents(), wfMsg(), wfProfileIn(), wfProfileOut(), and wfShellExec().
BitmapHandler::escapeMagickInput | ( | $ | path, | |
$ | scene = false | |||
) |
Escape a string for ImageMagick's input filenames.
See ExpandFilenames() and GetPathComponent() in magick/utility.c.
This won't work with an initial ~ or @, so input files should be prefixed with the directory name.
Glob character unescaping is broken in ImageMagick before 6.6.1-5, but it's broken in a way that doesn't involve trying to convert every file in a directory, so we're better off escaping and waiting for the bugfix to filter down to users.
$path | string The file path | |
$scene | string The scene specification, or false if there is none |
Definition at line 284 of file Bitmap.php.
References $path, and escapeMagickPath().
Referenced by doTransform().
BitmapHandler::escapeMagickOutput | ( | $ | path, | |
$ | scene = false | |||
) |
Escape a string for ImageMagick's output filename.
See InterpretImageFilename() in magick/image.c.
Definition at line 301 of file Bitmap.php.
References $path, and escapeMagickPath().
Referenced by doTransform().
BitmapHandler::escapeMagickPath | ( | $ | path, | |
$ | scene = false | |||
) | [protected] |
Armour a string against ImageMagick's GetPathComponent().
This is a helper function for escapeMagickInput() and escapeMagickOutput().
$path | string The file path | |
$scene | string The scene specification, or false if there is none |
Definition at line 313 of file Bitmap.php.
References $path, and wfIsWindows().
Referenced by escapeMagickInput(), and escapeMagickOutput().
BitmapHandler::escapeMagickProperty | ( | $ | s | ) |
Escape a string for ImageMagick's property input (e.g.
-set -comment) See InterpretImageProperties() in magick/property.c
Definition at line 257 of file Bitmap.php.
References $s.
Referenced by doTransform().
BitmapHandler::formatMetadata | ( | $ | image | ) |
Get an array structure that looks like this:.
array( 'visible' => array( 'Human-readable name' => 'Human readable value', ... ), 'collapsed' => array( 'Human-readable name' => 'Human readable value', ... ) ) The UI will format this into a table where the visible fields are always visible, and the collapsed fields are optionally visible.
The function should return false if there is no metadata to display. FIXME: I don't really like this interface, it's not very flexible I think the media handler should generate HTML instead. It can do all the formatting according to some standard. That makes it possible to do things like visual indication of grouped and chained streams in ogg container files.
Reimplemented from MediaHandler.
Reimplemented in GIFHandler.
Definition at line 404 of file Bitmap.php.
References $name, $result, MediaHandler::addMeta(), and visibleMetadataFields().
BitmapHandler::getImageArea | ( | $ | image, | |
$ | width, | |||
$ | height | |||
) |
Reimplemented in GIFHandler.
Definition at line 46 of file Bitmap.php.
Referenced by normaliseParams().
BitmapHandler::getMetadata | ( | $ | image, | |
$ | path | |||
) |
Get handler-specific metadata which will be saved in the img_metadata field.
$image | File: the image object, or false if there isn't one | |
$path | String: the filename |
Reimplemented from MediaHandler.
Reimplemented in GIFHandler.
Definition at line 343 of file Bitmap.php.
References $filename, $wgShowEXIF, and Exif::version().
BitmapHandler::getMetadataType | ( | $ | image | ) |
Get a string describing the type of metadata, for display purposes.
Reimplemented from MediaHandler.
Reimplemented in GIFHandler.
Definition at line 359 of file Bitmap.php.
static BitmapHandler::imageJpegWrapper | ( | $ | dst_image, | |
$ | thumbPath | |||
) | [static] |
Definition at line 337 of file Bitmap.php.
BitmapHandler::isMetadataValid | ( | $ | image, | |
$ | metadata | |||
) |
Check if the metadata string is valid for this handler.
If it returns false, Image will reload the metadata from the file and update the database
Reimplemented from MediaHandler.
Definition at line 363 of file Bitmap.php.
References $wgShowEXIF, Exif::version(), and wfDebug().
BitmapHandler::normaliseParams | ( | $ | image, | |
&$ | params | |||
) |
Changes the parameter array as necessary, ready for transformation.
Should be idempotent. Returns false if the parameters are unacceptable and the transform should fail
Reimplemented from ImageHandler.
Reimplemented in BitmapHandler_ClientOnly.
Definition at line 11 of file Bitmap.php.
References $wgMaxImageArea, and getImageArea().
Referenced by doTransform().
BitmapHandler::visibleMetadataFields | ( | ) |
Get a list of EXIF metadata items which should be displayed when the metadata table is collapsed.
Definition at line 391 of file Bitmap.php.
References wfMsgForContent().
Referenced by formatMetadata().