Giter Club home page Giter Club logo

qr-code's Introduction

Jeroen van den Enden

Senior Software Engineer at Netvlies in Breda 🚀

Stats

Your contribution to my open source projects goes beyond just coding. By supporting these projects, you can help shape the direction and possibilities of the technology I'm building, even if you're not a developer. Your support, perspective and innovative ideas can make a meaningful difference.

I invite you to explore my sponsor page for more information or you can buy me a coffee

qr-code's People

Contributors

alexkovalevych avatar amunak avatar ankurk91 avatar broadtech-tito avatar chafikhadjabdourazack avatar edorfaus avatar endroid avatar erkens avatar erym974 avatar ffcz avatar froler314 avatar githubjeka avatar gseric avatar ice6 avatar janunger avatar johanncoste avatar juuuuuu avatar laurentmuller avatar louislam avatar marcosgdf avatar maximiliankresse avatar runrioter avatar slamdunk avatar spomky avatar sprain avatar theianjohnson avatar thijskh avatar thomaslandauer avatar trismegiste avatar woodehh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qr-code's Issues

Let the logo have different image types

$image_info = getimagesize ( $this->logo ); if ($image_info !== false) { $image_type = strtolower ( substr ( image_type_to_extension ( $image_info [2] ), 1 ) ); $logo_image = call_user_func('imagecreatefrom'.$image_type, $this->logo); } else { $logo_image = call_user_func('imagecreatefrom'.$this->image_type, $this->logo); }

how to test the package ?

now I'm using the symfony bundle you provided,now I want to have this bundle tested,I 'm not that familiar with phhunit,my command is:

 phpunit-5.3.4 -c vendor/endroid/qrcode  --bootstrap vendor/autoload.php vendor/endroid/qrcode/tests/

but it reports error like 'Error: Class 'Endroid\QrCode\QrCode' not found' and another two class not found error,what is the correct way to test a package ?

thank for you attention!

What about manual installation?

Not everyone use composer, so please add a manual installation guide, or at least a folder that we can drag&drop in our projects, thanks 😃

Size parameter is not used

It would be much better if all parameters of qrcode could be set using setters. There is setSize($size), but is never used during generation of qrcode.

Just getting malformed characters on render();

All I get when using this library is:

�PNG � IHDR������<��PLTE���U��~�5IDATX�혱��0 D)�H��<�F�G�(��e ����������rE�蹑�;Q��I���X��Y90��d����G0�t��� &n�O���际���H&�t+��� ��,p�o��-&�������vDri���S<�e�t�)j�Yl��D�R�x��x��U���2�����e��X�p[��Q��}-C��ʫ ��ᕀXZV��0E����Ą���v(��311�3>����ǜ�LD��ie�3�ʪ��ڵ��q�l)���ՋE&����a���5�ʝ�dv�������HC�9ʙ?� K�t5\��l0�����W~%��F���෴�>�L��OO�i���E��IEND�B

What am I doing wrong? Am i missing a library? I'm not seeing any error messages...

error generating qr code

I got following error:
PHP Notice: Undefined offset: 15 in /var/www/html/qrservice/vendor/endroid/qrcode/src/Endroid/QrCode/QrCode.php on line 1183

PHP Version:
PHP 5.5.23 (cli) (built: Mar 21 2015 22:04:59)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

Typo in your example

In your example you set the label as ->setLabel('Scan the code') but the QR code label is output as "Label" which some might find confusing.

Padding option omitted from getAvailableOptions() function

In QrCode/src/Factory/QrCodeFactory.php in getAvailableOptions() function, the 'padding' option is omitted.

This error was generate in Symphony when I use the padding option : An exception has been thrown during the rendering of a template ("The option "padding" does not exist. Defined options are: "background_color", "error_correction_level", "extension", "foreground_color", "label", "label_font_path", "label_font_size", "size", "text".")

qrcode unicode compatible

I can't use UTF-8 for Chinese
Could you fix it ?
tks ,i'm waiting for you
You jump, I jump!
tks again

Wrong autodetected image size

Hello!

