joshp23 / YOURLS-IQRCodes

YOURLS QRCode plugin with exposed options and full integration
GNU General Public License v3.0
22 stars 11 forks source link

Logo watermark is not generated on QR code #23

Closed josedsilva closed 6 years ago

josedsilva commented 6 years ago

Logo watermark is not generated on QR code even if setup in the admin -> "IQRCodes Config" section.

joshp23 commented 6 years ago

confirmed. let me do some debugging.

joshp23 commented 6 years ago

Pretty sure I found it. Looks like line 924 of iqrcodes/assets/phpqrcode.php needs to be updated from this:

$logoPath = $_SERVER['DOCUMENT_ROOT']."/user/plugins/iqrcodes/logo.".$opt[5];

to this:

$logoPath = YOURLS_ABSPATH."/".$opt[0]."/logo.".$opt[5];

If you would like to test this and send a merge request that would be peachy, if not I will potentially get to it sometime tomorrow. Thanks for pointing this out.

josedsilva commented 6 years ago

This fixes the path issue. But now, only a PNG logo watermark can be used. If the logo is a JPG, it does not show on the QR code.

On Sun, Jan 14, 2018 at 11:16 AM, Josh Panter notifications@github.com wrote:

Pretty sure I found it. Looks like line 924 of iqrcodes/assets/phpqrcode.php needs to be updated from this:

$logoPath = $_SERVER['DOCUMENT_ROOT']."/user/plugins/iqrcodes/logo.".$ opt[5];

to this:

$logoPath = YOURLS_ABSPATH."/".$opt[0]."/logo.".$opt[5];

If you would like to test this and send a merge request that would be peachy, if not I will potentially get to it sometime tomorrow. Thanks for pointing this out.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joshp23/YOURLS-IQRCodes/issues/23#issuecomment-357490351, or mute the thread https://github.com/notifications/unsubscribe-auth/AAre8ATjAgMgQNDx40eVTphdjIdFoEqoks5tKZTBgaJpZM4Rb82j .

joshp23 commented 6 years ago

H'm, I bet if Image Type for qrcode output was set to JPG then it would work with a JPG based logo. I think changing 924 to

$logoPath = YOURLS_ABSPATH."/".$opt[0]."/logo.*"; <<---EDIT: this does not work

might do the trick in the meantime. However, I will prefer to explicitly set the logo file type here.

joshp23 commented 6 years ago

fixed, with many other logo related bug fixes, with latest commit.