Added array $options to File::purgeCache(), LocalFile::purgeCache(), LocalFile::purgeThumbnails(), ForeignAPIFile::purgeCache() and ForeignAPIFile::purgeThumbnails() which is currently empty, but can be used later to indicate a full or partial purge.
Added MediaHandler::filterThumbnailPurgeList(), which can remove items from the purge list and also gets passed this $options array
Restructure and comment of ImageHandler::normaliseParams(). ImageHandler::normaliseParams() will now output both width/height as physicalWidth/Height, where width/height are the dimensions used by the browser, and physicalWidth/Height are the dimensions of the thumbnail that will be created. This allows keeping the use of unique dimensions for a specified thumbnail width, by forcing client side resizing of 1px-wide images with non corresponding height.
Also fixed a bug where the check for mustRender() was in an if statement where it should not have been.
This will only include the number of pages if there is at least two pages.
If you have a pdf with a single page, it won't say 1 page. I modeled this
on how animated images will only say x frames if x > 1.
(For reference, this will affect extensions like pdfHandler, but it won't
affect extensions like PagedTiffHandler since that one totally overrides
the default method)
to stop mostly irrelevent classes from getting it.
Also remove a method that is an exact duplicate of a base class (not sure whats with that).
This also coincidently fixes the issue with when a foreign file repo uses PagedTiffHandler
and the local one does not, and the builtin Tiff handler tries to treat the metadata as if
it was its own form.
Hope I did this in an ok fashion. svn merge --re-integrate was giving me issues
so I just essentially over-wrote my working copy with the version at img_metadata.
Add a new config variable $wgSVGMetadataCutoff (currently set to 256kb, chosen rather arbitrarily)
and only read that much of the svg file when finding metadata. In general:
*Most (non-crazy huge map) svgs aren't that big, so there'd be no change in general
*Almost all files have any relevent metadata (well except for when we look for animation tags) is at the begining of the file
before actual image data.
*At the end of the day, even if this does miss metadata in some files (which I really doubt it would), I'd consider that a better
situation then the current situation where it can take 10 minutes or have OOM to parse the likes of [[:File:Puerto_Rico_ecosystems_map-fr.svg]]
Also has parts of/parts are based on Hartman's patch from bugzilla in it.
Also changes how it recurses into child elements looking for animation, to do so only when neccesary.
Trims the results of reading values, because i was getting extra leading spaces when testing this.
Last of all, add a comment to the MediaHandler class about how the first parameter of MediaHandler::getMetadata is kind of useless.
(it confused me when I was doing this)
MediaHandler::getThumbType now checks if the extension and the mime type match. If they do not, a new extension is generated for the mime type. The rest of the thumbnailing code should then magically work.
Bonus: this also works with file names without extension, so might be a step closer to extension-less files.
* Renamed MediaHandler::verifyFileHook() to verifyUpload() since it isn't a hook and the fact that it operates on files is obvious.
* Separated some concerns by simply passing verifyUpload() function a file path instead of an UploadBase object and MIME type. This simplifies the implementation of subclasses, makes the function accessible to non-UploadBase callers, and avoids breaking the interface constantly due to UploadBase changes.
* Have verifyUpload() return a Status object instead of allowing the idiosyncratic and feature-poor error array convention from UploadBase to infect MediaHandler.
The required update to PagedTiffHandler will be in a subsequent commit.