$options = new QROptions;
$options->version = 7;
$options->outputType = QROutputInterface::IMAGICK;
$options->imagickFormat = 'png';
$options->bgColor = '#000000';
$options->transparencyColor = '#000000';
$options->outputBase64 = false;
$options->eccLevel = QRCode::ECC_L;
$options->quality = 90;
$options->scale = 10;
$options->outputBaseSize = 50;
$options->imageTransparent = false;
if ( ! empty( $qr_option ) ) {
$options->moduleValues = [
QRMatrix::M_DARKMODULE => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_SEPARATOR_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_TIMING_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_FORMAT_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_VERSION_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_QUIETZONE_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_LOGO_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_DATA_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_FINDER_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_ALIGNMENT_DARK => $qr_option['color']['text'] ?? '#000000',
QRMatrix::M_FINDER_DOT => $qr_option['color']['text'] ?? '#000000',
];
}
try {
( new QRCode( $options ) )->render( $string_url, $file_path );
} catch ( Throwable $e ) {
return [
'error' => true,
'message' => $e->getMessage(),
];
}
Issue description
Lots of questions
1 I can't set the background color for PNG
2 I can't choose the size normally, for example 500x500
Expected behavior
Qr code PNG 500x500 with black background and for example white Qr
Code sample
Library version
latest
Additional context
why is there no normal resize function that accepts exact sizes