Fatal Error: This(D:\WINDOWS\TEMP\php41.tmp)is not an image file. but I did not find where I defined tmp_name and why it is always "D:\WINDOWS\TEMP\php41.tmp" or php"whatevernumber".tmp.
1)
$image = new ImageMagick($_FILES['upload']['tmp_name']);
2) ImagMagic
var $imageMagickPath = 'd:/program files/ImageMagick-5.5.7-Q16/';
function ImageMagick()
{
if (func_num_args() == 1) {
if (@file_exists(func_get_arg(0))) {
$this->ImageProperties(func_get_arg(0));
}
else {
$filename = func_get_arg(0);
$this->Error
(2,'Fatal error trying to use file "'.$filename.'": file
does not exist or has wrong permissions to be accessed');
}
}
elseif(func_num_args() == 0) {
}
else {
$this->Error
(2,"Fatal error invoking class ImageMagick: we may use a maximum of one argument (an image filename) when
invoking this class");
}
} // ImageMagick()
function ImageProperties($image)
{
if (file_exists($this->imageName)) {
$this->imageName = $image;
++++ something wrong here ??Can help???
$identify = $this->Exec("identify $this->imageName");
$match = '#'.preg_quote($this->imageName).' (.+) (\d+)x(\d+) (\w+) (.+) (\d+)[b|kb|mb]#';
preg_match($match, $identify, $matches);
if(sizeOf($matches) != 7){
// print "Size of matches is". sizeOf($matches). "<br>";
echo sizeOf($matches);
echo 'hjhjhjh';
$this->error(2,"This($this->imageName)is not an image file.");
}
$this->imageType = $matches[1];
$this->imageWidth = $matches[2];
$this->imageHeight = $matches[3];
$this->imageClass = $matches[4];
$this->imageBits = $matches[5];
$this->imageBytes = $matches[6];
unset($match);
unset($identify);
} else {
$this->error(2,"File $this->imageName doesnot exists");
============================================??????
}
} // ImageProperties()