Page MenuHomeWickedGov Phorge

MockDjVuHandler.php
No OneTemporary

Size
857 B
Referenced Files
None
Subscribers
None

MockDjVuHandler.php

<?php
/**
* @license GPL-2.0-or-later
*/
/**
* Fake handler for DjVu images.
*
* @ingroup Media
*/
class MockDjVuHandler extends DjVuHandler {
/** @inheritDoc */
public function isEnabled() {
return true;
}
/** @inheritDoc */
public function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
if ( !$this->normaliseParams( $image, $params ) ) {
return new TransformParameterError( $params );
}
$width = $params['width'];
$height = $params['height'];
$page = $params['page'];
if ( $page > $this->pageCount( $image ) ) {
return new MediaTransformError(
'thumbnail_error',
$width,
$height,
wfMessage( 'djvu_page_error' )->text()
);
}
$params = [
'width' => $width,
'height' => $height,
'page' => $page
];
return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 19 2026, 21:10 (7 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
93/00/e650f289d033467983f3a2b2af64
Default Alt Text
MockDjVuHandler.php (857 B)

Event Timeline