Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // RESIZING IMAGE WITH IMAGICK
- //1
- $imagick = new \Imagick(realpath($request->file('foto_1')->getRealPath()));
- $imagick->resizeImage(100, 100, 1, 1, 1);
- $cropWidth = $imagick->getImageWidth();
- $cropHeight = $imagick->getImageHeight();
- $cropZoom = true;
- if ($cropZoom) {
- $newWidth = $cropWidth / 2;
- $newHeight = $cropHeight / 2;
- $imagick->cropimage(
- $newWidth,
- $newHeight,
- ($cropWidth - $newWidth) / 2,
- ($cropHeight - $newHeight) / 2
- );
- $imagick->scaleimage(
- $imagick->getImageWidth() * 4,
- $imagick->getImageHeight() * 4
- );
- }
- $b = $imagick->getImageBlob();
- $name = $imagick->writeImage('image1.png');
- echo $b;
- // 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement