GithubHelp home page GithubHelp logo

mediawiki-extensions-picturehtmlsupport's People

Contributors

alistair3149 avatar dependabot[bot] avatar octfx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

mediawiki-extensions-picturehtmlsupport's Issues

Replacing ThumbnailImage.php with MW 1.39 + WebP + ImageMagik gets a PHP (8.1.27) TypeError

Trying WebP v2 on MW 1.39 + PHP 8.1.27 and ImageMagik with webp support:

convert --version
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5) 
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

get's a TypeError after replacing /var/www/html/includes/media/ThumbnailImage.php with /var/www/html/extensions/PictureHtmlSupport/includes/ThumbnailImage.php:

[6af1e879fe81d8b8ea5d8bf3] /index.php/User:Alex TypeError: explode(): Argument #2 ($string) must be of type string, bool given
Backtrace:
from /var/www/html/extensions/WebP/includes/Hooks/ThumbnailHooks.php(131)
#0 /var/www/html/extensions/WebP/includes/Hooks/ThumbnailHooks.php(131): explode()
#1 /var/www/html/includes/HookContainer/HookContainer.php(160): MediaWiki\Extension\WebP\Hooks\ThumbnailHooks->onPictureHtmlSupportBeforeProduceHtml()
#2 /var/www/html/includes/media/ThumbnailImage.php(214): MediaWiki\HookContainer\HookContainer->run()
#3 /var/www/html/includes/Linker.php(792): ThumbnailImage->toHtml()
#4 /var/www/html/includes/Linker.php(425): Linker::makeThumbLink2()
#5 /var/www/html/includes/parser/Parser.php(5550): Linker::makeImageLink()
#6 /var/www/html/includes/parser/Parser.php(2712): Parser->makeImage()
#7 /var/www/html/includes/parser/Parser.php(2456): Parser->handleInternalLinks2()
#8 /var/www/html/includes/parser/Parser.php(1638): Parser->handleInternalLinks()
#9 /var/www/html/includes/parser/Parser.php(723): Parser->internalParse()
#10 /var/www/html/includes/content/WikitextContentHandler.php(301): Parser->parse()
#11 /var/www/html/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()
#12 /var/www/html/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#13 /var/www/html/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#14 /var/www/html/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#15 /var/www/html/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#16 /var/www/html/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#17 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#18 /var/www/html/includes/Revision/RenderedRevision.php(199): call_user_func()
#19 /var/www/html/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#20 /var/www/html/includes/poolcounter/PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()
#21 /var/www/html/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()
#22 /var/www/html/includes/page/ParserOutputAccess.php(299): PoolCounterWork->execute()
#23 /var/www/html/includes/page/Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()
#24 /var/www/html/includes/page/Article.php(528): Article->generateContentOutput()
#25 /var/www/html/includes/actions/ViewAction.php(78): Article->view()
#26 /var/www/html/includes/MediaWiki.php(542): ViewAction->show()
#27 /var/www/html/includes/MediaWiki.php(322): MediaWiki->performAction()
#28 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#29 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#30 /var/www/html/index.php(50): MediaWiki->run()
#31 /var/www/html/index.php(46): wfIndexMain()
#32 {main}

Line 131 on extensions/WebP/includes/Hooks/ThumbnailHooks.php is: related to the thumbnail:
$filePath = explode( $hash, $thumbnail->getStoragePath() );

Any clue?

If ThumbnailHooks.php is not replaced the webp images are created in ./images/webp/ path but they aren't served when a wiki page displays an image, for example with:

[[File:test_file.jpg|300px|thumb|It should be a webp image]]

Task list

  • Add a hook to let other extensions register additional <source> in <picture>
  • Works with MMV
  • Works with wgParserEnableLegacyMediaDOM = false;
  • Less hacky way to override the HTML?

HTML ref:

Related task:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.