Incomplete so far:
* If you just ask for the image (or eg look at the image page) without a size, it tries a straight <img> with no rasterization still
* ImageMagick may not be the best renderer.
* It doesn't know the 'real' size of aspect ratio of the image.
}
$this->url = $this->wfImageUrl( $name );
+
+ $n = strrpos( $name, '.' );
+ $this->extension = strtolower( $n ? substr( $name, $n + 1 ) : '' );
if ( $this->fileExists = file_exists( $this->imagePath ) ) // Sic!, "=" is intended
{
} else {
$this->bits = 0;
}
+ } elseif( $this->extension == 'svg' ) {
+ $this->width = 512;
+ $this->height = 512;
+ $this->type = 'svg';
}
}
$this->historyLine = 0;
* @access private
*/
function thumbName( $width ) {
- return $width."px-".$this->name;
+ $thumb = $width."px-".$this->name;
+ if( $this->extension == 'svg' ) {
+ # Rasterize SVG vector images to PNG
+ $thumb .= '.png';
+ }
+ return $thumb;
}
/**