Skip to content

Commit

Permalink
Preserve transparency of PNG input images
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger Hughes committed Aug 17, 2016
1 parent 1c5f2da commit 8be4179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addon.setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
'name' => 'ImageSizer',
'namespace' => 'Ellislab\Addons\Imgsizer',
'settings_exist' => FALSE,
'version' => '4.0.1',
'version' => '4.0.2',
);
4 changes: 3 additions & 1 deletion pi.imgsizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'pi_description' => 'Image resizer - resize images and create placeholders',
'pi_name' => 'ImageSizer',
'pi_usage' => Imgsizer::usage(),
'pi_version' => '4.0.1',
'pi_version' => '4.0.2',
);

class Imgsizer {
Expand Down Expand Up @@ -244,6 +244,8 @@ function size() {
}

$outImage = imagecreatetruecolor($this->output['width'], $this->output['height']);
imagealphablending($outImage, false);
imagesavealpha($outImage, true);
imagecopyresampled($outImage, $inImage, 0, 0, 0, 0, $this->output['width'], $this->output['height'], $this->input['width'], $this->input['height']);

// save to disk
Expand Down

0 comments on commit 8be4179

Please sign in to comment.