Skip to content

Instantly share code, notes, and snippets.

@dator-zz
Created September 10, 2012 15:32
Show Gist options
  • Save dator-zz/3691568 to your computer and use it in GitHub Desktop.
Save dator-zz/3691568 to your computer and use it in GitHub Desktop.
<?php
// here is my previous code, i open and save directly the original size and there was a transparency issue.
$imagine = new Imagine\Gd\Imagine();
$image = $imagine->open($file->getTempName())
->save('path'), array('quality' => 95));
// with this, no more issue, because resize use the imagealphablending function
$imagine = new Imagine\Gd\Imagine();
list($w, $h) = getimagesize($file->getTempName());
$image = $imagine->open($file->getTempName())
->resize(new Box($w, $h))
->save('path'), array('quality' => 95));
// I think it's a bug, because if i want to save the original size without "working" on the image, i also want to keep the transparency :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment