gesinn-it / QRLite

Lightweight MediaWiki extension to render QR codes.
GNU General Public License v3.0
3 stars 4 forks source link

PNG generation fails with "undefined function ImageCreate()" #2

Closed ankostis closed 6 years ago

ankostis commented 6 years ago

With latest master (f83c77aa92f7a3f291eaff896e5906ff84a5fa46) i get the following when trying to save a page with these parser-function call:

{{#qrlite:{{fullurl:{{FULLPAGENAME}}}}|format=png}}
{{#qrlite:{{fullurl:{{FULLPAGENAME}}}}}}

Error:

[c5aa8ddc96dd53cfa130ff7f] /w/index.php?title=Testpage&action=submit Error from line 74 of /var/lib/mediawiki/extensions/QRLite/lib/phpqrcode/qrimage.php: Call to undefined function ImageCreate()

Backtrace:

#0 /var/lib/mediawiki/extensions/QRLite/lib/phpqrcode/qrimage.php(32): QRimage::image(array, integer, string, integer, integer)
#1 /var/lib/mediawiki/extensions/QRLite/lib/phpqrcode/qrencode.php(513): QRimage::png(array, string, integer, string, boolean, integer, integer)
#2 /var/lib/mediawiki/extensions/QRLite/lib/phpqrcode/qrencode.php(286): QRencode->encodePNG(string, string, boolean)
#3 /var/lib/mediawiki/extensions/QRLite/QRLite.functions.php(65): QRcode::png(string, string, integer, integer, string)
#4 /var/lib/mediawiki/extensions/QRLite/QRLite.hooks.php(43): QRLiteFunctions::generateQRCode(array)
#5 /var/lib/mediawiki/includes/parser/Parser.php(3426): QRLiteHooks::qrliteFunctionHook(Parser, string, string, string, string)
#6 /var/lib/mediawiki/includes/parser/Parser.php(3127): Parser->callParserFunction(PPFrame_DOM, string, array)
#7 /var/lib/mediawiki/includes/parser/Preprocessor_DOM.php(1277): Parser->braceSubstitution(array, PPFrame_DOM)
#8 /var/lib/mediawiki/includes/parser/Parser.php(2942): PPFrame_DOM->expand(DOMElement, integer)
#9 /var/lib/mediawiki/includes/parser/Parser.php(1293): Parser->replaceVariables(string)
#10 /var/lib/mediawiki/includes/parser/Parser.php(443): Parser->internalParse(string)
#11 /var/lib/mediawiki/includes/content/WikitextContent.php(323): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#12 /var/lib/mediawiki/includes/content/AbstractContent.php(516): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#13 /var/lib/mediawiki/includes/page/WikiPage.php(2129): AbstractContent->getParserOutput(Title, NULL, ParserOptions)
#14 /var/lib/mediawiki/includes/page/WikiPage.php(1655): WikiPage->prepareContentForEdit(WikitextContent, NULL, User, string, boolean)
#15 /var/lib/mediawiki/includes/EditPage.php(2214): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)
#16 /var/lib/mediawiki/includes/EditPage.php(1506): EditPage->internalAttemptSave(array, boolean)
#17 /var/lib/mediawiki/includes/EditPage.php(652): EditPage->attemptSave(array)
#18 /var/lib/mediawiki/includes/actions/EditAction.php(60): EditPage->edit()
#19 /var/lib/mediawiki/includes/actions/SubmitAction.php(38): EditAction->show()
#20 /var/lib/mediawiki/includes/MediaWiki.php(500): SubmitAction->show()
#21 /var/lib/mediawiki/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#22 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()
#23 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()
#24 /var/lib/mediawiki/index.php(42): MediaWiki->run()
#25 {main}

This parser-function call is ok:

{{#qrlite:{{fullurl:{{FULLPAGENAME}}}}|format=svg}}
ankostis commented 6 years ago

I was missing the GD php-library! Installed it with apt install php-gd (Debian) and then re-starting apache2.