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

Call to undefined method Imagick::roundCorners() #213

Closed
beecubu opened this Issue Jul 21, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@beecubu

beecubu commented Jul 21, 2017

This version has no roundCorners.

I'am using Imagick 3.4.3 with ImageMagick 7.0.6-1

@xEsk

This comment has been minimized.

Show comment
Hide comment
@xEsk

xEsk Jul 21, 2017

Same here, after update to imageMagick 7.x and imagick 3.4.3 the roundCorners is missing.

Error: "Call to undefined method Imagick::roundCorners()"

PHP: 5.6.x (using homebrew)

xEsk commented Jul 21, 2017

Same here, after update to imageMagick 7.x and imagick 3.4.3 the roundCorners is missing.

Error: "Call to undefined method Imagick::roundCorners()"

PHP: 5.6.x (using homebrew)

@Danack

This comment has been minimized.

Show comment
Hide comment
@Danack

Danack Sep 10, 2017

Collaborator

Yeah - it's not present for ImageMagick 7, due to the C code depending on a library function which has been removed for ImageMagick 7.

The equivalent code should be easy to do in PHP. If any cares enough to make it, I will distribute that version instead of the C code version.

For now, I have added deprecation notice so it is less of a surprise when it goes away.

Collaborator

Danack commented Sep 10, 2017

Yeah - it's not present for ImageMagick 7, due to the C code depending on a library function which has been removed for ImageMagick 7.

The equivalent code should be easy to do in PHP. If any cares enough to make it, I will distribute that version instead of the C code version.

For now, I have added deprecation notice so it is less of a surprise when it goes away.

@Danack Danack closed this Sep 10, 2017

@rafi-tvtime

This comment has been minimized.

Show comment
Hide comment
@rafi-tvtime

rafi-tvtime Sep 28, 2017

Yes please share the PHP version. We use this method.

rafi-tvtime commented Sep 28, 2017

Yes please share the PHP version. We use this method.

@Ericzhiluo

This comment has been minimized.

Show comment
Hide comment
@Ericzhiluo

Ericzhiluo Apr 30, 2018

please provide an alternative

Ericzhiluo commented Apr 30, 2018

please provide an alternative

@xEsk

This comment has been minimized.

Show comment
Hide comment
@xEsk

xEsk May 2, 2018

Round corners code example

// example values
$width = 250;
$height = 250;
$cornerRadius = 10;

// create mask image
$mask = new Imagick();
$mask->newImage($width, $height, new ImagickPixel('transparent'), 'png');
// create the rounded rectangle
$shape = new ImagickDraw();
$shape->setFillColor(new ImagickPixel('black'));
$shape->roundRectangle(0, 0, $width, $height, $cornerRadius, $cornerRadius);
// draw the rectangle
$mask->drawImage($shape);
// apply mask
$image->compositeImage($mask, Imagick::COMPOSITE_DSTIN, 0, 0);

xEsk commented May 2, 2018

Round corners code example

// example values
$width = 250;
$height = 250;
$cornerRadius = 10;

// create mask image
$mask = new Imagick();
$mask->newImage($width, $height, new ImagickPixel('transparent'), 'png');
// create the rounded rectangle
$shape = new ImagickDraw();
$shape->setFillColor(new ImagickPixel('black'));
$shape->roundRectangle(0, 0, $width, $height, $cornerRadius, $cornerRadius);
// draw the rectangle
$mask->drawImage($shape);
// apply mask
$image->compositeImage($mask, Imagick::COMPOSITE_DSTIN, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment