Skip to content

Commit

Permalink
Merge pull request #219 from SimpleSoftwareIO/develop
Browse files Browse the repository at this point in the history
4.2.0
  • Loading branch information
SimplyCorey authored Feb 8, 2021
2 parents 3b72108 + c4c4c47 commit 916db79
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 7 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Simple QrCode
[![License](https://poser.pugx.org/simplesoftwareio/simple-qrcode/license.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
[![Total Downloads](https://poser.pugx.org/simplesoftwareio/simple-qrcode/downloads.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode)

## [Español](https://www.simplesoftware.io/#/docs/simple-qrcode/es) | [Français](https://www.simplesoftware.io/#/docs/simple-qrcode/fr) | [Italiano](https://www.simplesoftware.io/#/docs/simple-qrcode/it) | [Português](https://www.simplesoftware.io/#/docs/simple-qrcode/pt-br) | [Русский](https://www.simplesoftware.io/#/docs/simple-qrcode/ru) | [日本語](https://www.simplesoftware.io/#/docs/simple-qrcode/ja) | [한국어](https://www.simplesoftware.io/#/docs/simple-qrcode/kr) | [हिंदी](https://www.simplesoftware.io/#/docs/simple-qrcode/hi) | [简体中文](https://www.simplesoftware.io/#/docs/simple-qrcode/zh-cn)
## [Deutsch](https://www.simplesoftware.io/#/docs/simple-qrcode/de) | [Español](https://www.simplesoftware.io/#/docs/simple-qrcode/es) | [Français](https://www.simplesoftware.io/#/docs/simple-qrcode/fr) | [Italiano](https://www.simplesoftware.io/#/docs/simple-qrcode/it) | [Português](https://www.simplesoftware.io/#/docs/simple-qrcode/pt-br) | [Русский](https://www.simplesoftware.io/#/docs/simple-qrcode/ru) | [日本語](https://www.simplesoftware.io/#/docs/simple-qrcode/ja) | [한국어](https://www.simplesoftware.io/#/docs/simple-qrcode/kr) | [हिंदी](https://www.simplesoftware.io/#/docs/simple-qrcode/hi) | [简体中文](https://www.simplesoftware.io/#/docs/simple-qrcode/zh-cn)

Language files are currently out of date. We need volunteers to upgrade them to v4! Please submit a PR request!

### Try our dead simple, free file transfer service [keep.sh](https://keep.sh)

![keep.sh](https://user-images.githubusercontent.com/624784/59808382-06676800-92ca-11e9-87b7-70020b6aef5f.gif)
[![keep.sh](https://user-images.githubusercontent.com/624784/95805291-1121e980-0cd3-11eb-9048-0264bd9f2fd7.gif)](https://keep.sh)

Upload files with a single curl command from your terminal! `curl --upload-file your-local-file.txt https://keep.sh`
Easy fast file sharing from the command line with a single curl command! `curl --upload-file your-local-file.txt https://keep.sh`

## Introduction
Simple QrCode is an easy to use wrapper for the popular Laravel framework based on the great work provided by [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users.
Expand All @@ -28,6 +28,16 @@ Documentation for Simple QrCode can be found on our [website.](http://www.simple

![Example 1](docs/imgs/example-1.png) ![Example 2](docs/imgs/example-2.png)

## Use Cases
<p align="center">
<a href="https://www.rsvpify.com">
<img width="300" src="https://rsvpify.com/wp-content/uploads/2017/03/rsvpify-logo-header-rsvp.png">
</a>
</p>
<p align="center">
<a href="https://rsvpify.com/sell-tickets">Platform to sell tickets online</a>
</p>

## Contributing

Please submit all issues and pull requests to the [simplesoftwareio/simple-qrcode](https://github.com/simplesoftwareio/simple-qrcode) repository on the develop branch!
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "simplesoftwareio/simple-qrcode",
"description": "Simple QrCode is a QR code generator made for Laravel.",
"keywords": ["qrcode", "laravel", "simple", "generator", "wrapper"],
"homepage": "http://www.simplesoftware.io",
"homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode",
"license" : "MIT",
"authors": [
{
Expand All @@ -11,7 +11,7 @@
}
],
"require": {
"php": ">=7.2",
"php": ">=7.2|^8.0",
"ext-gd": "*",
"bacon/bacon-qr-code": "^2.0"
},
Expand Down
20 changes: 19 additions & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@

## Try our dead simple, free file transfer service [keep.sh](https://keep.sh)

![keep.sh](https://user-images.githubusercontent.com/624784/59808382-06676800-92ca-11e9-87b7-70020b6aef5f.gif)
[![keep.sh](https://user-images.githubusercontent.com/624784/95805291-1121e980-0cd3-11eb-9048-0264bd9f2fd7.gif)](https://keep.sh)

Upload files with a single curl command from your terminal! `curl --upload-file file.txt https://keep.sh`

## Use Cases
<p align="center">
<a href="https://www.rsvpify.com">
<img width="300" src="https://rsvpify.com/wp-content/uploads/2017/03/rsvpify-logo-header-rsvp.png">
</a>
</p>
<p align="center">
<a href="https://rsvpify.com/sell-tickets">Platform to sell tickets online</a>
</p>

<a id="docs-introduction"></a>
## Introduction
Simple QrCode is an easy to use wrapper for the popular Laravel framework based on the great work provided by [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users.
Expand All @@ -23,6 +33,8 @@ You **must** install the `imagick` PHP extension if you plan on using the `png`

#### v4

> There was a mistake when creating 4.1.0 and allowing a backwards breaking change into the master branch. The `generate` method will now return an instance of `Illuminate\Support\HtmlString` if you are running Laravel. See https://github.com/SimpleSoftwareIO/simple-qrcode/issues/205 for more information.
There was a Laravel facade issue within v3 that causes some loading issues. The only way to fix this was to create a backwards breaking change so v4 has been released. If you are coming from v2 there is no need to change any code. The below change only effects users on v3.

All references to the `QrCode` facade need to be changed to:
Expand Down Expand Up @@ -150,6 +162,8 @@ The following gradient types are supported:

You may change the eye colors by using the `eyeColor` method.

QrCode::eyeColor(0, 255, 255, 255, 0, 0, 0); // Changes the eye color of eye `0`

| Eye Number | Example |
| --- | --- |
| `0` | ![Eye 0](https://raw.githubusercontent.com/SimpleSoftwareIO/simple-qrcode/master/docs/imgs/eye-0.png?raw=true) |
Expand All @@ -161,6 +175,8 @@ You may change the eye colors by using the `eyeColor` method.

The style can be easily swapped out with `square`, `dot,` or `round`. This will change the blocks within the QrCode. The second parameter will affect the size of the dots or roundness.

QrCode::style('dot'); // Uses the `dot` style.

| Style | Example |
| --- | --- |
| `square` | ![Square](https://raw.githubusercontent.com/SimpleSoftwareIO/simple-qrcode/master/docs/imgs/200-pixels.png?raw=true) |
Expand All @@ -171,6 +187,8 @@ The style can be easily swapped out with `square`, `dot,` or `round`. This will

The eye within the QrCode supports two different styles, `square` and `circle`.

QrCode::eye('circle'); // Uses the `circle` style eye.

| Style | Example |
| --- | --- |
| `square` | ![Square](https://raw.githubusercontent.com/SimpleSoftwareIO/simple-qrcode/master/docs/imgs/200-pixels.png?raw=true) |
Expand Down
10 changes: 10 additions & 0 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ public function getImageResource()
{
return $this->image;
}

/**
* Sets the image string.
*
* @param resource $image
*/
public function setImageResource($image)
{
$this->image = $image;
}
}
20 changes: 19 additions & 1 deletion src/ImageMerge.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,24 @@ public function merge($percentage)
{
$this->setProperties($percentage);

imagecopyresampled(
$img = imagecreatetruecolor($this->sourceImage->getWidth(), $this->sourceImage->getHeight());
imagealphablending($img, true);
$transparent = imagecolorallocatealpha($img, 0, 0, 0, 127);
imagefill($img, 0, 0, $transparent);

imagecopy(
$img,
$this->sourceImage->getImageResource(),
0,
0,
0,
0,
$this->sourceImage->getWidth(),
$this->sourceImage->getHeight()
);

imagecopyresampled(
$img,
$this->mergeImage->getImageResource(),
$this->centerX,
$this->centerY,
Expand All @@ -120,6 +136,8 @@ public function merge($percentage)
$this->mergeImageHeight
);

$this->sourceImage->setImageResource($img);

return $this->createImage();
}

Expand Down

0 comments on commit 916db79

Please sign in to comment.