Giter VIP home page Giter VIP logo

libqrencode's People

Contributors

abelbeck avatar antenore avatar ation avatar d4ndo avatar dnet avatar eckoedc avatar fukuchi avatar jp-bennett avatar jwilk avatar kanglin avatar khoyo avatar mgorny avatar misery avatar moshen avatar mtl1979 avatar neheb avatar poettering avatar qingfenglee avatar repox avatar ripetersen avatar tklauser avatar uniqp avatar vanillahsu avatar vilppuvuorinen avatar ydroneaud avatar zapster 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

libqrencode's Issues

SVG(run-length encoding) and custom qrcodes.

Hi,

Run-length encoding is a great feature, but it is no good when customizing qrcodes with Inkscape. It is a lot easier to group a bunch of smaller objects to a larger one, than to split up a large object to a bunch of smaller ones.

My suggestion:
No run-length encoding as default.

P.S. Thank you for this great project.

CLI program ignores version setting when data is too large to fit

Trying to generate a V3 (explicitly set via -v 3) H alphanumeric QR code, which has a maximum of 35 characters. When passing 36 or more characters, the CLI program will silently increase the QR code version to 4.
qrencode -s 10 -l H -v 3 -i -o /tmp/v3.png 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' generates a V3 code
qrencode -s 10 -l H -v 3 -i -o /tmp/v4.png 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' generates a V4 code

Instead of just increasing the version it should show an error, or the documentation should clearly label -v as minimum version setting.

qrencode should support custom colors

libqrencode is a great command line that demonstrate well libqrencode.

It could be even better if users could choose the foreground and background colors for the generated QR Code image.
Especially, it should be possible to choose a transparent background.

Regards.

Command line tool can't encode NULL bytes

Test/actual result:

$ echo -en "\x00" | ./qrencode -t PNG -o lol.png
Failed to encode the input data: Invalid argument

Expected: The encoded NULL byte in a QR code.

Thanks for your work.

autogen.sh - results in couldn't open directory m4 error

I'm trying to run autogen.sh on my mac OSX.8.5 system and I'm getting the following error. Ideas?

OSX.8-@~/Downloads/libqrencode$ git clone https://github.com/fukuchi/libqrencode
OSX.8-@~/Downloads/libqrencode$ ./autogen.sh
aclocal: error: couldn't open directory 'm4': No such file or directory

Encoding in Alphanumeric encoding (11 bits per 2 characters)

I tried creating a qr code with case sensitive = 0 and 8 bit encoding = 0.

Somehow the program still encoding the information in 8 bit mode.

If I put hint = QR_MODE_AN, it throws out an error. It's throwing an error because the hint is not QR_MODE_8bit.

Can someone give me the required steps to always encode in alphanumeric?

thanks,

problem on complite

./configure
........
Options used to compile and link:
CC = gcc
CFLAGS = -Wall -g -O2
CPPFLAGS =
CXX =
CXXFLAGS =
LDFLAGS =

for why ??

./configure: unexpected token with Ubuntu 12.04

Hi There,

I'm attempting to compile qrencode in Ubuntu 12.04 and am getting the following errors;

./configure.ac: line 1: syntax error near unexpected token [__MAJOR_VERSION],' ./configure.ac: line 1:m4_define([__MAJOR_VERSION], [3])dnl'

Might there be something that I'm woefully overlooking? (It's entirely possible)

cppcheck: out of bounds access

ARGB has 4 components to save now...

