Closed digz6666 closed 8 years ago
Sounds about the right size output image (I'm getting 432 for that text though). "seems corrupted" is rather vague. Have you tried pillow
?
@SmileyChris Haven't tried pillow yet, its working fine on my ubuntu 14.04.
I've just ran the same test on Windows 10, Python 2.7 and Pillow 3.1.
The resulting png is corrupt according to the photo viewer in Windows AND Gimp (on Windows). Generated file size is 435B (damn you, rounding...)
File:
Thanks for confirming
File hex diff between linux and windows:
< 00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR
< 00000010: 0000 0122 0000 0122 0100 0000 0075 c5e2 ..."...".....u..
< 00000020: 1b00 0001 7749 4441 5478 9ced 984d 8e83 ....wIDATx...M..
< 00000030: 300c 469f 07a4 2ee1 0673 9470 7438 4a0f 0.F......s.pt8J.
< 00000040: 5029 ec41 df2c f86d 67a4 e906 48c1 5e20 P).A.,.mg...H.^
< 00000050: 623d 894f 8e89 1d9b f8df 9aaf 3720 70ca b=.O........7 p.
< 00000060: 29a7 9c72 2a75 ca46 cb31 2b01 dac9 531d )..r*u.F.1+...S.
< 00000070: aaeb 1254 9024 c5d1 6915 9924 49cf d4fe ...T.$..i..$I...
< 00000080: ba2e 41b5 738e 03aa 0133 cb8f d775 254a ..A.s....3...u%J
< 00000090: 35fd 6a17 76f8 e275 a9fc 656d 21f6 db7e 5.j.v..u..em!..~
< 000000a0: d1a9 c9a6 d817 025a 5053 460d 6f87 eaba .......ZPSF.o...
< 000000b0: 02c5 baa4 9289 1033 11e2 e409 9254 a7aa .......3.....T..
< 000000c0: feb3 a921 ef97 1c17 74e8 39eb d355 7f06 ...!....t.9..U..
< 000000d0: ca2a fab9 a1ef 8da6 04ab 5aef ef37 a5c6 .*........Z..7..
< 000000e0: bc6f 2c93 513c 7235 e503 0bb1 cfd5 7ccf .o,.Q<r5......|.
< 000000f0: c99f aafa 7350 4507 e17e 13e1 9e03 ed4d ....sPE..~.....M
< 00000100: 84d8 7bde 6f49 0db5 76b0 ba90 804c e356 ..{.oI..v....L.V
< 00000110: 44bc d66e 49ad 62cf d8e7 3044 7cdc 008f D..nI.b...0D|...
< 00000120: fd1e 94a4 0e9a 3213 b439 0c7f c0f1 ba4e ......2..9.....N
< 00000130: 4bfd d1df c372 fa8c 8751 aaea 4f41 ade7 K....r...Q..OA..
< 00000140: 98d9 5470 f15a bb0b 35f7 f24d 397a 5417 ..Tp.Z..5..M9zT.
< 00000150: 92ea 8375 9d99 7a9d a541 1131 c014 ee79 ...u..z..A.1...y
< 00000160: 7798 ae2b 52aa e90d 0ac9 2a3f 73b6 a55e w..+R.....*?s..^
< 00000170: e798 8385 1ab4 2c93 55ff d9d4 af3e 6775 ......,.U....>gu
< 00000180: b75a 2e5d a9aa ff6c ea8f 39e6 f078 1a64 .Z.]...l..9..x.d
< 00000190: a6aa de29 a79c 72ca a977 a91f 477d ca49 ...)..r..w..G}.I
< 000001a0: cb8a f946 0000 0000 4945 4e44 ae42 6082 ...F....IEND.B`.
---
> 00000000: 8950 4e47 0d0d 0a1a 0d0a 0000 000d 4948 .PNG..........IH
> 00000010: 4452 0000 0122 0000 0122 0100 0000 0075 DR..."...".....u
> 00000020: c5e2 1b00 0001 7749 4441 5478 9ced 984d ......wIDATx...M
> 00000030: 8e83 300c 469f 07a4 2ee1 0673 9470 7438 ..0.F......s.pt8
> 00000040: 4a0f 5029 ec41 df2c f86d 67a4 e906 48c1 J.P).A.,.mg...H.
> 00000050: 5e20 623d 894f 8e89 1d9b f8df 9aaf 3720 ^ b=.O........7
> 00000060: 70ca 29a7 9c72 2a75 ca46 cb31 2b01 dac9 p.)..r*u.F.1+...
> 00000070: 531d aaeb 1254 9024 c5d1 6915 9924 49cf S....T.$..i..$I.
> 00000080: d4fe ba2e 41b5 738e 03aa 0133 cb8f d775 ....A.s....3...u
> 00000090: 254a 35fd 6a17 76f8 e275 a9fc 656d 21f6 %J5.j.v..u..em!.
> 000000a0: db7e d1a9 c9a6 d817 025a 5053 460d 6f87 .~.......ZPSF.o.
> 000000b0: eaba 02c5 baa4 9289 1033 11e2 e409 9254 .........3.....T
> 000000c0: a7aa feb3 a921 ef97 1c17 74e8 39eb d355 .....!....t.9..U
> 000000d0: 7f06 ca2a fab9 a1ef 8da6 04ab 5aef ef37 ...*........Z..7
> 000000e0: a5c6 bc6f 2c93 513c 7235 e503 0bb1 cfd5 ...o,.Q<r5......
> 000000f0: 7ccf c99f aafa 7350 4507 e17e 13e1 9e03 |.....sPE..~....
> 00000100: ed4d 84d8 7bde 6f49 0db5 76b0 ba90 804c .M..{.oI..v....L
> 00000110: e356 44bc d66e 49ad 62cf d8e7 3044 7cdc .VD..nI.b...0D|.
> 00000120: 008f fd1e 94a4 0e9a 3213 b439 0c7f c0f1 ........2..9....
> 00000130: ba4e 4bfd d1df c372 fa8c 8751 aaea 4f41 .NK....r...Q..OA
> 00000140: ade7 98d9 5470 f15a bb0b 35f7 f24d 397a ....Tp.Z..5..M9z
> 00000150: 5417 92ea 8375 9d99 7a9d a541 1131 c014 T....u..z..A.1..
> 00000160: ee79 7798 ae2b 52aa e90d 0d0a c92a 3f73 .yw..+R......*?s
> 00000170: b6a5 5ee7 9883 851a b42c 9355 ffd9 d4af ..^......,.U....
> 00000180: 3e67 75b7 5a2e 5da9 aaff 6cea 8f39 e6f0 >gu.Z.]...l..9..
> 00000190: 781a 64a6 aade 29a7 9c72 caa9 77a9 1f47 x.d...)..r..w..G
> 000001a0: 7dca 49cb 8af9 4600 0000 0049 454e 44ae }.I...F....IEND.
> 000001b0: 4260 82 B`.
Output from master:
Just released 5.2 which fixes this.
@SmileyChris Thanks for the quick fix, it works fine now!
It generates 435 bytes of png and it seems corrupted. I tried:
qrcode library version: 5.1 python: 2.7 PIL: 1.1.7 OS: Windows 7 64bit