|
MediaWiki master
|
Class to deal with reconciling and extracting metadata from bitmap images. More...
Public Member Functions | |
| addMetadata ( $metaArray, $type='other') | |
| Add misc metadata. | |
| getExif ( $filename, $byteOrder) | |
| Get exif info using exif class. | |
| getMetadataArray () | |
| Merge together the various types of metadata the different types have different priorities, and are merged in order. | |
Static Public Member Functions | |
| static | getTiffByteOrder ( $filename) |
| Read the first 2 bytes of a tiff file to figure out Little Endian or Big Endian. | |
| static | GIF ( $filename) |
| function for gif images. | |
| static | Jpeg ( $filename) |
| Main entry point for jpeg's. | |
| static | PNG ( $filename) |
| Entry point for png At some point in the future this might merge the png various tEXt chunks to that are interesting, but for now it only does XMP. | |
| static | Tiff ( $filename) |
| This doesn't do much yet, but eventually I plan to add XMP support for Tiff. | |
Class to deal with reconciling and extracting metadata from bitmap images.
This is meant to comply with http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf
This sort of acts as an intermediary between MediaHandler::getMetadata and the various metadata extractors.
Definition at line 31 of file BitmapMetadataHandler.php.
| MediaWiki\Media\BitmapMetadataHandler::addMetadata | ( | $metaArray, | |
| $type = 'other' ) |
Add misc metadata.
Warning: atm if the metadata category doesn't have a priority, it will be silently discarded.
| array | $metaArray | Array of metadata values |
| string | $type | Type. defaults to other. if two things have the same type they're merged |
Definition at line 100 of file BitmapMetadataHandler.php.
Referenced by MediaWiki\Media\BitmapMetadataHandler\getExif().
| MediaWiki\Media\BitmapMetadataHandler::getExif | ( | $filename, | |
| $byteOrder ) |
Get exif info using exif class.
Basically what used to be in BitmapHandler::getMetadata(). Just calls stuff in the Exif class.
Parameters are passed to the Exif class.
| string | $filename | |
| string | $byteOrder |
Definition at line 83 of file BitmapMetadataHandler.php.
References MediaWiki\Media\BitmapMetadataHandler\addMetadata(), MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\ShowEXIF.
| MediaWiki\Media\BitmapMetadataHandler::getMetadataArray | ( | ) |
Merge together the various types of metadata the different types have different priorities, and are merged in order.
This function is generally called by the media handlers' getMetadata()
Definition at line 118 of file BitmapMetadataHandler.php.
|
static |
Read the first 2 bytes of a tiff file to figure out Little Endian or Big Endian.
Needed for exif stuff.
| string | $filename |
Definition at line 318 of file BitmapMetadataHandler.php.
Referenced by MediaWiki\Media\BitmapMetadataHandler\PNG(), and MediaWiki\Media\BitmapMetadataHandler\Tiff().
|
static |
function for gif images.
They don't really have native metadata, so just merges together XMP and image comment.
| string | $filename | Full path to file |
Definition at line 243 of file BitmapMetadataHandler.php.
References MediaWiki\Media\GIFMetadataExtractor\getMetadata(), and MediaWiki\Media\GIFMetadataExtractor\VERSION.
Referenced by MediaWiki\Media\GIFHandler\getSizeAndMetadata().
|
static |
Main entry point for jpeg's.
| string | $filename | Filename (with full path) |
| InvalidJpegException |
Definition at line 153 of file BitmapMetadataHandler.php.
References MediaWiki\Media\JpegMetadataExtractor\segmentSplitter().
Referenced by MediaWiki\Media\JpegHandler\getSizeAndMetadata().
|
static |
Entry point for png At some point in the future this might merge the png various tEXt chunks to that are interesting, but for now it only does XMP.
| string | $filename | Full path to file |
Definition at line 198 of file BitmapMetadataHandler.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Media\PNGMetadataExtractor\getMetadata(), MediaWiki\Media\BitmapMetadataHandler\getTiffByteOrder(), and MediaWiki\Media\PNGMetadataExtractor\VERSION.
Referenced by MediaWiki\Media\PNGHandler\getSizeAndMetadata().
|
static |
This doesn't do much yet, but eventually I plan to add XMP support for Tiff.
(PHP's exif support already extracts but needs some further processing because PHP's exif support is stupid...)
The various exceptions this throws are caught later.
| string | $filename |
| InvalidTiffException |
Definition at line 282 of file BitmapMetadataHandler.php.
References MediaWiki\Media\BitmapMetadataHandler\getTiffByteOrder(), and MediaWiki\Media\Exif\version().
Referenced by MediaWiki\Media\TiffHandler\getSizeAndMetadata().