Wiki features:
* Image captions can now include links and other basic formatting
+* Image bounding box can be specified instead of width, e.g. as
+ 100x100px, making the image not wider than 100px and not higher
+ than 100px, keeping aspect ratio.
* Templates have been expanded with parameters, and separated from
the MediaWiki: localization scheme.
* Categories more or less work
Optional modules:
* WikiHiero hieroglyphic module can be added (separate download)
+* Timeline module can be added (separate download).
+ Requires ploticus.
* TeX now has an experimental MathML output mode (incomplete)
Installation and upgrading:
* Should now run clean with error reporting set to E_ALL.
* register_globals hack from 1.2 has been replaced with safer code
* Bundled PHPTAL 0.7.0 from http://phptal.sourceforge.net/
+ (with some patches)
+* Most image-related code moved to Image.php
=== Caveats ===
$mwFramed =& MagicWord::get( MAG_IMG_FRAMED );
$alt = $part[count($part)-1];
- $framed=$thumb=false;
+ $height = $framed = $thumb = false;
foreach( $part as $key => $val ) {
if ( ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) {
$align = "none";
} elseif ( ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) {
# $match is the image width in pixels
- $width = intval($match);
+ if ( preg_match( "/^([0-9]*)x([0-9]*)$/", $match, $m ) ) {
+ $width = intval( $m[1] );
+ $height = intval( $m[2] );
+ } else {
+ $width = intval($match);
+ }
} elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) {
$framed=true;
}
if ( ! isset($width) ) {
$width = 180;
}
- return $prefix.$this->makeThumbLinkObj( $img, $alt, $align, $width, $framed ).$postfix;
+ return $prefix.$this->makeThumbLinkObj( $img, $alt, $align, $width, $height, $framed ).$postfix;
} elseif ( isset($width) ) {
# Create a resized image, without the additional thumbnail
# features
+
+ if ( ( ! $height === false )
+ && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) {
+ print "height=$height<br>\nimg->getHeight() = ".$img->getHeight()."<br>\n";
+ print "rescaling by factor ". $height / $img->getHeight() . "<br>\n";
+ $width = $img->getWidth() * $height / $img->getHeight();
+ }
$url = $img->createThumb( $width );
}
} # endif $wgUseImageResize
}
- function makeThumbLinkObj( $img, $label = "", $align = "right", $boxwidth = 180, $framed=false ) {
+ function makeThumbLinkObj( $img, $label = "", $align = "right", $boxwidth = 180, $boxheight=false, $framed=false ) {
global $wgStylePath, $wgLang;
# $image = Title::makeTitle( Namespace::getImage(), $name );
$url = $img->getURL();
{
// Use image dimensions, don't scale
$boxwidth = $width;
+ $oboxwidth = $boxwidth + 2;
$boxheight = $height;
$thumbUrl = $url;
} else {
- $boxheight = intval( $height/($width/$boxwidth) );
- # if ( $boxwidth > $width ) {
- # $boxwidth = $width;
- # $boxheight = $height;
- #}
+ $h = intval( $height/($width/$boxwidth) );
+ $oboxwidth = $boxwidth + 2;
+ if ( ( ! $boxheight === false ) && ( $h > $boxheight ) )
+ {
+ $boxwidth *= $boxheight/$h;
+ } else {
+ $boxheight = $h;
+ }
$thumbUrl = $img->createThumb( $boxwidth );
}
- $oboxwidth = $boxwidth + 2;
$u = $img->getEscapeLocalURL();