<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
/* The object used as a canvas */
$canvas = new imagick( "fake_wood_plastic_formica_4131428.jpg" );
$canvas->adaptiveResizeImage( 300, 300 );
$canvas->setImageFormat( "png" ); /* paths to the images */
$paths = array( "chev7.jpg", "myfrog.jpg", "strawberry.jpg", "Image32.jpg" ); /* Create an empty ImagickDraw object (Use the defaults for the polaroid) */
$bg = new ImagickDraw(); /* Create a few random images */
$images = new Imagick( $paths ); /* Loop trough images, overlay on canvas and remove the image */
foreach ( $images as $key => $image )
{ /* Thumbnail to 100x width and set background to black. It looks like an drop-in shadow :) */ $image->thumbnailImage( 100, null );
$image->setImageBackgroundColor( new ImagickPixel( "black" ) );
/* Use a random angle */ $angle = mt_rand( 1, 45 );
if ( mt_rand( 1, 2 ) % 2 === 0 ) { $angle = $angle * -1; } /* Create the polaroid */ $image->polaroidImage( $bg, $angle );
/* Composite the polaroid over the canvas */ /* Composite to a random location */ $canvas->compositeImage( $image, Imagick::COMPOSITE_OVER, mt_rand( 10, 150 ), mt_rand( 10, 150 ) );
/* Free some resources */ $image->removeImage(); } /* Display the image */
header( "Content-Type: image/png" );
echo $canvas; ?>hata: error: Fatal error: Uncaught ImagickException: Can not process empty Imagick object in /home/kpsspuan/public_html/twitter/save.php:22 Stack trace: #0 /home/kpsspuan/public_html/twitter/save.php(22): Imagick->valid() #1 {main} thrown in /home/kpsspuan/public_html/twitter/save.php on line 22Arkadaşlar sizce bu hatayı nasıl aşarım eskiden bu kod çalışıyormuş sanırım çözemedim.
daha düzenli hali: https://paste.ofcode.org/xPtNtBqHB9MserTyvXcHUN