aboutsummaryrefslogtreecommitdiffstats
path: root/includes/media/SVGMetadataExtractor.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove SVGMetadataExtractor deprecated and unused.Petr Pchelko2020-10-191-45/+0
| | | | Change-Id: Ia30e59d1ff93129d48b4e6f0df76879407b5e3e2
* Deprecate wrapper SVGMetadataExtractor::getMetadataUmherirrender2019-07-261-1/+9
| | | | | | | Use SVGReader->getMetadata() directly. Also rename the test, because it covers the implementation and not the wrapper. Change-Id: I61565c6aadc6d1c1e942b9bc4555ef4aeb09e5d8
* Split SVGReader to its own fileReedy2019-04-141-358/+0
| | | | Change-Id: I9fc442225a37c14d0606508aed5ef496a5ad82ba
* Remove a few method_exists() checksMax Semenik2019-03-101-7/+2
| | | | | | These functions are present in every PHP version we support now. Change-Id: I11add0fc9f6c3c3caff859db9c0475c4d2818577
* Fix SVG metadata handler by changing offset from -1 to 0Brian Wolff2019-01-111-1/+1
| | | | | | | | | | | | | | Starting in php 7.1, negative offsets are supported in file_get_contents. Previously they were not (and in fact, the php docs said -1 was the default value for the offset if unspecified). The result of this, is starting in php 7.1, MediaWiki could not determine the aspect ratio of SVG files that were larger than 256kb. Follows up e6de99be Bug: T213501 Change-Id: I565e51cd8131542b9a70da49e9cc36c5594ecda3
* media: Do not pass unused parameterJakub Vrana2018-12-021-1/+1
| | | | | | Found by PHPStan. Change-Id: Id9418a5aa95e8541824bbf1235307a3969e75fb8
* SVG: Allow , as separator in viewBox attribute valueDerk-Jan Hartman2018-08-111-1/+1
| | | | | | | | | The viewBox attribute of the <svg> element allows both whitespace and commas to be used as field separators. https://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute Bug: T194192 Change-Id: Iae9be3e4fad3a8ffa411d7a76eee2f20cc39b718
* SVG: SVG unit parser support for wider range of numberDerk-Jan Hartman2018-08-071-1/+5
| | | | | | | | | | - Add support for radix leading numbers like 0.41 - Add support for scientific number notation - Add support for plus and minus signs - Add testcases for SVGUnit parsing and scaling Bug: T201274 Change-Id: I0446b19b0f22851d968c991007e73255f309f4bc
* Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errorsKunal Mehta2018-05-231-1/+1
| | | | Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
* Update suppressWarning()/restoreWarning() callsReedy2018-02-101-3/+3
| | | | | Bug: T182273 Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
* Remove auto-generated "Constructor" documentation on constructorsThiemo Mättig2017-07-211-2/+0
| | | | | | | | | | | Having such comments is worse than not having them. They add zero information. But you must read the text to understand there is nothing you don't already know from the class and the method name. This is similar to I994d11e. Even more trivial, because this here is about comments that don't say anything but "constructor". Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
* media: Remove unused private function in SVGMetadataExtractorEugene Gvozdetsky2017-04-191-6/+0
| | | | Change-Id: I3cd00bb4f460a141966ad01e155a97b8a087a8e8
* includes: Replace implicit Bugzilla bug numbers with Phab onesJames D. Forrester2017-02-211-2/+2
| | | | | | | It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345" except where it doesn't, so let's just standardise on the real numbers. Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
* Update weblinks in comments from HTTP to HTTPSFomafix2016-11-071-2/+2
| | | | | | | | Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link. Also update some defect links. Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
* Many more function case mismatchesReedy2016-03-191-1/+1
| | | | Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
* Convert all array() syntax to []Kunal Mehta2016-02-171-6/+6
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Remove dead private methodsjeroendedauw2015-09-071-10/+0
| | | | Change-Id: Id49df6d16ce06c7bb00f1aaba75b64093c91c7ae
* Remove unneeded empty lines at begin of if/else/foreach bodyumherirrender2015-06-191-1/+0
| | | | | | An if body must not begin with an empty line Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271
* Use mediawiki/at-ease library for suppressing warningsKunal Mehta2015-06-111-3/+3
| | | | | | | | | | | | | | | wfSuppressWarnings() and wfRestoreWarnings() were split out into a separate library. All usages in core were replaced with the new functions, and the wf* global functions are marked as deprecated. Additionally, some uses of @ were replaced due to composer's autoloader being loaded even earlier. Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to mediawiki/vendor. Bug: T100923 Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
* Change case of class names to match declarationsKevin Israel2014-12-191-10/+10
| | | | | | | | | | | | | | | | | | | | | | Found by running tests under a version of PHP patched to report case mismatches as E_STRICT errors. User classes: * MIMEsearchPage * MostlinkedTemplatesPage * SpecialBookSources * UnwatchedpagesPage Internal classes: * DOMXPath * stdClass * XMLReader Did not change: * testautoLoadedcamlCLASS * testautoloadedserializedclass Change-Id: Idc8caa82cd6adb7bab44b142af2b02e15f0a89ee
* Fixed some @params documentation (includes/*)umherirrender2014-04-201-1/+1
| | | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
* Fixed spacingumherirrender2013-12-081-1/+1
| | | | | | | - Added space after foreach - Added/Removed spaces inside arrays Change-Id: Ia8775824fa33976b1a4dab43e07f1bff0c57479c
* Extract list of languages svg is translated into.Brian Wolff2013-12-061-8/+39
| | | | | | | | | | | | | | | | | | | SVG files support having different renderings based on language. We support changing the rendering language, but we offer no discoverability of what languages are available. Long term Jarry's TranslateSVG will hopefully be used and have all the associated awesomeness. In the mean time, we should probably have some indication on the image page what languages are available for the SVG. This is step 1 (extract the language). I expect to follow this up with a commit adding some sort of simple selector on the image page. As an aside, it should be noted, this only detects languages if its in the first $wgSVGMetadataCutoff (256 kb). This is a compromise to avoid OOM on huge SVG files. Change-Id: I2a462270fe63eb3e3023419eddc8b06f5a617ab5
* Update documentation for media related classesSiebrand Mazeland2013-12-061-7/+13
| | | | Change-Id: I7a9c8d59f88c68dc3835cb8a18f22a77cd7890fc
* Break long lines in media related classesSiebrand Mazeland2013-12-051-4/+13
| | | | Change-Id: I94653b4cde14f75180dae795d1fdaa1b073ec1d1
* Update formatting for media related classesSiebrand Mazeland2013-12-051-3/+7
| | | | Change-Id: Iaa81af5b65a650222fa65bf8c368e4f1ec3ce9c0
* Use lowercase key wordsumherirrender2013-11-231-1/+1
| | | Change-Id: I57569b7082a0decc8128ecadd8ec5d1a5c327673
* Fixed spacing around parenthesis in includesumherirrender2013-04-281-1/+1
| | | | Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
* Added space after switch/Removed spaces after unsetumherirrender2013-04-261-2/+2
| | | | | | While at it, added/removed some other spaces in the same files Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
* Fixed spacing in context/installer/media/templates/upload folderumherirrender2013-04-211-23/+23
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: I9761be9fa47adc3554852a97b19792b4648466ad
* Disable external entities in XMLReadercsteipp2013-04-151-2/+9
| | | | | | | | | Temporarily disable loading entities in XMLReader when calling read() with libxml_disable_entity_loader(true). bug: 46859 Change-Id: I0b2ef270f15c7b4da17edee680bf7e2410919915
* Added/Removed spaces around string concatenationumherirrender2013-04-131-3/+3
| | | | | | | | | And added/removed spaces around some other tokens, like +, -, *, /, <, >, =, ! Fixed windows newline style Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* fix some spacingumherirrender2013-03-251-3/+3
| | | | | | | | | | | * Removed spaces around array index * Removed double spaces or added spaces to begin or end of function calls, method signature, conditions or foreachs * Added braces to one-line ifs * Changed multi line conditions to one line conditions * Realigned some arrays Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
* Remove spaces between parentheses in function callsumherirrender2013-03-171-1/+1
| | | | Change-Id: If8ec665a01b566fa5189dfcc810b2d9a17f371e1
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-6/+6
| | | | | | | | | | | Doxygen expects parameter types to come before the parameter name in @param tags. Used a quick regex to switch everything around where possible. This only fixes cases where a primitve variable (or a primitive followed by other types) is the variable type. Other cases will need to be fixed manually. Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
* fix some spacingumherirrender2013-02-041-10/+10
| | | | Change-Id: I88e73d47a552918880514d88a876296a6cb80d88
* fix some spacingumherirrender2013-01-261-1/+1
| | | | Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
* Remove a bunch of trailing spaces and unneeded newlinesumherirrender2012-10-191-3/+3
| | | | Change-Id: I166a171c196f4c2c75886be12f913ffa9a4a35ad
* Update docs for return and exception infoSiebrand Mazeland2012-10-091-0/+3
| | | | | | | * Removed some inline tabs in the process. * IDE fixed some incorrect leading spaces, too. Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
* Make the width/height in the SVG metadata box be in the SVG's unitsBrian Wolff2012-08-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | This was suggested by a user at commons. The width/height in px is really a MediaWiki thingy needed for rendering the image, from a metadata prespective its the original units (aka the image should be 10cm, etc) that is the information associated with the file. The dimensions in pixels is still specified in the long description of the image (the subtitle directly under the image). Note: After gerrit change Ic58efbf2 is merged, this will cause no width or height to be displayed for svg images with cached metadata, until they get purged. I think that's perfectly ok as the width is available elsewhere on the page. p.s. I added one semi-unrelated code comment in SVGMetadataExtractor. patchset 2,3: Fix test (hopefully, how come getting an up to date version of PHPUnit is so difficult) patchset 4: rebase patchset 5: fix my accidental remove of a comment Change-Id: I312fbd1c935a0095644c3b63c4929632c6f6e387
* (bug 39431) Fix how SVG metadata is displayed (esp. animated status)Brian Wolff2012-08-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | (Quite a few of these issues are my fault from 65c27ddeb19757cb8a) *All fields were starting as collapsed, which was not the intent of the code *Animated field used non-existent messages, and displayed a value of "1" instead of something meaningful to the user. Both (A)PNG and GIF handlers put the animated status in the long description which feels more natural to me so move the animated status to the long desc (long desc = subtitle under the image on the description page). *Use human readable file sizes in the long description instead of total number of bytes. This bring it in line with the implementation in the parent class. *Correctly mark scripted SVG's as animated. Mostly a moot point since we do not allow animated svgs past the upload checks but for completeness and for people who totally disable all upload verification. (Note: This would miss event attributes (onclick, etc) I didn't see much point in adding that since almost always there will be a script tag) Patchset 3: trailing whitespace (d'oh) patchset 4: rebasing so jenkins is happy Change-Id: Ic58efbf2bf1e4b14e3129e5bce9ea920d9804111
* escape tags and entity in doxygen commentsAntoine Musso2012-07-101-2/+2
| | | | | | | | | | | When inserting XML elements inline <such as this one>, doxygen chokes about it not being known. Simply enclosing the tag in double quotes prevents doxygen from emitting a warning. Also enclosed a few invalid functions calls such as \. and double quoted the HTML entities such as &foobar; Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
* Added missing GPLv2 headers in some places.Alexandre Emsenhuber2012-05-031-1/+7
| | | | | | Also made file/class documentation more consistent. Change-Id: I26a320bcddd4122ce423f536609d5794446d743e
* More return documentationSam Reed2012-02-091-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111102
* (bug 31719) Revert r107359 and apply a proper solution for entity expansion ↵Tim Starling2012-01-021-5/+7
| | | | | | | in SVGs. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107793
* (bug 31719) Apply Derk-Jan Hartman's patch to make '&ns_svg;' considered a ↵Brian Wolff2011-12-271-1/+5
| | | | | | | | | namespace for svg files. Work around issue where entities not expanded by our SVGMetadataReader. I'm leaving the bug open, since I'm not sure if this is a proper fix, but I think its significantly better than the current situation. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107359
* Add, update, tweak documentationSam Reed2011-10-261-1/+1
| | | | | | | | | Fix document comment blocks Tweak some returns Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100778
* Fix Bug #30322 “SVG metadata is read incorrectly” by applying supplied patchMark A. Hershberger2011-08-111-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94277
* Fixup r89029. You don't include the brackets in the method name!Platonides2011-07-201-1/+1
| | | | | | | | | | --ta línea y las que están debajo serán ignoradas-- M includes/media/SVGMetadataExtractor.php M tests/phpunit/includes/media/SVGMetadataExtractorTest.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92634
* fu r89029 - spellingNiklas Laxström2011-05-281-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89035