Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esc2html: Uncaught ImagickException: insufficient image data in file #66

Open
mike42 opened this issue Dec 25, 2019 · 0 comments
Open

Comments

@mike42
Copy link
Contributor

mike42 commented Dec 25, 2019

This relates to the data file in issue #64.

We expect to get the text presented by esc2html in a HTML page (plus a pile of warnings), but instead it crashes with an ImagickException.

$ php esc2html.php examples/2019-10-ascii.txt  
WARNING: Unknown command DLE NUL
WARNING: Unknown command DLE �
WARNING: Unknown command DLE �
WARNING: Unknown command DLE �
WARNING: Unknown command DLE �
WARNING: Unknown command DLE !
WARNING: Unknown command DLE NUL
WARNING: Unknown command DLE A
WARNING: Unknown command DLE @
WARNING: Unknown command DLE !
WARNING: Unknown command DLE NUL
WARNING: Unknown command DLE A
WARNING: Unknown command DLE @
WARNING: Unknown command DLE !
WARNING: Unknown command DLE NUL
WARNING: Unknown command DLE !
WARNING: Unknown command DLE D
WARNING: Unknown command DLE @
WARNING: Unknown command DLE !
WARNING: Unknown command DLE NUL
WARNING: Unknown command DLE !
WARNING: Unknown command DLE D
WARNING: Unknown command DLE @
WARNING: Unknown command DLE 
WARNING: Unknown command DLE NUL
WARNING: Unknown command DLE �
WARNING: Unknown command DLE �
PHP Fatal error:  Uncaught ImagickException: insufficient image data in file `' @ error/pnm.c/ReadPNMImage/443 in /home/mike/workspace/escpos-tools/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php:81
Stack trace:
#0 /home/mike/workspace/escpos-tools/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php(81): Imagick->readimageblob('P4\n39107 49665\n...', 'pbm')
#1 /home/mike/workspace/escpos-tools/esc2html.php(101): ReceiptPrintHq\EscposTools\Parser\Command\StoreRasterFmtDataToPrintBufferGraphicsSubCmd->asPng()
#2 /home/mike/workspace/escpos-tools/esc2html.php(64): imgAsDataUrl(Object(ReceiptPrintHq\EscposTools\Parser\Command\StoreRasterFmtDataToPrintBufferGraphicsSubCmd))
#3 {main}
  thrown in /home/mike/workspace/escpos-tools/src/Parser/Command/StoreRasterFmtDataToPrintBufferGraphicsSubCmd.php on line 81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant