How PHP realizes QR code recognition-instance sharing

Source: Internet
Author: User
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 ']);}    }? >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.