Imagick::setImageFilename


wizard apg

SETS the filename of a particular image.



<?php

bool 
public Imagick::setImageFilename(
                                                 
string $filename
                                                                           
);

?>

$filename


The filename where to write the image.





This function returns a TRUE on success.



  1 EXERCISE   

<?php

$origname 
PATH2IMGW '/bmp/3.bmp';

$newname PATH2IMGL '/results/3new.bmp';
  
$imagick = new Imagick($origname);

$imagick->setImageFilename('3new.bmp');
$name $imagick->getImageFilename();
echo 
$name;

$imagick->writeImage($newname);

?>

 RESULT   


3new.bmp

img/results/3new.bmp apr

  2 EXERCISE   

<?php

$origname2 
PATH2IMGW '/png/E 01 01.png';

$newname2 PATH2IMGL '/results/E 01 01new.jpg';
  
$imagick = new Imagick($origname2);

$imagick->setImageFilename('E 01 01new.jpg');
$name $imagick->getImageFilename();
echo 
$name;

$imagick->writeImage($newname2);

?>


E 01 01new.jpg

img/results/E 01 01new.jpg apr