Go to the documentation of this file.
53 return array(
'png',
'image/png' );
78 # Decode master structure
79 $f = fopen( $filename,
'rb' );
83 # The image structure always starts at offset 0 in the XCF file.
84 # So we just read it :-)
85 $binaryHeader = fread(
$f, 26 );
88 # Master image structure:
90 # byte[9] "gimp xcf " File type magic
91 # byte[4] version XCF version
95 # byte 0 Zero-terminator for version tag
96 # uint32 width With of canvas
97 # uint32 height Height of canvas
98 # uint32 base_type Color mode of the image; one of
102 # (enum GimpImageBaseType in libgimpbase/gimpbaseenums.h)
105 "A9magic" . # A: space padded
106 "/a5version" . # a: zero padded
108 "/Nheight" . # N:
unsigned long 32bit big endian
117 if ( $header[
'magic'] !==
'gimp xcf' ) {
118 wfDebug( __METHOD__ .
" '$filename' has invalid magic signature.\n" );
122 # TODO: we might want to check for sane values of width and height
125 ": canvas size of '$filename' is {$header['width']} x {$header['height']} px\n" );
127 # Forge a return array containing metadata information just like getimagesize()
128 # See PHP documentation at: http://www.php.net/getimagesize
130 $metadata[0] = $header[
'width'];
131 $metadata[1] = $header[
'height'];
132 $metadata[2] =
null; # IMAGETYPE constant, none exist
for XCF.
133 $metadata[3] = sprintf(
134 'height="%s" width="%s"', $header[
'height'], $header[
'width']
136 $metadata[
'mime'] =
'image/x-xcf';
137 $metadata[
'channels'] =
null;
138 $metadata[
'bits'] = 8; # Always 8-bits per
color
140 assert(
'7 == count($metadata); ' .
141 '# return array must contains 7 elements just like getimagesize() return' );
static getScalerType( $dstPath, $checkDstPath=true)
Must use "im" for XCF.
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
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
getImageSize( $image, $filename)
Get width and height from the XCF header.
Handler for the Gimp's native file format; getimagesize() doesn't support these files.
wfUnpack( $format, $data, $length=false)
Wrapper around php's unpack.
Generic handler for bitmap images.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getThumbType( $ext, $mime, $params=null)
Render files as PNG.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static getXCFMetaData( $filename)
Metadata for a given XCF file.
if(PHP_SAPI !='cli') $file
in the sidebar</td >< td > font color