milon / barcode

Laravel Barcode Generator
Other
1.32k stars 318 forks source link

QR and DARK THEME #176

Open malutanpetronel opened 1 year ago

malutanpetronel commented 1 year ago

Hi I have issues displaying a QR code in dark theme on google. Tried to add a 1px CSS background repeat on the div which display that PNG but no success.

Any hints please ?

        </p>
        <style scoped>
            .theme-a {
                background: #dca;
                padding:15px;
                max-width:fit-content;
                padding:10px;
            }
        </style>
        <div class=3D"box theme-a adaptive" style=3D"background-image: url(=
'cid:pixel_1.jpg');background-repeat: repeat;">
            <img id=3D"img.qr_1" src=3D"cid:4665654c9bb48f3b7b72e42fe057cf5=
f@symfony" />
        </div>
    </div>
<br/>

<div>Thank you!</div>
<div>Evozon_Team</div>

--4V0KtjoG--
--z_dgJOoS
Content-ID: <4665654c9bb48f3b7b72e42fe057cf5f@symfony>
Content-Type: image/png; name="4665654c9bb48f3b7b72e42fe057cf5f@symfony"
Content-Transfer-Encoding: base64
Content-Disposition: inline; name="4665654c9bb48f3b7b72e42fe057cf5f@symfony"; filename=qr_1.png

--z_dgJOoS--
--Z0CBIzFb
Content-Type: image/jpeg; name=pixel_1.jpg
Content-Transfer-Encoding: base64
Content-Disposition: inline; name=pixel_1.jpg; filename=pixel_1.jpg

--Z0CBIzFb--
dmitry-seven commented 7 months ago

i have the same issue and was able to solve it this way: in file DNS2D, in row 195 comment the line imagecolortransparent($png, $bgcol); and background will be always white.

Also if you need a border, change the lines 188 and 189 to: $width = ($this->barcode_array['num_cols'] $w)+10; $height = ($this->barcode_array['num_rows'] $h)+10;

and lines 220 to: imagefilledrectangle($png, $x+5, $y+5, ($x + ($w-1))+5, ($y + ($h-1))+5, $fgcol);