I have following php code in a file:
$figloc = $_GET['figrl'];
try
{
$image = new Imagick($figloc);
$image->setImageFormat("jpg");
$image->setImageColorSpace(5);
$image->writeImage("temp.jpg");
}
catch(Exception $e)
{
echo $e->getMessage();
}
and a jquery script like this:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function() {
figurelocation='temp.jpg';
var fightmlstring='<img src=\"'+figurelocation+'\">';
$('.figuredisplay').append(fightmlstring);
});
figuredisplay is a div element. $figloc value is the absolute address of the image on disk, like '/home/abc/def/ghi/jkl.tiff'. The php file, when opened from appropriate link, shows the error message "imagick unable to open file /home/abc/def/ghi/jkl.tiff". Can the absolute address cause a problem?
Also, when I copied a particular tiff file to my directory, to see if the absolute address was a problem, imagick possessedly read that file, but failed to create temp.jpg
unable to open image `/var/www/temp.jpg @ error/blob.c/OpenBlob/2489
Can anyone point me what I am doing wrong?