Problems with using imagick with php

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
niclasp
Posts: 1
Joined: 2015-03-08T15:09:05-07:00
Authentication code: 6789

Problems with using imagick with php

Post by niclasp »

Hi together, I new in this forum. I tried to find a solution for my problem before on Google and the search-function.
My english is not the best, but I hope it's understandable.


I am programming on a document-manageing-system. Now every entry on the database should be displayed in a table with a small thumbnail from the file. All the files are .tif files and are about 100MB up to 1.6GB. The problem is not to get the informations from database to table, the problem is generating the thumbnail. Everytime I use imagick in php, nothing behind the usage shows up in browser. I think this was not understandable, here an example (PHP-Source-Code):

Code: Select all

<?php
//this part shows up in browser
header('Content-type: image/jpg');
$image = new Imagick('test.jpg');
$image->thumbnailImage(100, 0);

echo $image;

//this part doesn't show up
echo "test after using imagick";
?>
This is how the browser-source-code looks like:

Code: Select all

<body>
<img src="http://192.168.0.119/auftragsverwaltung_imagick/thumbnail.php" alt="http://192.168.0.119/auftragsverwaltung_imagick/thumbnail.php">
</body>
The IP-adress is my servers adresss, the folder, etc. are correct. It looks like only the converted picture is mentioned by the browser but nothing else. Even my php-comments are not displayed in the source-code in browser.

The system is ubuntu 14.10 and the ImageMagick version is 6.7.7-10. I've installed the Imagick-extension using

Code: Select all

sudo apt-get install php5-imagick
in the Linux-Terminal.

Did I do something wrong? It would be nice if someone could help me.
If there are some informations missing, just ask.

Thanks a lot, Niclas
Post Reply