MediaWiki  REL1_19
ExifBitmapHandler Class Reference

Stuff specific to JPEG and (built-in) TIFF handler. More...

Inheritance diagram for ExifBitmapHandler:
Collaboration diagram for ExifBitmapHandler:

List of all members.

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.

Detailed Description

Stuff specific to JPEG and (built-in) TIFF handler.

All metadata related, since both JPEG and TIFF support Exif.

Definition at line 13 of file ExifBitmap.php.


Member Function Documentation

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.

Parameters:
$metadataMixed String or Array metadata array (serialized if string)
$versionInteger target version
Returns:
Array serialized metadata in specified version, or $metadata on fail.

Reimplemented from MediaHandler.

Definition at line 18 of file ExifBitmap.php.

References $version, FormatMetadata\collapseContactInfo(), and FormatMetadata\flattenArray().

Here is the call graph for this function:

Parameters:
$imageFile
Returns:
array|bool

Reimplemented from MediaHandler.

Definition at line 102 of file ExifBitmap.php.

References MediaHandler\formatMetadataHelper(), and isMetadataValid().

Here is the call graph for this function:

ExifBitmapHandler::getImageSize ( image,
path 
)

Wrapper for base classes ImageHandler::getImageSize() that checks for rotation reported from metadata and swaps the sizes to match.

Parameters:
File$image
string$path
Returns:
array

Reimplemented from ImageHandler.

Definition at line 136 of file ExifBitmap.php.

References $path, $wgEnableAutoRotation, MediaHandler\getMetadata(), and getRotationForExif().

Here is the call graph for this function:

Get a string describing the type of metadata, for display purposes.

Returns:
string

Reimplemented from MediaHandler.

Definition at line 124 of file ExifBitmap.php.

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.

Parameters:
$fileFile
Returns:
int 0, 90, 180 or 270

Reimplemented from BitmapHandler.

Definition at line 169 of file ExifBitmap.php.

References $file, $wgEnableAutoRotation, and getRotationForExif().

Here is the call graph for this function:

ExifBitmapHandler::getRotationForExif ( data) [protected]

Given a chunk of serialized Exif metadata, return the orientation as degrees of rotation.

Parameters:
string$data
Returns:
int 0, 90, 180 or 270 orientation can include flipping as well; see if this is an issue!

Definition at line 187 of file ExifBitmap.php.

References wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by getImageSize(), and getRotation().

Here is the call graph for this function:

Here is the caller graph for this function:

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 63 of file ExifBitmap.php.

References $wgShowEXIF, MediaHandler\METADATA_BAD, MediaHandler\METADATA_COMPATIBLE, MediaHandler\METADATA_GOOD, Exif\version(), wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by formatMetadata().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 16 of file ExifBitmap.php.

Referenced by ExifBitmapTest\testIsOldBroken().


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