flammy / imagebox

This dokuwiki plugin displays captions in a box drawn around an image.
https://www.dokuwiki.org/plugin:imagebox
GNU General Public License v2.0
5 stars 7 forks source link

No support for HEIC #133

Open TeeKayEV opened 3 months ago

TeeKayEV commented 3 months ago

I added HEIC to the mime.local.conf file heic image/heic

Once I added a HEIC image, I immediately get the following error message:

DIVISIONBYZEROERROR: DIVISION BY ZERO

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the imagebox plugin.

More info has been written to the DokuWiki error log.

And in the freshly created error log, I have the following entries:

2024-05-19 13:51:32 /mnt/web208/a1/44/512013944/htdocs/lib/plugins/imagebox/syntax.php(78)  E_WARNING: Trying to access array offset on value of type bool
  #0 /mnt/web208/a1/44/512013944/htdocs/lib/plugins/imagebox/syntax.php(78): dokuwiki\ErrorHandler::errorHandler()
  #1 /mnt/web208/a1/44/512013944/htdocs/inc/parser/handler.php(298): syntax_plugin_imagebox->handle()
  #2 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(269): Doku_Handler->plugin()
  #3 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(203): dokuwiki\Parsing\Lexer\Lexer->invokeHandler()
  #4 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(146): dokuwiki\Parsing\Lexer\Lexer->dispatchTokens()
  #5 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Parser.php(113): dokuwiki\Parsing\Lexer\Lexer->parse()
  #6 /mnt/web208/a1/44/512013944/htdocs/inc/parserutils.php(234): dokuwiki\Parsing\Parser->parse()
  #7 /mnt/web208/a1/44/512013944/htdocs/inc/Ui/PageView.php(56): p_get_instructions()
  #8 /mnt/web208/a1/44/512013944/htdocs/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
  #9 /mnt/web208/a1/44/512013944/htdocs/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
  #10 [internal function]: tpl_content_core()
  #11 /mnt/web208/a1/44/512013944/htdocs/inc/Extension/Event.php(134): call_user_func_array()
  #12 /mnt/web208/a1/44/512013944/htdocs/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
  #13 /mnt/web208/a1/44/512013944/htdocs/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
  #14 /mnt/web208/a1/44/512013944/htdocs/lib/tpl/varicolored/main.php(112): tpl_content()
  #15 /mnt/web208/a1/44/512013944/htdocs/inc/actions.php(30): include('...')
  #16 /mnt/web208/a1/44/512013944/htdocs/doku.php(131): act_dispatch()
  #17 {main}
2024-05-19 13:51:32 /mnt/web208/a1/44/512013944/htdocs/lib/plugins/imagebox/syntax.php(78)  E_WARNING: Trying to access array offset on value of type bool
  #0 /mnt/web208/a1/44/512013944/htdocs/lib/plugins/imagebox/syntax.php(78): dokuwiki\ErrorHandler::errorHandler()
  #1 /mnt/web208/a1/44/512013944/htdocs/inc/parser/handler.php(298): syntax_plugin_imagebox->handle()
  #2 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(269): Doku_Handler->plugin()
  #3 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(203): dokuwiki\Parsing\Lexer\Lexer->invokeHandler()
  #4 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(146): dokuwiki\Parsing\Lexer\Lexer->dispatchTokens()
  #5 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Parser.php(113): dokuwiki\Parsing\Lexer\Lexer->parse()
  #6 /mnt/web208/a1/44/512013944/htdocs/inc/parserutils.php(234): dokuwiki\Parsing\Parser->parse()
  #7 /mnt/web208/a1/44/512013944/htdocs/inc/Ui/PageView.php(56): p_get_instructions()
  #8 /mnt/web208/a1/44/512013944/htdocs/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
  #9 /mnt/web208/a1/44/512013944/htdocs/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
  #10 [internal function]: tpl_content_core()
  #11 /mnt/web208/a1/44/512013944/htdocs/inc/Extension/Event.php(134): call_user_func_array()
  #12 /mnt/web208/a1/44/512013944/htdocs/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
  #13 /mnt/web208/a1/44/512013944/htdocs/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
  #14 /mnt/web208/a1/44/512013944/htdocs/lib/tpl/varicolored/main.php(112): tpl_content()
  #15 /mnt/web208/a1/44/512013944/htdocs/inc/actions.php(30): include('...')
  #16 /mnt/web208/a1/44/512013944/htdocs/doku.php(131): act_dispatch()
  #17 {main}
2024-05-19 13:51:32 /mnt/web208/a1/44/512013944/htdocs/lib/plugins/imagebox/syntax.php(78)  DivisionByZeroError: Division by zero
  #0 /mnt/web208/a1/44/512013944/htdocs/inc/parser/handler.php(298): syntax_plugin_imagebox->handle()
  #1 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(269): Doku_Handler->plugin()
  #2 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(203): dokuwiki\Parsing\Lexer\Lexer->invokeHandler()
  #3 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Lexer/Lexer.php(146): dokuwiki\Parsing\Lexer\Lexer->dispatchTokens()
  #4 /mnt/web208/a1/44/512013944/htdocs/inc/Parsing/Parser.php(113): dokuwiki\Parsing\Lexer\Lexer->parse()
  #5 /mnt/web208/a1/44/512013944/htdocs/inc/parserutils.php(234): dokuwiki\Parsing\Parser->parse()
  #6 /mnt/web208/a1/44/512013944/htdocs/inc/Ui/PageView.php(56): p_get_instructions()
  #7 /mnt/web208/a1/44/512013944/htdocs/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
  #8 /mnt/web208/a1/44/512013944/htdocs/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
  #9 [internal function]: tpl_content_core()
  #10 /mnt/web208/a1/44/512013944/htdocs/inc/Extension/Event.php(134): call_user_func_array()
  #11 /mnt/web208/a1/44/512013944/htdocs/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
  #12 /mnt/web208/a1/44/512013944/htdocs/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
  #13 /mnt/web208/a1/44/512013944/htdocs/lib/tpl/varicolored/main.php(112): tpl_content()
  #14 /mnt/web208/a1/44/512013944/htdocs/inc/actions.php(30): include('...')
  #15 /mnt/web208/a1/44/512013944/htdocs/doku.php(131): act_dispatch()
  #16 {main}
TeeKayEV commented 3 weeks ago

With my modest knowledge, I think I have found out that there is a problem with the PHP function getimagesize used by imagebox. Even in 2024, getimagesize still does not support the HEIF/HEIC format, although there were suggestions for this as a PHP feature request 5 years ago.