Skip to content

Commit

Permalink
Fixed GD compatibility issue while using the imagescale function
Browse files Browse the repository at this point in the history
  • Loading branch information
tooleks committed Jul 7, 2017
1 parent a7f8d05 commit 64e2042
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 10 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tooleks/php-avg-color-picker",
"type": "library",
"description": "The PHP Average Color Picker Library",
"version": "1.0.2",
"version": "1.1.2",
"keywords": [
"php",
"average",
Expand Down
Empty file modified phpunit.xml
100644 → 100755
Empty file.
Empty file modified resources/input.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/output.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Contracts/AvgColorPickerException.php
100644 → 100755
Empty file.
Empty file modified src/Exceptions/InvalidArgumentException.php
100644 → 100755
Empty file.
Empty file modified src/Exceptions/InvalidImageDimensionException.php
100644 → 100755
Empty file.
Empty file modified src/Exceptions/InvalidMimeTypeException.php
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/Gd/Image.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getHeight(): int
*/
public function getAvgRgb(): array
{
$resource = imagescale($this->resource, 1, 1, IMG_BICUBIC);
$resource = imagescale($this->resource, 1, 1);

$rgba = imagecolorsforindex($resource, imagecolorat($resource, 0, 0));

Expand Down
Empty file modified tests/samples/invalid_image.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified tests/samples/valid_image.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified tests/samples/valid_image.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified tests/samples/valid_image.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified tests/unit/ColorConverterUnitTest.php
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions tests/unit/UnitTestCase.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ public function testValidImageProvider()
'path' => __DIR__ . '/../samples/valid_image.gif',
'width' => 400,
'height' => 225,
'avg_hex' => '#734534',
'avg_rgb' => [115, 69, 52],
'avg_hex' => '#754635',
'avg_rgb' => [117, 70, 53],
],
[
'resource' => imagecreatefromjpeg(__DIR__ . '/../samples/valid_image.jpg'),
'path' => __DIR__ . '/../samples/valid_image.jpg',
'width' => 400,
'height' => 225,
'avg_hex' => '#6b4534',
'avg_rgb' => [107, 69, 52],
'avg_hex' => '#6d4635',
'avg_rgb' => [109, 70, 53],
],
[
'resource' => imagecreatefrompng(__DIR__ . '/../samples/valid_image.png'),
'path' => __DIR__ . '/../samples/valid_image.png',
'width' => 400,
'height' => 225,
'avg_hex' => '#6b4534',
'avg_rgb' => [107, 69, 52],
'avg_hex' => '#6d4635',
'avg_rgb' => [109, 70, 53],
],
];
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/gd/GdImage.php → tests/unit/gd/GdImageUnitTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use Tooleks\Php\AvgColorPicker\Gd\Image;

/**
* Class GdImage.
* Class GdImageUnitTest.
*/
class GdImage extends UnitTestCase
class GdImageUnitTest extends UnitTestCase
{
/**
* @dataProvider testInvalidMimeTypeImagePathProvider
Expand Down

0 comments on commit 64e2042

Please sign in to comment.