Go to the documentation of this file.
38 if ( $version < 1 || $version >= 2 ) {
44 if ( !is_array( $metadata ) ) {
45 $metadata = unserialize( $metadata );
47 if ( !isset( $metadata[
'MEDIAWIKI_EXIF_VERSION'] ) || $metadata[
'MEDIAWIKI_EXIF_VERSION'] != 2 ) {
53 if ( isset( $metadata[
'Software'] )
54 && is_array( $metadata[
'Software'] )
55 && is_array( $metadata[
'Software'][0] )
56 && isset( $metadata[
'Software'][0][0] )
57 && isset( $metadata[
'Software'][0][1] )
59 $metadata[
'Software'] = $metadata[
'Software'][0][0] .
' (Version '
60 . $metadata[
'Software'][0][1] .
')';
66 if ( isset( $metadata[
'Contact'] ) ) {
67 $metadata[
'Contact'] =
69 $metadata[
'Contact'] );
72 foreach ( $metadata
as &$val ) {
73 if ( is_array( $val ) ) {
74 $val = $formatter->flattenArrayReal( $val,
'ul', $avoidHtml );
77 $metadata[
'MEDIAWIKI_EXIF_VERSION'] = 1;
90 # Metadata disabled and so an empty field is expected
93 if ( $metadata === self::OLD_BROKEN_FILE ) {
94 # Old special value indicating that there is no Exif data in the file.
95 # or that there was an error well extracting the metadata.
96 wfDebug( __METHOD__ .
": back-compat version\n" );
100 if ( $metadata === self::BROKEN_FILE ) {
104 $exif = unserialize( $metadata );
106 if ( !isset( $exif[
'MEDIAWIKI_EXIF_VERSION'] )
109 if ( isset( $exif[
'MEDIAWIKI_EXIF_VERSION'] )
110 && $exif[
'MEDIAWIKI_EXIF_VERSION'] == 1
113 wfDebug( __METHOD__ .
": back-compat version\n" );
117 # Wrong (non-compatible) version
118 wfDebug( __METHOD__ .
": wrong version\n" );
132 if ( count( $meta ) === 0 ) {
140 $metadata =
$file->getMetadata();
141 if ( $metadata === self::OLD_BROKEN_FILE
142 || $metadata === self::BROKEN_FILE
150 $exif = unserialize( $metadata );
154 unset( $exif[
'MEDIAWIKI_EXIF_VERSION'] );
172 $gis = parent::getImageSize( $image,
$path );
183 if ( $rotation == 90 || $rotation == 270 ) {
209 $data =
$file->getMetadata();
227 $data = unserialize( $data );
229 if ( isset( $data[
'Orientation'] ) ) {
230 # See http://sylvana.net/jpegcrop/exif_orientation.html
231 switch ( $data[
'Orientation'] ) {
static autoRotateEnabled()
Stuff specific to JPEG and (built-in) TIFF handler.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getImageSize( $image, $path)
Wrapper for base classes ImageHandler::getImageSize() that checks for rotation reported from metadata...
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
getCommonMetaArray(File $file)
Get an array of standard (FormatMetadata type) metadata values.
Implements some public methods and some protected utility functions which are required by multiple ch...
wfRestoreWarnings()
Restore error level to previous value.
Generic handler for bitmap images.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
getMetadataType( $image)
Get a string describing the type of metadata, for display purposes.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
convertMetadataVersion( $metadata, $version=1)
Convert metadata version.
if(PHP_SAPI !='cli') $file
getRotation( $file)
On supporting image formats, try to read out the low-level orientation of the file and return the ang...
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
isMetadataValid( $image, $metadata)
getRotationForExif( $data)
Given a chunk of serialized Exif metadata, return the orientation as degrees of rotation.