Download the PHP package remymazmanian/qr-studio without Composer

On this page you can find all versions of the php package remymazmanian/qr-studio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package qr-studio

QR Studio

Tests

A framework-agnostic PHP library for generating styled QR codes as SVG or PNG.

Docs, demo & setup guide: remymazmanian.com/qr-studio/

Most QR libraries give you black squares. This one gives you control over module shape, eye shape, framing, colour, a centre logo and a caption, while keeping the result scannable.

Install

Requires PHP 8.4+ (inherited from endroid/qr-code 6.x). PNG output also needs the GD extension; SVG output works without it. Asking for a PNG without GD throws a RuntimeException that says so.

Demo

A single-file playground with live preview, all payload types and every style control:

Then open http://localhost:8080.

The demo accepts a logo file upload, so treat it as a local development tool rather than something to expose on a public host as-is.

What you can control

Option Values
module_style square, rounded, dots, extra_rounded
eye_style square, rounded, circle
frame_style none, simple_border, rounded_card
error_correction_level low, medium, quartile, high
foreground_color / background_color / eye_color / label_color #rrggbb or #rgb
transparent_background bool. Removes the background fill. The gap inside each eye and the panel behind a logo stay white, so the code still scans.
qr_size Size of the code itself in pixels, 64 to 4096. It's rounded down to a whole number of pixels per module, and the margin, frame and caption are added around it.
margin Pixels, 0 to 1024. Never less than the 4-module quiet zone scanners need.
logo_path / logo_size_percentage Local file path, and 0 to 25% of the QR (larger values are capped at 25%)
label_text / label_font_size One-line caption beneath the code, 8 to 200 px. Long captions shrink to fit, then end in "…".
label_font_path Optional TTF or OTF file for PNG captions, for scripts the bundled Open Sans doesn't cover

Options outside these values throw an InvalidArgumentException naming the option, so a typo such as 'module_style' => 'dot' fails loudly instead of rendering squares.

Three starting points are bundled: generic, rounded_square and circle:

Payload types

PayloadFactory builds correctly-escaped payload strings, which matters more than it sounds: Wi-Fi and vCard payloads are delimiter-separated, so an unescaped ; or : in a network name silently produces the wrong result on the scanning device.

Keeping codes scannable

Two things reliably break a "designed" QR code, and both are easy to do by accident:

Low contrast. If the modules do not contrast with what is behind them, phones fail to lock on. ColorContrast implements the WCAG relative-luminance formula so you can refuse a bad combination before rendering:

Logos without headroom. A centre logo covers data modules. When a logo is drawn, low and medium error correction are raised to quartile automatically; use high for the most headroom. logo_size_percentage is capped at 25 for the same reason.

Too few pixels per module. Very small PNGs leave each module only a few pixels. Modules are drawn to exact pixel boundaries, and below 6 px per module the dots style is drawn as squares so it stays readable.

Logos

logo_path is a local filesystem path. The library deliberately knows nothing about storage disks, upload directories or URL schemes; resolving a user upload to a real path is the calling application's job. That is what keeps this package free of any framework convention.

Logos must be PNG, JPEG, GIF or WebP. Paths with a stream wrapper such as phar:// or https:// are refused, and so are images larger than 4096 pixels on either side, which are checked before anything is decoded.

Output

result() returns an Endroid\QrCode\Writer\Result\ResultInterface:

Tests

Besides unit tests, the suite renders codes across sizes, styles, error-correction levels and logos, then decodes each PNG with an independent QR reader, so a code that looks right but doesn't scan fails the build. GitHub Actions runs it on PHP 8.4 and 8.5, and without GD.

Credits

Created by Remy Mazmanian.

License

MIT. See LICENSE.


All versions of qr-studio with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
endroid/qr-code Version ^6.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package remymazmanian/qr-studio contains the following files

Loading the files please wait ...