Some applications in the display will need to parse the QR code for identification. So how to identify the QR code in PHP backend? This article is to use PHP to identify the two-dimensional code examples as a share, I hope to help everyone.
The first step
Magemagick is a free software that creates, edits, and synthesizes pictures. It can read, convert, and write images in many formats. Picture cutting, color substitution, application of various effects, picture rotation, composition, text, line, polygon, ellipse, curve, attach to the picture stretching rotation. ImageMagick is free software: all open source, free to use, copy, modify, release, it complies with the GPL license agreement, can run on most operating systems, ImageMagick most of the functions of the use of the command-line tools.
Convert a picture from one format to another, including a direct switch to an icon.
change size, rotation, sharpening (sharpen), subtractive, picture effects
Composite image of thumbnail image (a montage of image thumbnails)
Web-appropriate picture with transparent background
Animate a set of images into GIF, directly convert
Make several pictures into a combined picture, montage
Write or draw graphics on a picture with text shading and border rendering.
Add a border or frame to a picture
Get some information about the properties of a picture
10, almost includes the general plug-in function that GIMP can make. It even includes rendering capabilities for various curve parameters. It's just the wording of the order, it's complicated enough.
ImageMagick can be compiled on virtually any non-proprietary operating system, whether it is a 32-bit or 64-bit CPU, including linux,windows ' 95/' 98/me/nt 4.0/2000/xp, Macintosh (MacOS 9/10), VMS and OS/2.
Step Two
Zbar is a common two-dimensional code recognition software
Step Three
Installing Php-zbarcode (Https://github.com/mkoppanen/php-zbarcode)
Fourth Step
Added: extension=zbarcode.so to php.ini configuration file
Fifth Step
Recognition
<?php//creates a new Image object $image = new Zbarcodeimage ("./test.png");//Create a QR code recognizer $scanner = new Zbarcodescanner ();//Identify image $ Barcode = $scanner->scan ($image);//Loop output QR code information if (!empty ($barcode)) { foreach ($barcode as $code) { printf (" Found Type%s barcode with Data%s\n ", $code [' type '], $code [' data ']);} }? >