Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented interlace support for GD, Imagick, and Gmagick. #196

Merged
merged 4 commits into from
Feb 5, 2013
Merged

Implemented interlace support for GD, Imagick, and Gmagick. #196

merged 4 commits into from
Feb 5, 2013

Conversation

anthonysterling
Copy link
Contributor

I thought it best to raise my own PR for Interlace Support given PR #185 has been dormant for a month or so.

Apologies @vchrm.

This PR adds interlace support for the GD, Imagick, and Gmagick implementations. It still requires updated documentation and tests, as such, I would really appreciate some guidance on the best approach to add tests for this functionality.

I'm looking forward to having someone review this.

Thanks everyone.

Anthony.

**/
public function interlace($type)
{
$supportedInterlaceTypes = array(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm happy to do that to help maintain consistency. :)

Thanks.

*
* @return ImageInterface
*/
public function interlace($type);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did notice that the Imagick and Gmagick objects call the interlace types scheme, I wonder if it's worth changing $type to scheme too.

ImageInterface::interlace($scheme);

- Added missing param for array_key_exists calls
- Renamed $type to $scheme within ImageInterface::interlace
@anthonysterling
Copy link
Contributor Author

Strange, if I use GD to create a set of interlaced images with:-

<?php
require_once __DIR__ . '/vendor/autoload.php';
$imagine = new Imagine\Gd\Imagine();
$image = $imagine->open('fixture.jpeg');
$image->interlace(Imagine\Image\ImageInterface::INTERLACE_LINE);
$image->save('interlaced.gif');
$image->save('interlaced.jpg');
$image->save('interlaced.png');

If I then use ImageMagick's identify utility to detect interlacing on the resulting images, I get a negative result for interlaced.gif.

➜  imagine-test  identify -verbose interlaced.gif | grep Interlace 
  Interlace: None
➜  imagine-test  identify -verbose interlaced.jpg | grep Interlace
  Interlace: JPEG
➜  imagine-test  identify -verbose interlaced.png | grep Interlace
  Interlace: PNG

I'll investigate further.

@avalanche123
Copy link
Collaborator

Thanks, @anthonysterling, I'm merging this in. Sorry for the lack of responses, I'm quite busy these couple of weeks

avalanche123 added a commit that referenced this pull request Feb 5, 2013
Implemented interlace support for GD, Imagick, and Gmagick.
@avalanche123 avalanche123 merged commit 990b7ba into php-imagine:develop Feb 5, 2013
@anthonysterling anthonysterling deleted the interlace-support branch February 13, 2013 09:52
@vlakoff vlakoff mentioned this pull request Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants