38 }
catch ( Exception $e ) {
40 wfDebug( __METHOD__ .
': ' . $e->getMessage() );
55 if ( count( $meta ) === 0 ) {
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'];
unserialize( $serialized)
$wgMaxAnimatedGifArea
Force thumbnailing of animated GIFs above this size to a single frame instead of an animated thumbnai...
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Generic handler for bitmap images.
Implements some public methods and some protected utility functions which are required by multiple ch...
getMetadata()
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB Stable to override.
isMetadataValid( $image, $metadata)
Check if the metadata string is valid for this handler.
getLength( $file)
Return the duration of the GIF file.
getMetadata( $image, $filename)
Get handler-specific metadata which will be saved in the img_metadata field.
canAnimateThumbnail( $file)
We cannot animate thumbnails that are bigger than a particular size.
formatMetadata( $image, $context=false)
const BROKEN_FILE
Value to store in img_metadata if there was error extracting metadata.
getMetadataType( $image)
Get a string describing the type of metadata, for display purposes.
getCommonMetaArray(File $image)
Return the standard metadata elements for #filemetadata parser func.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.