https://bugzilla.wikimedia.org/show_bug.cgi?id=32387

Bawolff (Brian Wolff) <bawolff...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uma...@gmail.com

--- Comment #24 from Bawolff (Brian Wolff) <bawolff...@gmail.com> ---
Suggested fix for this bug:

* Add a new method in the MediaHandler class, canRenderImageThisSize( $file )
which takes a File object as its only parameter, and returns a boolean to
signal if image is small enough to render. The implementation in MediaHandler
should be a stub method always returning true, with an implementation in
BitmapHandler which actually checks $wgMaxImageArea. This should replace the
code dealing with $wgMaxImageArea currently in BitmapHandler::normaliseParams
(Although possibly not the BitmapHandlerCheckImageArea hook).

* In the FileRepo class, new method that returns a boolean -
enforceFileSizeChecks(), which would return true in FileRepo class, but false
in ForeignAPIRepo class to signal that Foreign api files don't do the file
resolution check.

*In the File::transform method, add some code which checks for
$this->repo->enforceFileSizeChecks(), if that's true, then it checks
$this->handler->canRenderImageThisSize( $this ), if that's false, it outputs a
MediaTransformError object, the first argument should be a specific error
message to this situation, not the generic 'thumbnail_error' message.

*Tiff handler should also be migrated to this new system (bug 62306)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to