DJ Mike's Tutorials: PHP

ImageMagick Functions

^

Imagick::ReadImage

Description:
bool Imagick::readImage ( string $filename )

Reads image from filename.
Parameters:
fileName: String representing the file name. ReadImage() only works for files in your own web site. To use external files, see ReadImageFile()
Return Values
Returns TRUE on success.

Example


jpeg

gif


<?php
# Change a JPEG to a GIF
$url "opossum.jpg";
# Create Imagick object
$image = new Imagick(); 
# Read the file resource
$image->readimage($url);
# Change the format
$image->setimageformat("gif");
# Make correct headers for new format.
header("Content-type: image/gif");
# Send Image to browser
echo $image;
?> 


^


Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>