codename25 Posted January 2, 2017 Posted January 2, 2017 Hi, I moved from Stevie to Tommy recently but some of my scripts are not working. After checking, I found that Imagick is missing from the server. I would like to know whether Imagick had been installed on the server. Thank you.
Byron Posted January 2, 2017 Posted January 2, 2017 It should be working for PHP Version 5.4.45 on Tommy.
codename25 Posted January 11, 2017 Author Posted January 11, 2017 It should be working for PHP Version 5.4.45 on Tommy. But my script is not working showing error 500, also when checked it seemed Imagick is not installed. My code is as below: $im = new Imagick(); $im->pingImage('abc.pdf'); $page=$im->getNumberImages(); This was working fine in Stevie. Please help me.
Byron Posted January 11, 2017 Posted January 11, 2017 This works for me: <?php $blob = file_get_contents("http://url-of-pdf.pdf"); $image = new imagick(); $image->readImageBlob($blob); $image_count = $image->getNumberImages(); echo $image_count; ?>
wolstech Posted January 11, 2017 Posted January 11, 2017 It should be working for PHP Version 5.4.45 on Tommy. But my script is not working showing error 500 Also, aside from trying Byron's code, did you change the PHP version? Tommy uses 5.6 by default, which I don't believe has Imagick.
Byron Posted January 11, 2017 Posted January 11, 2017 Your code also works fine on my site with php version 5.4.45
codename25 Posted January 12, 2017 Author Posted January 12, 2017 This works for me: <?php $blob = file_get_contents("http://url-of-pdf.pdf"); $image = new imagick(); $image->readImageBlob($blob); $image_count = $image->getNumberImages(); echo $image_count; ?> Still showing the Error 500. I changed my code and used This code but it's not working too. It should be working for PHP Version 5.4.45 on Tommy. But my script is not working showing error 500 Also, aside from trying Byron's code, did you change the PHP version? Tommy uses 5.6 by default, which I don't believe has Imagick. The PHP version is 5.6.24. I too doubt magick is not installed when I checked. How should i change it to 5.4?
wolstech Posted January 12, 2017 Posted January 12, 2017 http://tommy.heliohost.org:2082/frontend/paper_lantern/multiphp_manager/index.html
codename25 Posted January 12, 2017 Author Posted January 12, 2017 http://tommy.heliohost.org:2082/frontend/paper_lantern/multiphp_manager/index.html Thank you for the reply, I have changed all my domains to php54, But my server information is still showing php 5.6. Does it take time to initiate on my account?
wolstech Posted January 12, 2017 Posted January 12, 2017 It will always show the primary version as 5.6. As long your domains are set to 5.4, the scripts on those domains should run under 5.4. It should take effect nearly instantly.
codename25 Posted January 14, 2017 Author Posted January 14, 2017 It will always show the primary version as 5.6. As long your domains are set to 5.4, the scripts on those domains should run under 5.4. It should take effect nearly instantly. Hi, It's working fine now. But there is a problem, the converted image from pdf is blotted. I'll attach the image of both the original PDF(Img1) and the Converted image (Img2). Could you please suggest me any reason for this because in Stevie it was working fine. This One is Original PDF This one is the Converted Image
Byron Posted January 14, 2017 Posted January 14, 2017 Escalating to Krydos. Is Ghostscript installed on Tommy? https://www.ghostscript.com/
Krydos Posted January 14, 2017 Posted January 14, 2017 PHP Version:http://krydos.heliohost.org/54/phpinfo.php Input:http://krydos.heliohost.org/54/pdf-sample.pdf Code:<?php $myurl = "pdf-sample.pdf"; $image = new Imagick($myurl); $image->setResolution(300, 300); $image->setImageFormat("png"); $image->writeImage("pdf-sample.png"); Output:http://krydos.heliohost.org/54/pdf-sample.png I shrank the pdf a bit to make the image and it still looks pretty sharp to me.
codename25 Posted January 15, 2017 Author Posted January 15, 2017 PHP Version:http://krydos2.heliohost.org/54/phpinfo.php Input:http://krydos2.heliohost.org/54/pdf-sample.pdf Code: <?php $myurl = "pdf-sample.pdf"; $image = new Imagick($myurl); $image->setResolution(300, 300); $image->setImageFormat("png"); $image->writeImage("pdf-sample.png"); Output:http://krydos2.heliohost.org/54/pdf-sample.png I shrank the pdf a bit to make the image and it still looks pretty sharp to me. The problem is converting to JPG is creating blotting. If converted to PNG it is OK.
Krydos Posted January 15, 2017 Posted January 15, 2017 vamdesign.tk/img2.pngOh, I just assumed you wanted .png since your example was a .png.
Recommended Posts