:octocat:

This commit is contained in:
smiley
2023-06-15 17:15:33 +02:00
parent 71509a5a94
commit 28b6e2c418
7 changed files with 12 additions and 10 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ require_once __DIR__.'/../vendor/autoload.php';
// please excuse the IDE yelling https://youtrack.jetbrains.com/issue/WI-66549
$options = new QROptions;
$options->readerUseImagickIfAvailable = false;
$options->readerGrayscale = true;
$options->readerIncreaseContrast = true;
$options->readerGrayscale = true;
$options->readerIncreaseContrast = true;
try{
$result = (new QRCode($options))->readFromFile(__DIR__.'/../.github/images/example_image.png');
+2 -1
View File
@@ -5,6 +5,7 @@
* eliminate hairline antialias "cracks" that tend to appear when two SVG paths are exactly adjacent to each other.
*
* @see https://github.com/chillerlan/php-qrcode/issues/127
* @see ./shapes.svg
*/
use chillerlan\QRCode\{QRCode, QROptions};
@@ -48,7 +49,7 @@ class MeltedSVGQRCodeOutput extends QRMarkupSVG{
$M_TYPE_LAYER = QRMatrix::M_DATA;
if($this->matrix->check($x, $y)){
$M_TYPE_LAYER |= QRMatrix::IS_DARK;
$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
}
}
+1 -1
View File
@@ -53,7 +53,7 @@ class RandomDotsSVGOutput extends QRMarkupSVG{
$M_TYPE_LAYER = QRMatrix::M_DATA;
if($this->matrix->check($x, $y)){
$M_TYPE_LAYER |= QRMatrix::IS_DARK;
$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
}
}
+3 -3
View File
@@ -44,7 +44,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
$this->colorQuietzone($quietzoneSize, ($diameter / 2));
// calculate the logo space
$logoSpaceSize = (int)ceil($this->moduleCount * $this->options->svgLogoScale);
$logoSpaceSize = (int)(ceil($this->moduleCount * $this->options->svgLogoScale) + 1);
// we're calling QRMatrix::setLogoSpace() manually, so QROptions::$addLogoSpace has no effect here
$this->matrix->setLogoSpace($logoSpaceSize);
@@ -185,7 +185,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
$M_TYPE_LAYER = QRMatrix::M_DATA;
if($this->matrix->check($x, $y)){
$M_TYPE_LAYER |= QRMatrix::IS_DARK;
$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
}
}
@@ -335,7 +335,7 @@ $options = new RoundQuietzoneOptions([
QRMatrix::M_FINDER_DARK,
QRMatrix::M_FINDER_DOT,
QRMatrix::M_ALIGNMENT_DARK,
(QRMatrix::M_QUIETZONE | QRMatrix::IS_DARK),
QRMatrix::M_QUIETZONE_DARK,
],
'drawCircularModules' => true,
'circleRadius' => 0.4,
+2 -1
View File
@@ -87,7 +87,8 @@ abstract class QRMarkup extends QROutputAbstract{
}
/**
*
* returns the fully parsed and rendered markup string for the given input
*/
abstract protected function createMarkup(bool $saveToFile):string;
}
+1 -1
View File
@@ -187,7 +187,7 @@ abstract class QROutputAbstract implements QROutputInterface{
$M_TYPE_LAYER = QRMatrix::M_DATA;
if($this->matrix->check($x, $y)){
$M_TYPE_LAYER |= QRMatrix::IS_DARK;
$M_TYPE_LAYER = QRMatrix::M_DATA_DARK;
}
}
+1 -1
View File
@@ -176,7 +176,7 @@ final class QRMatrixTest extends TestCase{
public static function matrixProvider():Generator{
$ecc = new EccLevel(EccLevel::L);
foreach(range(1, 40) as $i){
for($i = 1; $i <= 40; $i++){
yield 'version: '.$i => [new QRMatrix(new Version($i), $ecc)];
}
}