Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/140873
Change subject: Some doc fixes to MediaHandler. No code changes
......................................................................
Some doc fixes to MediaHandler. No code changes
Change-Id: I2d79fce7aa55b9a0f2988c09a55594db4e8849f1
---
M includes/media/MediaHandler.php
1 file changed, 20 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/73/140873/1
diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index efc02fe..800e45a 100644
--- a/includes/media/MediaHandler.php
+++ b/includes/media/MediaHandler.php
@@ -108,10 +108,20 @@
* Get an image size array like that returned by getimagesize(), or
false if it
* can't be determined.
*
+ * This function is used for determining the width, height and bitdepth
directly
+ * from an image. The results are stroed in the database in the
img_width,
+ * img_height, img_bits fields.
+ *
+ * @note If this is a multipage file, return the width and height of the
+ * first page.
+ *
* @param File $image The image object, or false if there isn't one
* @param string $path the filename
* @return array Follow the format of PHP getimagesize() internal
function.
- * See http://www.php.net/getimagesize
+ * See http://www.php.net/getimagesize. MediaWiki will only ever use
the
+ * first two array keys (the width and height), and the 'bits'
associative
+ * key. All other array keys are ignored. Returning a 'bits' key is
optional
+ * as not all formats have a notion of "bitdepth".
*/
abstract function getImageSize( $image, $path );
@@ -121,7 +131,7 @@
* @param File $image The image object, or false if there isn't one.
* Warning, FSFile::getPropsFromPath might pass an (object)array()
instead (!)
* @param string $path The filename
- * @return string
+ * @return string A string of metadata in php serialized form (Run
through serialize())
*/
function getMetadata( $image, $path ) {
return '';
@@ -175,6 +185,8 @@
/**
* Get a string describing the type of metadata, for display purposes.
+ *
+ * @note This method is currently unused.
* @param File $image
* @return string
*/
@@ -189,8 +201,13 @@
* MediaHandler::METADATA_GOOD for if the metadata is a-ok,
* MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards
* compatible (which may or may not trigger a metadata reload).
+ *
+ * @note Returning self::METADATA_BAD will trigger a metadata reload
from
+ * file on page view. Always returning this from a broken file, or
suddenly
+ * triggering as bad metadata for a large number of files can cause
+ * performance problems.
* @param File $image
- * @param array $metadata
+ * @param string $metadata The metadata in serialized form
* @return bool
*/
function isMetadataValid( $image, $metadata ) {
--
To view, visit https://gerrit.wikimedia.org/r/140873
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d79fce7aa55b9a0f2988c09a55594db4e8849f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits