Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4154399
MockDjVuHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
857 B
Referenced Files
None
Subscribers
None
MockDjVuHandler.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment