Open jumarjuaton opened 2 years ago
Hello,
I have used the bitimage code and was getting a Failed to load the image error.
$logo = EscposImage::load(public_path() . "/custom/img/escpos-php.png", false); $imgModes = array( Printer::IMG_DEFAULT, Printer::IMG_DOUBLE_WIDTH, Printer::IMG_DOUBLE_HEIGHT, Printer::IMG_DOUBLE_WIDTH | Printer::IMG_DOUBLE_HEIGHT ); foreach ($imgModes as $mode) { $printer -> bitImage($logo, $mode); } $printer->cut();
Can I ask help on what is causing the error? When I dump the file, it was returning these params:
Seems it is reading the file. Also what should be the standard resolution/size of the image? And should the image be dithered to work?
Add the library to use, as a final parameter, taking into account that by default it offers ['imagick', 'gd', 'native']
.
When passing the parameter, it must be in an array, because it does a foreach to detect the method to use for image compression.
Add the library to use, as a final parameter, taking into account that by default it offers ['imagick', 'gd', 'native'].
When passing the parameter, it must be in an array, because it does a foreach to detect the method to use for image compression.
Here's an example of how you should do it:
Before
$logo = EscposImage::load(public_path() . "/custom/img/escpos-php.png", false);
After
$logo = EscposImage::load(public_path() . "/custom/img/escpos-php.png", false, ['native']);
Hello,
I have used the bitimage code and was getting a Failed to load the image error.
Can I ask help on what is causing the error? When I dump the file, it was returning these params:
Seems it is reading the file. Also what should be the standard resolution/size of the image? And should the image be dithered to work?