If image size is not set, it is detected automatically. Auto detection uses module size and the number of modules. That's good idea but it seems that detected size is not optimal so image is scaled/distorted a bit. For example, if there are 33x33 modules and module size is 1, auto detected size is 41x41 instead of 33x33.

I debugged this problem and found that size autodetection works this way:

$mib = $max_modules_1side + 8;
$this->size = $mib * $qrcode_module_size;

Seems that cause of this issues is addition of 8. Is it really needed?

Regards

getDataUri no works

I try to render on twig with dataUri but dont show nothing, broken image...

data:image/png;base64,ZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFVQUFBQUZVQkFNQUFBQ24rZmdVQUFBQUcxQk1WRVgvLy84QUFBQ2ZuNSsvdjc5L2YzOC9QejhmSHg5ZlgxL2YzOThQMmIzTEFBQUFBblJTVGxQOS9SU04zR2tBQUFOQ1NVUkJWSGljN2RxL1Q5dEFHTWJ4U3h3N0htMnBSUm16d0p3bHpLN1U3b2dDNm1pUnhzMUlHVkJHTXdEOXMzdVhVSUx0MTRkL0JDZWszMGVnWE03Y3ZSOGJPenJaVVlvUVFnaHBuN0IyYkFPRDliWmU1bDN6R2dBQkFnUUlFQ0JBZ0ZXQ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ZjZiUDFjbmd4dTl1bmVmRXlwc3Mxa0Q5NGh3bHN5K2ZCdk1mNnZneU9OVmJkZFAwR2VEcDZtZm1wWjBDVjBkd0ExeGZGY094Y2hickk2aWJwdS8xRWV3V3VEb0hOMEQ5VnAvLzdrVDE0MEZnemtIZE5IM0RTQzI5NTNPd1k2QzVpbDhCbnhKOS9nL0R6K25kejFoZnRyRnA2ajcvYWpuN2R4VjNESlR5VmVralZtanVVVzQzSDh5M3UveU1MczNEL0VKb0VrTEl2dWN2UC9JOFpnNWpMQ1VBQUFBQVNVVk9SSzVDWUlJPQ==

Support alpha channel for php 5.4

imagecolorset supports an alpha channel in PHP 5.4+. It would be nice if this could be included for background/foreground colors. I know this library claims PHP 5.3+ compatibility, so it would either need to be bumped, or PHP 5.4 detection could be done in the code to allow for alpha.

Using this without Composer

I'm sure i'm not the only one wanting this - could you include instructions in the readme for utilisation without Composer?

Deeply dislike dependency managers, but would like to use this, but it's not entirely clear on what I should be linking in my require statement.

failed to open stream

When we set a tiny text , QR code cannot be generated

use Endroid\QrCode\QrCode;

$qrCode = new QrCode();
$qrCode
    ->setText('test')
    ->setSize(300)
    ->setPadding(10)
    ->setErrorCorrection('high')
    ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0])
    ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0])
    ->setLabel('Scan the code')
    ->setLabelFontSize(16)
    ->setImageType(QrCode::IMAGE_TYPE_PNG)
;

// now we can directly output the qrcode
header('Content-Type: '.$qrCode->getContentType());
$qrCode->render();

Error is :

Warning: fopen(vendor\endroid\qrcode\src/../assets/data/rsc0.dat): failed to open stream: No such file or directory in vendor\endroid\qrcode\src\QrCode.php on line 1130

Feature request: QR codes types.

It would be great to have a possibility to change QR types like url or other. I think, most people use QR for links, and scanners do differ URLs and text.

Can we export QR Code as SVG

Can you please add a feature where we can export QR codes as SVG, That way we can export images that are small in file size and does not pixelate!

Great library!

Missing display

Hi!
Can you help me fix missing display?
I use Vietnamese for label!
t

(Quét mã)
thank you so much!

Remove margin

How can the margin be removed? I'd like to make the code fit all the available space, without the extra blank space.

Thanks!

Please fix usage example

could you please add require 'vendor/autoload.php'; to your example. Without it, it will not work.

Get image resource

Can we get a getter to retrieve the image resource, or make create() return it?

