Bacon / BaconQrCode

QR Code Generator for PHP
BSD 2-Clause "Simplified" License
1.86k stars 212 forks source link

SimpleCircleEye Class not working properly. #51

Closed devameerhamza closed 4 years ago

devameerhamza commented 6 years ago

This Path code create a circle with a weird edge can some guide me to fix it?

return (new Path())
            ->move(1.5, 0)
            ->ellipticArc(1.5, 1.5, 0., false, true, 0., 1.5)
            ->ellipticArc(1.5, 1.5, 0., false, true, -1.5, 0.)
            ->ellipticArc(1.5, 1.5, 0., false, true, 0., -1.5)
            ->ellipticArc(1.5, 1.5, 0., false, true, 1.5, 0.)
            ->close();

http://prntscr.com/jyxvd6

DASPRiD commented 6 years ago

Does this happen only with a specific renderer or with all renderers? I just created a circle with the same definitions in Inkscape, and it looks correct there:

M 1.5,0
A 1.5,1.5 0 0 1 0, 1.5
  1.5,1.5 0 0 1 -1.5,0
  1.5,1.5 0 0 1 0,-1.5
  1.5,1.5 0 0 1 1.5,0
Z
fsmeier commented 5 years ago

I can reproduce with svg:

$size       = 200;
$encoding   = 'utf-8';

$url = "sdfsdfsdf";

$renderer = new ImageRenderer(
    new RendererStyle(
        $size,
        4,
        SquareModule::instance(),
        SimpleCircleEye::instance()
    ),
    new SvgImageBackEnd()
);

$bacon = new BaconQrCodeWriter($renderer);
$data = $bacon->writeString($url, $encoding);
$bla = 'data:image/svg+xml;base64,'.base64_encode($data);

echo "<img src='$bla' />";
DASPRiD commented 5 years ago

Please validate again against master, a fix for some matrix transformations was just merged.

DASPRiD commented 4 years ago

Fixed by #69