Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self hosted qr-code generator insted of api.qrserver.com possible ? #88

Open
n00bsi opened this issue Feb 20, 2024 · 15 comments
Open

self hosted qr-code generator insted of api.qrserver.com possible ? #88

n00bsi opened this issue Feb 20, 2024 · 15 comments
Labels
enhancement New feature or request

Comments

@n00bsi
Copy link

n00bsi commented Feb 20, 2024

Hello,
is it possible to have a self-hosted qr-generator insted of api.qrserver.com ?
So that no external service is need.
So that no external dependencies are needed.

is it possible to use the tool: qrencode

@giandonatoinverso
Copy link
Owner

Hi, your proposal is very interesting. I invite you to contribute to the project

@giandonatoinverso giandonatoinverso added the enhancement New feature or request label Feb 20, 2024
@tranmh
Copy link
Contributor

tranmh commented Feb 22, 2024

Hi,

I have the same idea and start to fork another project called go-qrcode:
https://github.com/tranmh/go-qrcode/blob/master/qrcode-restapi/main.go

go-qrcode has now a restapi and your code at line:
https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code/blob/master/src/lib/Qrcode/Qrcode.php#L83

can call it using:
$url = 'http://localhost:6868/api/qrcode?data=https%3A%2F%2Fsvw.info&size=256';

What is your expectation? I assume we need go-qrcode with restapi as git submodule. What else do you need to accept a pull request?

Thx.

@giandonatoinverso
Copy link
Owner

Hi, the creation method you propose doesn't have the same customization possibilities (or better) that are currently in use, so it's not good

@tranmh
Copy link
Contributor

tranmh commented Feb 22, 2024

Sure, wait for the other Pull Request:
skip2/go-qrcode#66

If this PR is going into their repo, I will extend the customization possibilities. Which of those is a must-have for you?

@giandonatoinverso
Copy link
Owner

I want the actual customization of my script. Thanks

@tranmh
Copy link
Contributor

tranmh commented Feb 23, 2024

In PR
skip2/go-qrcode#66
I added another improvement: "add support for ecc aka recovery level, color and background-color". and would look like this:
http://localhost:6868/api/qrcode?data=abc&size=800&color=00FF00&bgcolor=FF00FF&ecc=L

@giandonatoinverso
Copy link
Owner

Is it already working?

@tranmh
Copy link
Contributor

tranmh commented Feb 23, 2024

yes. PR is not accept yet, but I tested on my local machined.

@giandonatoinverso
Copy link
Owner

Ok then write to me when it is accepted please

@tranmh
Copy link
Contributor

tranmh commented Feb 23, 2024

Change would be:
https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code/blob/master/src/lib/Qrcode/Qrcode.php#L83

replace the following line

        $url =
            'https://api.qrserver.com/v1/create-qr-code/?data='.
            $data_to_qrcode.
            '&&size='.$options['size'].'x'.$options['size'].
            '&ecc='.$options['errorCorrectionLevel'].
            '&margin=0&color='.$options['foreground'].
            '&bgcolor='.$options['background'].
            '&qzone=2'.
            '&format='.$data_to_db['format'];

with

        $url =
                'http://localhost:6868/api/qrcode?data='.
                $data_to_qrcode.
                '&size='.$options['size'].
                '&color='.$options['foreground'].
                '&bgcolor='.$options['background'].
                '&ecc='.$options['errorCorrectionLevel'];

@giandonatoinverso
Copy link
Owner

I saw that the format is missing. Many of my users need all the formats that my script offers. Does this new generation method have them? For example EPS

@tranmh
Copy link
Contributor

tranmh commented Feb 27, 2024

skip2/go-qrcode#66 have now the following two formats: png and svg. More will hopefully come.

@giandonatoinverso
Copy link
Owner

Ok let me know when the other formats will be available

@Shineson1001
Copy link

Hi,

nice project ... but

is it possible to have a self-hosted qr-generator insted of api.qrserver.com ?

That was also my first thought when I read the information in the documentation that the data is sent to an external service provider. 😮
This is not nice and completely unnecessary, as there are enough offline projects

@Shineson1001
Copy link

Shineson1001 commented Jul 25, 2024

Hi,
I use this PHP QR Code (chillerlan/php-qrcode) now.
... I have implemented the project in your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants