MediaWiki
REL1_22
|
Stuff specific to JPEG and (built-in) TIFF handler. More...
Public Member Functions | |
convertMetadataVersion ($metadata, $version=1) | |
Convert metadata version. | |
formatMetadata ($image) | |
getImageSize ($image, $path) | |
Wrapper for base classes ImageHandler::getImageSize() that checks for rotation reported from metadata and swaps the sizes to match. | |
getMetadataType ($image) | |
Get a string describing the type of metadata, for display purposes. | |
getRotation ($file) | |
On supporting image formats, try to read out the low-level orientation of the file and return the angle that the file needs to be rotated to be viewed. | |
isMetadataValid ($image, $metadata) | |
Check if the metadata string is valid for this handler. | |
Public Attributes | |
const | BROKEN_FILE = '-1' |
const | OLD_BROKEN_FILE = '0' |
Protected Member Functions | |
getRotationForExif ($data) | |
Given a chunk of serialized Exif metadata, return the orientation as degrees of rotation. |
Stuff specific to JPEG and (built-in) TIFF handler.
All metadata related, since both JPEG and TIFF support Exif.
Definition at line 30 of file ExifBitmap.php.
ExifBitmapHandler::convertMetadataVersion | ( | $ | metadata, |
$ | version = 1 |
||
) |
Convert metadata version.
By default just returns $metadata, but can be used to allow media handlers to convert between metadata versions.
$metadata | Mixed String or Array metadata array (serialized if string) |
$version | Integer target version |
Reimplemented from MediaHandler.
Definition at line 35 of file ExifBitmap.php.
References as, FormatMetadata\collapseContactInfo(), and FormatMetadata\flattenArray().
ExifBitmapHandler::formatMetadata | ( | $ | image | ) |
$image | File |
Reimplemented from MediaHandler.
Definition at line 119 of file ExifBitmap.php.
References MediaHandler\formatMetadataHelper(), and isMetadataValid().
ExifBitmapHandler::getImageSize | ( | $ | image, |
$ | path | ||
) |
Wrapper for base classes ImageHandler::getImageSize() that checks for rotation reported from metadata and swaps the sizes to match.
File | $image | |
string | $path |
Reimplemented from ImageHandler.
Definition at line 153 of file ExifBitmap.php.
References $path, MediaHandler\getMetadata(), getRotationForExif(), and global.
ExifBitmapHandler::getMetadataType | ( | $ | image | ) |
Get a string describing the type of metadata, for display purposes.
Reimplemented from MediaHandler.
Definition at line 141 of file ExifBitmap.php.
ExifBitmapHandler::getRotation | ( | $ | file | ) |
On supporting image formats, try to read out the low-level orientation of the file and return the angle that the file needs to be rotated to be viewed.
This information is only useful when manipulating the original file; the width and height we normally work with is logical, and will match any produced output views.
$file | File |
Reimplemented from MediaHandler.
Definition at line 186 of file ExifBitmap.php.
References $file, getRotationForExif(), and global.
Referenced by JpegHandler\rotate().
ExifBitmapHandler::getRotationForExif | ( | $ | data | ) | [protected] |
Given a chunk of serialized Exif metadata, return the orientation as degrees of rotation.
string | $data |
Definition at line 205 of file ExifBitmap.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by getImageSize(), and getRotation().
ExifBitmapHandler::isMetadataValid | ( | $ | image, |
$ | metadata | ||
) |
Check if the metadata string is valid for this handler.
If it returns MediaHandler::METADATA_BAD (or false), Image will reload the metadata from the file and update the database. MediaHandler::METADATA_GOOD for if the metadata is a-ok, MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards compatible (which may or may not trigger a metadata reload).
Reimplemented from MediaHandler.
Definition at line 80 of file ExifBitmap.php.
References global, MediaHandler\METADATA_BAD, MediaHandler\METADATA_COMPATIBLE, MediaHandler\METADATA_GOOD, Exif\version(), wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by formatMetadata().
const ExifBitmapHandler::BROKEN_FILE = '-1' |
Definition at line 32 of file ExifBitmap.php.
Referenced by JpegHandler\getMetadata(), TiffHandler\getMetadata(), and JpegTest\testInvalidFile().
const ExifBitmapHandler::OLD_BROKEN_FILE = '0' |
Definition at line 33 of file ExifBitmap.php.