mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-10 09:46:26 +00:00
:octocat:
This commit is contained in:
+2
-2
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user