Commit graph

76 commits

Author SHA1 Message Date
Alexandre Emsenhuber
31003d22ea Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I26a320bcddd4122ce423f536609d5794446d743e
2012-05-03 22:22:45 +02:00
Antoine Musso
73247df204 Remove backslash from @return types
Ping r111103
2012-02-13 16:35:59 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Sam Reed
393a8c84e8 Add some escaping to r109547, 109548, 109549
Improve RELEASE-NOTES-1.19 also
2012-01-19 16:55:42 +00:00
Sam Reed
bf3cb61dcb * (bug 33819) Display filesize on Special:NewFiles in appropriate unit.
Do the same for the rest of the file usages of 'nbytes' in Generic.php
2012-01-19 16:44:49 +00:00
Antoine Musso
4e41179d32 document getImageSize() return format
Return array should return the same kind of array that PHP
internal method getimagesize() returns. See upstream doc:

  http://www.php.net/getimagesize
2012-01-04 13:22:01 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
Aaron Schulz
b9fe0b2fbf Restored r98710 but with a 'forRefresh' option (not used yet) 2011-11-28 08:53:03 +00:00
Aaron Schulz
04f50ad2ed Reverted r84395,r98710: thumbnails must be purged on file deletion 2011-10-27 23:34:54 +00:00
Bryan Tong Minh
6b75e88a79 Follow-up r84395: Give MediaHandlers the option to remove items from the thumbnail purge list. Is needed for TMH because thumbnail rendering may be very expensive for media files. Haven't thought yet of a way to integrate this with the UI, but the current framework should be flexible enough to implement that later.
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
2011-10-02 20:08:05 +00:00
Alexandre Emsenhuber
8542d56c99 Simplify things by using wfMessage() instead of wfMsg() et al. 2011-09-25 14:38:54 +00:00
Sam Reed
e79af7c35f Documentation
Add explicit member variables

Trim trailing whitespace
2011-09-07 12:00:58 +00:00
Sam Reed
7a06cb7d58 Add in \n from/to r95055 to LoadBalancer.php
Differentiate error messages from r95050 per Hashar
2011-08-21 15:24:44 +00:00
Sam Reed
aee2f8f3ba Incorporate Wikia diff, don't duplicate debugging though, add the info to the debug call that already exists 2011-08-19 23:06:54 +00:00
Chad Horohoe
beb2e7c081 Move wfFixBoxImage() out of ImageFunctions and into MediaHandler. It's only used by ImageHandler and OggHandler.
Where to move wfIsBadImage() so we can kill ImageFunctions?
2011-07-28 00:07:08 +00:00
Bryan Tong Minh
0222e58b9f (bug 28762) Resizing to specified height broken for very thin images
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.
2011-07-15 19:03:40 +00:00
Alexandre Emsenhuber
5cd84a171b Replaced calls to Skin::formatSize() by Language::formatSize() where escaping is not needed (the former is just a wrapper to the latter with a call to htmlspecialchars()) 2011-07-01 09:03:15 +00:00
Sam Reed
6bc9679307 Update calls to deprecated User::isValidEmailAddr
Fix trailing whitespace

Some minor documentation fixes
2011-06-26 19:16:04 +00:00
Sam Reed
296f3d3f4f And even more documentation 2011-05-28 18:59:42 +00:00
Sam Reed
e514478ba5 Fix function level comments that start with /* not /** 2011-05-21 19:35:16 +00:00
Sam Reed
33ad682ab0 Add/remove/tweak method documentation 2011-05-19 00:03:31 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Brian Wolff
bbd225e013 (bug 28868) Include the number of pages in the default getLongDesc for multipaged documents
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)
2011-05-07 19:34:14 +00:00
Brian Wolff
19a66a3238 Remove the JPEG/TIFF specific metadata code from BitmapHandler and put it in JpegOrTiff handler
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.
2011-04-20 23:15:13 +00:00
Sam Reed
0bd50926ca Remove some unused variables
Fix typo in wfDeprecated usage

Fix some more unreachable code
2011-04-16 11:17:14 +00:00
Brian Wolff
74f16767e7 Merge to trunk everything in img_metadata branch.
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.
2011-04-16 01:23:15 +00:00
Brian Wolff
e6de99be92 (bug 27508) SVGMetadataExtractor takes too much resources on huge svg's. Change it so it only looks at begining of file.
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)
2011-03-06 08:15:49 +00:00
Sam Reed
daa41d319b More function level documentation 2011-02-18 23:56:08 +00:00
Sam Reed
dfcc5bb7fc Parameter documentation 2011-02-18 23:34:24 +00:00
Bryan Tong Minh
a6617a4959 Files with a mime type that does not match the extension are now properly thumbnailed. Partial bug fix to bug 26661.
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.
2011-02-06 19:20:57 +00:00
Derk-Jan Hartman
35d16afa2a Move the () surrounding description strings of files, out of the description and into the interface.
Follows up r68324 and r68325
2011-01-10 22:18:08 +00:00
Derk-Jan Hartman
4cc32f979a Add a new isVectorized() to files and media handlers. Only SVG returns true.
Related to Bug 19633.
2010-10-31 21:49:25 +00:00
Tim Starling
db643f03c2 Fixes for r72024:
* 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.
2010-09-07 10:38:19 +00:00
Daniel Kinzler
28d16923a1 introducing Generic::verifyFileHook() to let media handlers do the verification on upload. triggered from UploadBase:verifyFile, like the UploadVerifyFile hook. 2010-08-31 14:08:45 +00:00
Alexandre Emsenhuber
320d4e1374 * Standardised file description headers
* Added some descriptions
2010-08-15 17:27:41 +00:00
Daniel Kinzler
3b4a75493d added normalization for parameter 'page', based on pageCount, as by tims comment to r68418 2010-06-29 08:40:23 +00:00
Daniel Kinzler
fa9f92d21a passing thumbnail params to getThumbType, as suggested by TimStarling in a comment to bug 23258 2010-06-22 16:01:54 +00:00
Alexandre Emsenhuber
e7c65bf599 Fixed some doxygen warnings 2010-06-11 20:39:43 +00:00
Derk-Jan Hartman
19d7d1542a Add a isAnimatedImage() helper function to imagehandlers.
Should return true for animated GIFs and hopefully soon for APNGs
2010-05-05 22:37:27 +00:00
Alexandre Emsenhuber
15770b2101 Fixed some doxygen warnings 2010-02-13 17:09:52 +00:00
Alexandre Emsenhuber
c3ec19debc Replaced all @fixme with "@todo Fixme" since doxygen doesn't have a @fixme command 2009-12-15 21:26:58 +00:00
ThomasV
4959584be8 generic method to extract text layer of a document 2009-09-23 12:28:19 +00:00
Aaron Schulz
49de11df31 Add getGeneralShortDesc() and the like to avoid E_STRICT instead 2008-12-15 22:22:21 +00:00
Aaron Schulz
7ae384e254 E_STRICT 2008-12-15 21:38:04 +00:00
Niklas Laxström
5050a139f9 * Allow wikitext in file-info, file-info-size, svg-long-desc instead of mix of unescaped and plain
* Format numbers in svg-long-desc
2008-07-16 08:48:53 +00:00