Login   Register  
PHP Classes
elePHPant
Icontem

image

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      QR code generator  >  All threads  >  image  >  (Un) Subscribe thread alerts  
Subject:image
Summary:how do i get the binary data of a file?
Messages:11
Author:gggg06
Date:2012-03-09 21:02:50
Update:2014-03-05 01:56:51
 
  1 - 10   11 - 11  

  1. image   Reply   Report abuse  
Picture of gggg06
gggg06
2012-03-09 21:02:50
//encoding files like gif, jpg midi files in QR codes
//First parameter type - QR codes for support (image/gif, image/jpeg, application/x-mld, audio/midi, audio/mid, application/x-toruca)
//Second parameter size of file - the total bytes of content data using decimal code
//Third parameter content itself - Designate the content data using binary code
//$qr->content("image/gif", "1385", "zzz");

  2. Re: image   Reply   Report abuse  
Picture of gggg06
gggg06
2012-03-09 21:03:20
//encoding files like gif, jpg midi files in QR codes
//First parameter type - QR codes for support (image/gif, image/jpeg, application/x-mld, audio/midi, audio/mid, application/x-toruca)
//Second parameter size of file - the total bytes of content data using decimal code
//Third parameter content itself - Designate the content data using binary code
//$qr->content("image/gif", "1385", "zzz");

  3. Re: image   Reply   Report abuse  
Picture of Arturs Sosins
Arturs Sosins
2012-03-10 09:52:06 - In reply to message 2 from gggg06
Hello, here's an example:
http://webcodingeasy.com/PHP/Get-binary-data-from-file

  4. Re: image   Reply   Report abuse  
Picture of gggg06
gggg06
2012-03-10 13:44:26 - In reply to message 3 from Arturs Sosins
Thanks but I dont get it to work. Result is an broken image.
Any suggestions?

My code:
$thefile = file_get_contents('http://www.infoom.se/qrcode/binfile.php');
$thefilez = filesize ("./file.gif");
$qr->content("image/gif", $thefilez, $thefile);

The image url:
http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=L ...

  5. Re: image   Reply   Report abuse  
Picture of Arturs Sosins
Arturs Sosins
2012-03-10 19:52:51 - In reply to message 4 from gggg06
There is a limitation of characters that QR code can store, I think that Google API support is even lesser. I can't tell you what is the limit right now, but I'd suggest to start experimenting with smaller images.

  6. Re: image   Reply   Report abuse  
Picture of gggg06
gggg06
2012-03-13 13:23:25 - In reply to message 5 from Arturs Sosins
Im trying with an gif image 4px by 4px bu I cant get it to work.
Du you have en working code / qr image that i can try?

This is the call url to google...

http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=L ...

  7. Re: image   Reply   Report abuse  
Picture of Arturs Sosins
Arturs Sosins
2012-03-13 14:11:25 - In reply to message 6 from gggg06
Sorry, but it seems that even 1px image (that I've tried right now) seems to be too large for Google Chart API to handle.

Well, at the time I wrote the class, which was more than 2 years ago, there were no compatible reader, to read the content as gif, jpg, so I haven't tried that with this class, I was only implementing standards described Google Chart API and QR code creators.
It seems now that some of them were changed and not all have been adopted by majority, so I don't even know if there is a compatible tool to decode an image. But it worked as a proof of concept on custom QR code creater with specific reader app.

  8. Re: image   Reply   Report abuse  
Picture of gggg06
gggg06
2012-03-13 15:47:11 - In reply to message 7 from Arturs Sosins
OK Then i ll put the image function on ice :-)

Everythink else works fine anyway so thanks 4 the class and your time :-)

  9. Re: image   Reply   Report abuse  
Picture of xmlfor
xmlfor
2013-06-14 07:05:55 - In reply to message 2 from gggg06
@gggg06 I agree. Info about QR code generator ,check http://www.rasteredge.com/online-barcode-generator/qr-code/

  10. Re: image   Reply   Report abuse  
Picture of nathen henderson
nathen henderson
2013-09-24 09:23:33 - In reply to message 9 from xmlfor
QR Code generation info:
http://www.onbarcode.com/vb_net/qr-code-generator.html

 
  1 - 10   11 - 11