diff --git a/qrenc.c b/qrenc.c
index 78f1c12..796ab01 100644
--- a/qrenc.c
+++ b/qrenc.c
@@ -189,7 +189,7 @@ static int color_set(unsigned char color[4], const char *value)
 {
        int len = strlen(value);
        int i, count;
-       unsigned int col[3];
+       unsigned int col[4];
        if(len == 6) {
                count = sscanf(value, "%02x%02x%02x%n", &col[0], &col[1], &col[2], &len);
                if(count < 3 || len != 6) {

EPS output ignores -size option

From Rob Ryan:

I recently downloaded the latest release of qrencode, and I noticed a bug with when using the -t type EPS and the -s Size together.

The -s Size is not taken into account when used with the type EPS, it stays at the default 3 pixels.

qrencode -t EPS -s 20 -m 0 -o test.eps 'test'

Eps does not work as expected.

Segmentation Fault with simple example-code

hi,

i am having trouble with this code:

#include <stdio.h>
#include <stdlib.h>
#include <qrencode.h>

int main()
{
    QRcode *result;
    char text[] = "Encode this text!";

    result = QRcode_encodeString(text, 0, QR_ECLEVEL_L, QR_MODE_AN, 1);

    printf("%i \n", (result->width)^2);

    QRcode_free(result);
    return 0;
}

i get a segmentation fault, when i comment out the printf line, everything works fine.

Incorrect encoding of version M1/M3 tail data code word

The M1 and M3 versions' encoding of the 4-bit last code word of the data appears to be incorrect. It looks like it is always shifted right by one (e.g. a code of 14 is encoded to read 7). It appears that qrencode.c:ln587 (bit = 1 << raw->oddbits;) in QRcode_encodeMaskMQR should read bit = 1 << (raw->oddbits-1);

It functions correctly with that change as far as I can tell. I apologize for not simply committing the change, but I do not have git on my work PC.

Problem with libpng12 on OSX Lion

Hi
I tried to compile qrencode 3.1.1 on OSX Lion and have a dependency problem with libpng, qrencode need libpng12 and Lion comes with libpng15.

I'm not a C programer so made a very basic test forcing compiling with libpng15, and seems to work fine, don't test all the options and variants. Also tried run the tests on test dir but get an error "Undefined symbols for architecture x86_64".

Any chance of any official support for libpng15 ?

Hernan

Autoconf tool:

Hi,

I am trying to configure and compile the source code on a Solaris 10 server.
But when I run autogen.sh, I got this error:
./autogen.sh
configure.ac:52: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.

Do you know what's wrong and how to solve this problem ?

Thanks in advance,
with regards,
Pieter de Gaaij

Different outputs between transparent-colored SVG and PNG

SVG and PNG images generated by qrencode from the same condition seem to differ to each other, when transparent color was given.

An SVG image contains a filled rectangle as a background, and dot patterns on it. When the foreground color is transparent, the color of the dot patterns is blended with the background color. By contrast, this color blending does not occur in PNG image.

Problems with compiling

Hello.
In first time, I want to apologize for my English. I am Spanish and I have not a good English.
When I go to compile test (using make), I go to tests's folder and write in my shell:
make
My problem is:

test_qrinput.o: In function check_lengthOfCode': /home/myPCl/Descargas/qrencode-3.4.2/tests/test_qrinput.c:444: undefined reference toQRinput_mergeBitStream'
/home/myPC/Descargas/qrencode-3.4.2/tests/test_qrinput.c:446: undefined reference to QRinput_lengthOfCode' /home/myPC/Descargas/qrencode-3.4.2/tests/test_qrinput.c:372: undefined reference toQRinput_insertStructuredAppendHeader'
/home/myPC/Descargas/qrencode-3.4.2/tests/test_qrinput.c:643: undefined reference to `QRinput_splitEntry'

Can you help me?

Thanks. :D

Feature request: SVG output

Lacking the abilities to do this myself, I hoping someone could provide with a possible solution for outputting the QR code as SVG.

My current solution, which probably can be done in a better way, is creating my QR code with libqrencode, converting it to bmp with imagemagick and finishin off with converting the bmp to svg with potrace.

Can input chinese?

Hello I used this library in my application writen by VC. It works in numeric,alphanumeric and byte data. Can this lib work in chinese? if it works. How to input chinese data to the lib?

Continuous integration (CI)

Hi @fukuchi.

If you are interested in continuous integration, then I could send a pull request for the travis.yml file.

The unit tests are performed at each commit. Before the test, everything is build from scratch. e.g. libqrencode(fork) tested here: https://travis-ci.org/d4ndo/libqrencode/builds/17759846

Adding an icon to the wiki will show the status of CI testing. Like build:passing or build:error. https://github.com/d4ndo/libqrencode/wiki

Please let me know if you want to use CI.

More information about Travis

http://docs.travis-ci.com/user/getting-started/

--help doesn't work in 3.3.0

After compiling, trying to see the usage/help, I only get an error:

Repox@debian-squeeze:~/qrencode-3.3.0$ /usr/local/bin/qrencode -h
/usr/local/bin/qrencode: symbol lookup error: /usr/local/bin/qrencode: undefined symbol: QRcode_APIVersionString

Trying to remove dependancy to libpng

installing from git repo, get as far as:

make

and get
make: *** No targets specified and no makefile found. Stop.
Did get a small issue at the end of the ./configure requiring a dependency on libpng
from your README is suggest no dependencies is SDL and PNG ignored, how do I do that?

DPI setting has no effect in v3.3.1 with EPS file type

qrencode --output=qr.eps --size=4 --margin=0 --dpi=300 --type=EPS http://www.google.co.uk/
identify -verbose qr.eps
Image: qr.eps
Format: PS (PostScript)
Class: DirectClass
Geometry: 100x100+0+0
Resolution: 72x72
Print size: 1.38889x1.38889
Units: Undefined
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: RGB
Depth: 16/1-bit
Channel depth:
gray: 1-bit
alpha: 1-bit

Resolution is 72x72. However this does not seem to affect PNG file types:

identify -verbose qr.png
Image: qr.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 100x100+0+0
Resolution: 118.11x118.11
Print size: 0.846668x0.846668
Units: PixelsPerCentimeter
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: Gray
Depth: 8/1-bit
Channel depth:
gray: 1-bit

Resolution is 118.11pixels/cm (300dpi).

Can this be fixed please?

[cppcheck] mem leak (masked) in QRcode_encodeMaskMQR()

masked array is allocated, then if QRcode_new() returns NULL is is not freed
proposed patch:

diff --git a/qrencode.c b/qrencode.c
index 6187010..9d08b69 100644
--- a/qrencode.c
+++ b/qrencode.c
@@ -575,6 +575,9 @@ __STATIC QRcode *QRcode_encodeMaskMQR(QRinput *input, int mask)
        }

        qrcode = QRcode_new(version, width, masked);
+       if (qrcode == NULL) {
+               free(masked);
+       }

 EXIT:
        MQRraw_free(raw);

qrencode fails with large input data

As shown here http://www.qrcode.com/en/about/version.html (please click the 31-40 button to see the table) level M qr codes should hold up to 2331 bytes of raw data.
I run qrencode in a script (http://pastebin.com/3LuCtfP1). To easily reproduce the problem I do the following:

Take some large file (qrspec.h from libqrencode is just fine), then:
$ cp qrspec.h testfile.h
$ truncate -s 2331 testfile.h
$ cat testfile.h | qrencode --8bit --level=M --output=testfile.png

Failed to encode the input data: Numerical result out of range

According to the table linked above, the size should fit. If you add a --symversion=40 to the command line the problem is fixed, but then the bash script would produce unnecessarily large QR codes even for small data unless some logic is added.

My understanding of the code is that the input version (0 in my case) is sent down up to QRspec_maximumWords(), which then returns a faulty number. Up at the beginning of the backtrace though, QRcode_encodeDataReal() has the following parameters:

const unsigned char *data, int length, int version, QRecLevel level, int mqr

Given the table I linked above, a simple test on version == 0 should be enough to trigger automatic minimum required version guessing. I'm not sure if this is the right solution, I'd rather argue the QRspec_maximumWords() should just work, but I don't understand what it's doing with the 4x3 matrix and my fix should ensure version 0 is never passed down.

I tried this on qrencode 3.4.2 from my distro's repository and on qrencode build from the github repository at tag v3.4.3. The problem happens in both.

a solution to memory warning checked by LLVM 4.1 clang

File: qrinput.c
Function: QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input)
line:1647
code:

ret = QRinput_Struct_appendInput(s, input);
if(ret < 0) goto ABORT;
input = p;
bits = 0;

=====>
ret = QRinput_Struct_appendInput(s, input);
if(ret < 0) {QRinput_free(p); goto ABORT;}
input = p;
bits = 0;

@liubiqu

configure file missing

Hi Fukuchi,
I am trying to compile your code from the github, but your configure file is missing. I installed the software from http://fukuchi.org/works/qrencode/index.en.html.

I was able to compile it on my 64bit mac using
$ ./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E"
$ make
$ make install

Now, I am getting, the following error, when I compile test_bitstream.c

"QRinput_mergeBitStream", referenced from: printQRinputInfo in test_bitstream.o ld: symbol(s) not found

Is there a way I can fix it.
Thanks

Payload size limited to 2949 chars

The largest text I am able to encode is 2949 chars.
Even if I manually specify v40.

What do I have to do to achieve 4200 as per spec?

Make file dies without error

I am trying to cross compile this on OSX for BlackBerry 10/QNX and make dies without any meaningful error. I was having some problems in getting make to even start but after I entered values for png_CFLAGS and png_LIBS, make started to run but then it dies suddenly as well. A Build directory does not exist after the crash. Ideas?

$ make
make  all-recursive
make[1]: Entering directory `/Users/quackerjack/Downloads/libqrencode'
Making all in .
make[2]: Entering directory `/Users/quackerjack/Downloads/libqrencode'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT qrencode.lo -MD -MP -MF .deps/qrencode.Tpo -c -o qrencode.lo qrencode.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT qrencode.lo -MD -MP -MF .deps/qrencode.Tpo -c qrencode.c  -fno-common -DPIC -o .libs/qrencode.o
mv -f .deps/qrencode.Tpo .deps/qrencode.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT qrinput.lo -MD -MP -MF .deps/qrinput.Tpo -c -o qrinput.lo qrinput.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT qrinput.lo -MD -MP -MF .deps/qrinput.Tpo -c qrinput.c  -fno-common -DPIC -o .libs/qrinput.o
mv -f .deps/qrinput.Tpo .deps/qrinput.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT bitstream.lo -MD -MP -MF .deps/bitstream.Tpo -c -o bitstream.lo bitstream.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT bitstream.lo -MD -MP -MF .deps/bitstream.Tpo -c bitstream.c  -fno-common -DPIC -o .libs/bitstream.o
mv -f .deps/bitstream.Tpo .deps/bitstream.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT qrspec.lo -MD -MP -MF .deps/qrspec.Tpo -c -o qrspec.lo qrspec.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT qrspec.lo -MD -MP -MF .deps/qrspec.Tpo -c qrspec.c  -fno-common -DPIC -o .libs/qrspec.o
mv -f .deps/qrspec.Tpo .deps/qrspec.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT rsecc.lo -MD -MP -MF .deps/rsecc.Tpo -c -o rsecc.lo rsecc.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT rsecc.lo -MD -MP -MF .deps/rsecc.Tpo -c rsecc.c  -fno-common -DPIC -o .libs/rsecc.o
mv -f .deps/rsecc.Tpo .deps/rsecc.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT split.lo -MD -MP -MF .deps/split.Tpo -c -o split.lo split.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT split.lo -MD -MP -MF .deps/split.Tpo -c split.c  -fno-common -DPIC -o .libs/split.o
mv -f .deps/split.Tpo .deps/split.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT mask.lo -MD -MP -MF .deps/mask.Tpo -c -o mask.lo mask.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT mask.lo -MD -MP -MF .deps/mask.Tpo -c mask.c  -fno-common -DPIC -o .libs/mask.o
mv -f .deps/mask.Tpo .deps/mask.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT mqrspec.lo -MD -MP -MF .deps/mqrspec.Tpo -c -o mqrspec.lo mqrspec.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT mqrspec.lo -MD -MP -MF .deps/mqrspec.Tpo -c mqrspec.c  -fno-common -DPIC -o .libs/mqrspec.o
mv -f .deps/mqrspec.Tpo .deps/mqrspec.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall -g -O2 -MT mmask.lo -MD -MP -MF .deps/mmask.Tpo -c -o mmask.lo mmask.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -O2 -MT mmask.lo -MD -MP -MF .deps/mmask.Tpo -c mmask.c  -fno-common -DPIC -o .libs/mmask.o
mv -f .deps/mmask.Tpo .deps/mmask.Plo
/bin/sh ./libtool  --tag=CC   --mode=link gcc  -Wall -g -O2 -version-number 3:9:0  -o libqrencode.la -rpath /usr/local/lib qrencode.lo qrinput.lo bitstream.lo qrspec.lo rsecc.lo split.lo mask.lo mqrspec.lo mmask.lo  
libtool: link: rm -fr  .libs/libqrencode.la .libs/libqrencode.lai .libs/libqrencode.so .libs/libqrencode.so.3
libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libqrencode.3.dylib  .libs/qrencode.o .libs/qrinput.o .libs/bitstream.o .libs/qrspec.o .libs/rsecc.o .libs/split.o .libs/mask.o .libs/mqrspec.o .libs/mmask.o    -O2   -install_name  /usr/local/lib/libqrencode.3.dylib -compatibility_version 13 -current_version 13.0 -Wl,-single_module
libtool: link: (cd ".libs" && rm -f "libqrencode.dylib" && ln -s "libqrencode.3.dylib" "libqrencode.dylib")
libtool: link: ( cd ".libs" && rm -f "libqrencode.la" && ln -s "../libqrencode.la" "libqrencode.la" )
gcc -DHAVE_CONFIG_H -I.    -I/opt/local/include/libpng16  -Wall -g -O2 -MT qrencode-qrenc.o -MD -MP -MF .deps/qrencode-qrenc.Tpo -c -o qrencode-qrenc.o `test -f 'qrenc.c' || echo './'`qrenc.c
mv -f .deps/qrencode-qrenc.Tpo .deps/qrencode-qrenc.Po
/bin/sh ./libtool  --tag=CC   --mode=link gcc -I/opt/local/include/libpng16  -Wall -g -O2   -o qrencode qrencode-qrenc.o libqrencode.la -L/opt/local/lib -lpng16  
libtool: link: gcc -I/opt/local/include/libpng16 -Wall -g -O2 -o .libs/qrencode qrencode-qrenc.o  ./.libs/libqrencode.dylib -L/opt/local/lib /opt/local/lib/libpng16.dylib
make[2]: Leaving directory `/Users/quackerjack/Downloads/libqrencode'
make[1]: Leaving directory `/Users/quackerjack/Downloads/libqrencode'

Make png optional

I'm working toward using qrencode to generate a qr code for a luci app in openwrt. I think I can use the svg output to display the qr code in the browser.

Would it be possible to make libpng an optional dependency? When a 4 meg router only has a few hundred K of free space, libpng is quite a large package.

I understand I can use --without-tools and not build the qrencode program, but I would like to use qrencode, just not to create a png file.

Thanks,
Jonathan Bennett

Output written to stderr instead of stdout

Hello,

While trying to capture "qrencode -V" output I found that qrencode executable writes to stderr instead of stdout, the same behaviour can be found while executing "qrencode -h" and so on.

Thanks a lot for your work!

Cheers,
Ramiro.

more svg options

Hi,
I worked on a svg version that render nicely when over a picture.
It works on black/white transparency and specific dot pattern.

So far, it's a python script that uses dot templates and makes a svg from the ascii output of qrcode.
image
It's beta version, make quite big files (1Mo for this sample) but works.
How to properly share it with the qrencode community ?

How to encode numeric QRCode correctly?

I'm not sure if i'm missing something.
I want a QR Code with version 1 (21x21) and ECC Level H. According to http://www.qrcode.com/en/about/version.html I can have 17 Numerics. So I do:

#include <stdio.h>
#include <stdlib.h>
#include <qrencode.h>

int main()
{
    QRcode *result;
    QRinput *input = QRinput_new2(1, QR_ECLEVEL_H);
    unsigned char *data = new unsigned char[17];
    for(int i = 0; i < 17; i++) {
        data[i] = 0;
    }

    QRinput_append(input, QR_MODE_NUM, 17, data);

    result = QRcode_encodeInput(input);

    int idx = 0;
    printf("%d\n", result->width);
    for(int i = 0; i < result->width; i++) {
        for(int j = 0; j < result->width; j++) {
            if(result->data[idx] & 1) {
                printf("%d", 1);
            } else {
                printf("%d", 0);
            }
            idx++;
        }
        printf("\n");
    }

    QRcode_free(result);
    return 0;
}

But whaterver my data is, my program returns the same output.

Please support pkg-config --cflags

Hi,

pkg-config libqrencode --cflags should return the following messages for example, but now there is no message.

$ pkg-config libqrencode --cflags
-I/usr/pkg/include

Attached patch fix this problem.

Thank you.

--- libqrencode.pc.in.orig 2010-01-19 20:13:25.000000000 +0000
+++ libqrencode.pc.in
@@ -7,3 +7,4 @@ Name: libqrencode
Description: A QR Code encoding library
Version: @Version@
Libs: -L${libdir} -lqrencode
+Cflags: -I${includedir}

Will libqrencode support arm64 ?

you know, apple will reject any app that doesn't support arm64 before next Feb. That means all third-party frameworks in my project need support arm64. libqrencode is a good framework, so will it support arm64 proccessor?

memory leak problem in "qrenc.c".

.
in function "readStdin",
"buffer = (unsigned char *)malloc(MAX_DATA_SIZE + 1);"
memory allocated for buffer is not released after qrcode generated.

Cocoa Application

Hi,

I have added libqrencode to my cocoa application but I don't know how to use this. Please help me to read the qrcode image. thanks in advance.

--type=EPS doesn't include colour when set by --foreground

Generate an eps file with a foreground colour:

% /Data/tools/qrencode-3.4.4/bin/qrencode --version
qrencode version 3.4.4
Copyright (C) 2006-2012 Kentaro Fukuchi
% /Data/tools/qrencode-3.4.4/bin/qrencode --type=EPS --foreground=204080 --output=t.eps Hello

The resulting t.eps has no colour changing command within it.

A line such as:

0.125 0.25 0.5 setrgbcolor

added immediately after the %%EndComments line, sets the colour appropriately.

possible QR-encoding bug

I want to print a QR-encoded vCard file on paper namecards for myself so smartphone users save time in adding me to their contacts. Being a translator, I made versions of my vCard 3.0 file in four different languages, namely English, German, traditional Chinese and simplified Chinese. Then I used qrencode, version 3.1.1 revision 1 which I installed via MacPorts to turn the vCards into QR-PNGs.

The QR-code for the simplified Chinese version caused a problem which I didn't expect: When scanning the code with different devices obviously only 10 of the 18 lines from the original vCard are read. This is especially strange because vCard-syntax is the same as in the traditional Chinese version and the only thing that differs are the Chinese characters that form the content of the different vCard records. Also, both files have been saved using line breaks as required by the vCard format specifications.

One more thing I'd like to just throw in for future considerations: vCard 4.0 which is under development right now will allow redundant records with certain defining parameters such as language etc. so people can add their name, job description, address and so on in different languages. But vCards containing that much information will become too large for QR-encoding (I already removed a lot of information to reduce the size in the versions I sent you). What might help here is perhaps base64-encoded ZIP-data but there is still no standard to read ZIP-encoded vCards from a QR code, I guess mainly because of security concerns. Anyway, this is probably a problem to be discussed by the scanner software and OS developers.

Create a new function to release allocated and cached frames

I hit some memory problem when building libqrencode in a embedded multiplatform environment (we have common code that builds for lots of different setups), so I thought of passing it through valgrind to see how it behaves. I've found out that the only thread-unsafe piece of code is the cached frames, and that also is unfreeable memory currently.

So, what do you think about creating a new API, QRcode_freeCachedData or something like that, to release all non-NULL entries on the cached frames array? Also, you could add this data to the QRcode or QRInput instance, but then we'd lose the caching feature.

(alpha)numeric encoding with QRcode_encodeString()

Hi

am I wrong or QRcode_encodeString() does not accept (alpha)numeric strings ?

eg:
_qrcode = QRcode_encodeString("123", 0, QR_ECLEVEL_L, QR_MODE_AN, 0);
_qrcode = QRcode_encodeString("123", 0, QR_ECLEVEL_L, QR_MODE_NUM, 0);

give EINVAL error, while

_qrcode = QRcode_encodeString8bit("123", 0, QR_ECLEVEL_L);

is ok...

looking at the source code QRcode_encodeString() calls QRcode_encodeStringReal() where there is this check :

if(hint != QR_MODE_8 && hint != QR_MODE_KANJI) {
errno = EINVAL;
return NULL;
}

is this an error or I'm missing something ?

Best regards

        Giampaolo

Embedding the input string to PNG, SVG and EPS

David Dahl suggests:

Another item I have been thinking about is the possibility of
including the input string's value as metadata in the image file. It
may be advantageous to include this as a tEXt or iTXt chunk with a
"comment" key in a PNG, or a <desc>...</desc> or <title>...</title>
pair in an SVG.

While I like this suggestion, the implementation seems to be not simple:

  1. How to embed binary (8-bit) data?
  2. Embedding text data to SVG/EPS may require sanitizing.

Your comments are welcome.

Feature request: Color

It would be very useful if I could provide a HEX color code to change the color of the QR code.

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.