public function getResource()
{
    if (empty($this->image)) {
        $this->create();
    }

    return $this->image;
}

Feature request: Error reporting

It would be nice if in QrCode::render function, an Exception is thrown if the call_user_func(_array) returns false instead of true.

URL-type QR codes

at this moment all qr codes are generated as TXT-type,
which prevents them from accessing URLS through scanning
in SOME popular scanning software, as TXT-type QR
is treated as simple text string not an URL.
yes, there is a difference between them.

I can´t use this library . . .

In Laravel 5.1

I'm using the same code, but I can't get the image I'm get this code . . . And is NOT base64 code . . .

�PNG � IHDR�@�Z�����d!PLTE������������___???��ߟ������ Ǧ��IDATx���;o�A��aP�(����N�1�L��HIZ��=�N.���8J$�P���H��+3���%�a�� �߯�b����+#֙ !����|�X����� @��������ٜ�ihR�M:�z��� @���������W�"�F������� ��EnV_��� @��������0g�� @�����p�@Sl~�J���[){��� @���SD��O�d������� @�O������gu^��5]��5]��5]�g��]>���09�J�t�X�� @������Y�(�W����7 @�����p���},���Nl�� ��#���� @���(V���c��L��r� � @����(�S�b[V��z��@������ ���GgK�J�7�ȕ"]��5]��5]��5�}R�ĵ�����d�� @����h������7T4$�d�1�Z����� @����KYigQh���f����� @�w�4U��,��W @��������М}��MX����� @�� h�q��2���e��� @����h�L���H6��E����@����������B�!���e��,�ۭ��u^�����_������K+8��_�����^_59+t��T�-Wa�F�O�o��i��_�T���,���֫����۲֖��7�U��G^�ͱR_;�nQ�fuy4��n0Sz�6߫v�+�WR�Z����5�-�׃��UWz�w�^��}���'#�Z����|~R��)Z� T��1��fA�]\�W���]����A��8�M��ث��1����q������l�/��v+�j 씢s������苴>����8�4��_�]$G�E���*V#�t��4��w�~�iF�����T�q�l���٫܇��,�7������x=����Z��?��ɠ[���~��w>���_����P�䍷�v���-0��m�7����O� �<���Qt&7τ\�IEND�B

ImageCreate, ImageCreateFromPng...

ImageCreate, ImageCreateFromPng, ImageColorAllocate, ImageSetPixel and ImageCopyResized should be lowercase in create function of QrCode.php

Tests folder shouldn't be autoloaded by composer

The package works brilliantly.

The only thing I noticed is that it is loading tests on autoload and it shouldn't (imo, it represents unnecessary memory loaded to PHP for production purposes).

Regards.

Warning: fopen(/pathto/qrcode/assets/data/rsc0.dat): failed to open stream: No such file or directory

It's ok last few days, but today I got this problem and it can' generate the qrcode image for me, and before this I din't change anything, actually there is no file named rsc0.dat in the path, below is my code :

$qrCode = new QrCode();
        $qrCode
            ->setText($string)
            ->setSize(300)
            ->setPadding(10)
            ->setErrorCorrection('high')
            ->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
            ->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
            //->setLabel($label)
            //->setLabelFontSize(16)
            ->setImageType(QrCode::IMAGE_TYPE_PNG)
        ;
        return $qrCode;

what's wrong with me ?

parameters:

$string = 'I864';
$label = '';

Hide content of the QRcode

Hello man, how can we hide of the Qrcode so that another application can't print it? I am building an application for aunthentication using your library to store user information, but I dont want other application to see the content when they scan it??

http://endroid.nl/ is blank.

Is http://endroid.nl/ site blank?

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Welcome!</title>
                    <link rel="stylesheet" type="text/css" href="/assets/css/bundled.min.css">
                <link rel="icon" type="image/x-icon" href="/favicon.ico" />

    </head>
    <body>



                            <script src="/assets/js/bundled.min.js"></script>
            </body>
</html>

I can't get the document.

The requested package endroid/qrcode could not be found in any version

composer install:

try:

composer require "endroid/qrcode"
composer require endroid/qrcode:1.6.2
composer require "endroid/qrcode:dev-master" --prefer-dist
composer require "endroid/qrcode:dev-master" --prefer-source


Problem 1
- The requested package endroid/qrcode could not be found in any version, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

scan the qrcode?

this package is all about generating the qrcode if i'm not mistaken. how do i read back the qrcode? is there any way to scan it back.

function not found

hi, i run the code below:

$qrCode = new QrCode();
$qrCode -> setText('hzd')
-> setSize(300)
-> setPadding(10)
-> setErrorCorrection('high')
-> setForegroundColor(array('r'=>0, 'g'=>0, 'b'=>0, 'a'=>0))
-> setBackgroundColor(array('r'=>255, 'g'=>255, 'b'=>255, 'a'=>0))
-> render();

i got a error:
PHP Fatal error: Call to undefined function Endroid\QrCode\imagecreatefrompng() in /usr/local/var/www/QrCode/src/Endroid/QrCode/QrCode.php on line 1101

thanks.

Please list possible commands / possibilities

there is no any explanation of possible commands at this moment,
had to read through source code in order to find how to save files.

having some detailed commands/possibilities list could be very useful.

Chinese garbled

Hello, when I set when Chinese is garbled, I do not know how to solve? Thank you!

Larger QR Codes don't generate right

I tried generating a QR Code for a larger block of text while testing, and found that it didn't generate correctly.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Donec sed odio dui. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam quis risus eget urna mollis ornare vel eu leo. Aenean lacinia bibendum nulla sed consectetur. Donec sed odio dui. Nulla vitae elit libero, a pharetra augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

The generated QR Code won't scan.

1-test

Not rendering with 'errorCorrection' => \Endroid\QrCode\QrCode::LEVEL_MEDIUM

If you try to render an http address with these params:

$defaultOptions = [
    'text'            => 'http://www.example.com/it/it/contact/qr/hit/id/1  ',
    'ext'             => 'png',
    'size'            => 300,
    'padding'         => 10,
    'destDir'         => APPLICATION_PATH . "/../public/cache/qrcode",
    'backgroundColor' => [
        'r' => 255,
        'g' => 255,
        'b' => 255,
        'a' => 0],
    'foregroundColor' => [
        'r' => 0,
        'g' => 0,
        'b' => 0,
        'a' => 0],
    'errorCorrection' => \Endroid\QrCode\QrCode::LEVEL_MEDIUM,
];

it will thow an Exception:
Undefined offset: 43 in /var/www/vhosts/vimarcom/webroot/vendor/endroid/qrcode/src/QrCode.php on line 1150.

It works fine with other ERROR LEVELS.

UndefinedFunctionException

I just have installed QrCode ("endroid/qrcode": "^1.5")

I have the error :

Attempted to call function "imagecreate" from namespace "Endroid\QrCode".
500 Internal Server Error - UndefinedFunctionException 

What am I missing ?

Sample code in README is incorrect

There are semicolons on several lines, causing PHP errors. It should read like so:

use Endroid\QrCode\QrCode;

$qrCode = new QrCode();
$qrCode
    ->setText("Life is too short to be generating QR codes")
    ->setSize(300)
    ->setPadding(10)
    ->setErrorCorrection('high')
    ->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
    ->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
    ->render();

CMYK setBackgroundColor

Is there any support for CMYK or Spot color instead of RGB?

I believe this would be a huge help in the print industry.

SVG output

Vector formats are useful for QR Codes. Given the popularity and browser support of SVG, I think many people would like to have SVG output in this project.

Feature request: support multiple QR code configurations

Hi there! Great library! What about moving the Symfony bundle in another package? In addition, I would add more configuration like this:

endroid_qr_code:
    my_qr1:
        size: 100
        padding: 10
        extension: gif
        error_correction_level: medium
        foreground_color: { r: 0, g: 0, b: 0, a: 0 }
        background_color: { r: 255, g: 255, b: 255, a: 0 }
        label: 'My label'
        label_font_size: 16
    myqr2:
        size: 250
        padding: 10
        error_correction_level: high
    # ...
$this->get('endroid_qrcode.myqr2')->createQrCode();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.