MediaWiki  1.23.2
Tiff.php
Go to the documentation of this file.
1 <?php
41  function canRender( $file ) {
42  global $wgTiffThumbnailType;
43 
44  return (bool)$wgTiffThumbnailType
45  || $file->getRepo() instanceof ForeignAPIRepo;
46  }
47 
55  function mustRender( $file ) {
56  return true;
57  }
58 
65  function getThumbType( $ext, $mime, $params = null ) {
66  global $wgTiffThumbnailType;
67 
68  return $wgTiffThumbnailType;
69  }
70 
77  function getMetadata( $image, $filename ) {
78  global $wgShowEXIF;
79  if ( $wgShowEXIF ) {
80  try {
81  $meta = BitmapMetadataHandler::Tiff( $filename );
82  if ( !is_array( $meta ) ) {
83  // This should never happen, but doesn't hurt to be paranoid.
84  throw new MWException( 'Metadata array is not an array' );
85  }
86  $meta['MEDIAWIKI_EXIF_VERSION'] = Exif::version();
87 
88  return serialize( $meta );
89  } catch ( MWException $e ) {
90  // BitmapMetadataHandler throws an exception in certain exceptional
91  // cases like if file does not exist.
92  wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
93 
95  }
96  } else {
97  return '';
98  }
99  }
100 }
BitmapMetadataHandler\Tiff
static Tiff( $filename)
This doesn't do much yet, but eventually I plan to add XMP support for Tiff.
Definition: BitmapMetadataHandler.php:267
ExifBitmapHandler
Stuff specific to JPEG and (built-in) TIFF handler.
Definition: ExifBitmap.php:30
php
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
Definition: skin.txt:62
$mime
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string $mime
Definition: hooks.txt:2573
TiffHandler\canRender
canRender( $file)
Conversion to PNG for inline display can be disabled here...
Definition: Tiff.php:41
$params
$params
Definition: styleTest.css.php:40
MWException
MediaWiki exception.
Definition: MWException.php:26
TiffHandler
Handler for Tiff images.
Definition: Tiff.php:29
Exif\version
static version()
#-
Definition: Exif.php:580
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
TiffHandler\getMetadata
getMetadata( $image, $filename)
Definition: Tiff.php:77
wfDebug
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:933
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
TiffHandler\mustRender
mustRender( $file)
Browsers don't support TIFF inline generally...
Definition: Tiff.php:55
ForeignAPIRepo
A foreign repository with a remote MediaWiki with an API thingy.
Definition: ForeignAPIRepo.php:39
$ext
$ext
Definition: NoLocalSettings.php:34
ExifBitmapHandler\BROKEN_FILE
const BROKEN_FILE
Definition: ExifBitmap.php:31
TiffHandler\getThumbType
getThumbType( $ext, $mime, $params=null)
Definition: Tiff.php:65
$e
if( $useReadline) $e
Definition: eval.php:66