jenkins-bot has submitted this change and it was merged.

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, 22 insertions(+), 5 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php
index efc02fe..f6717cd 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 stored 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 '';
@@ -132,7 +142,7 @@
         *
         * This is not used for validating metadata, this is used for the api 
when returning
         * metadata, since api content formats should stay the same over time, 
and so things
-        * using ForiegnApiRepo can keep backwards compatibility
+        * using ForeignApiRepo can keep backwards compatibility
         *
         * All core media handlers share a common version number, and 
extensions can
         * use the GetMetadataVersion hook to append to the array (they should 
append a unique
@@ -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
         */
@@ -187,10 +199,15 @@
         * If it returns MediaHandler::METADATA_BAD (or false), Image
         * will reload the metadata from the file and update the database.
         * MediaHandler::METADATA_GOOD for if the metadata is a-ok,
-        * MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards
+        * MediaHandler::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: merged
Gerrit-Change-Id: I2d79fce7aa55b9a0f2988c09a55594db4e8849f1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to