Go to the documentation of this file.
38 }
catch ( Exception $e ) {
40 wfDebug( __METHOD__ .
': ' . $e->getMessage() );
74 if ( !isset( $meta[
'metadata'] ) ) {
77 unset( $meta[
'metadata'][
'_MW_GIF_VERSION'] );
79 return $meta[
'metadata'];
89 $ser = $image->getMetadata();
92 if ( isset( $metadata[
'frameCount'] ) && $metadata[
'frameCount'] > 0 ) {
93 return $image->getWidth() * $image->getHeight() * $metadata[
'frameCount'];
95 return $image->getWidth() * $image->getHeight();
98 return $image->getWidth() * $image->getHeight();
107 $ser = $image->getMetadata();
110 if ( isset( $metadata[
'frameCount'] ) && $metadata[
'frameCount'] > 1 ) {
134 if ( $metadata === self::BROKEN_FILE ) {
139 Wikimedia\suppressWarnings();
141 Wikimedia\restoreWarnings();
143 if ( !$data || !is_array( $data ) ) {
144 wfDebug( __METHOD__ .
" invalid GIF metadata" );
149 if ( !isset( $data[
'metadata'][
'_MW_GIF_VERSION'] )
152 wfDebug( __METHOD__ .
" old but compatible GIF metadata" );
167 $original = parent::getLongDesc( $image );
169 Wikimedia\suppressWarnings();
171 Wikimedia\restoreWarnings();
173 if ( !$metadata || $metadata[
'frameCount'] <= 1 ) {
181 if ( $metadata[
'looped'] ) {
182 $info[] =
wfMessage(
'file-info-gif-looped' )->parse();
185 if ( $metadata[
'frameCount'] > 1 ) {
186 $info[] =
wfMessage(
'file-info-gif-frames' )->numParams( $metadata[
'frameCount'] )->parse();
189 if ( $metadata[
'duration'] ) {
190 $info[] =
$wgLang->formatTimePeriod( $metadata[
'duration'] );
193 return $wgLang->commaList( $info );
205 $serMeta =
$file->getMetadata();
206 Wikimedia\suppressWarnings();
208 Wikimedia\restoreWarnings();
210 if ( !$metadata || !isset( $metadata[
'duration'] ) || !$metadata[
'duration'] ) {
213 return (
float)$metadata[
'duration'];
canAnimateThumbnail( $file)
We cannot animate thumbnails that are bigger than a particular size.
getMetadata()
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB Stable to override.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
getMetadata( $image, $filename)
Get handler-specific metadata which will be saved in the img_metadata field.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Implements some public methods and some protected utility functions which are required by multiple ch...
Generic handler for bitmap images.
getCommonMetaArray(File $image)
Return the standard metadata elements for #filemetadata parser func.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
$wgMaxAnimatedGifArea
Force thumbnailing of animated GIFs above this size to a single frame instead of an animated thumbnai...
isMetadataValid( $image, $metadata)
Check if the metadata string is valid for this handler.
const BROKEN_FILE
Value to store in img_metadata if there was error extracting metadata.
unserialize( $serialized)
getLength( $file)
Return the duration of the GIF file.
getMetadataType( $image)
Get a string describing the type of metadata, for display purposes.
formatMetadata( $image, $context=false)