Skip to content

rotate() inconsistencies between drivers #709

@ninze

Description

@ninze

Issue description

Gd and Imagick drivers leave the image in a different state after rotation.

What version of Imagine are you using?

1.2.1-dev

What's the PHP version you are using?

PHP 7.2.1

What's the imaging library you are using [gd/imagick/gmagick/any]?

Imagick, Gd

Minimal PHP code to reproduce the error:

$size = $image->getSize();
$image->rotate(45);
$image->crop(new Point(0, 0), $size);

Output by Gd driver:
Gd-output

Output by Imagick driver:
Imagick-output

The problem is that Imagick does not update image geometry after the rotation. I think a similar issue is described here: https://phpimagick.com/Tutorial/imageGeometryReset

Output from Gd seems to be the correct one.

The solution would be to call setImagePage() inside Imagick driver after the rotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions