Jump to content


Photo

Imagick Installation In The Server


  • Please log in to reply
17 replies to this topic

#1 codename25

codename25

    Rank II Member

  • Members
  • PipPip
  • 71 posts

Posted 02 January 2017 - 10:22 AM

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.



#2 Byron

Byron

    Rank X Member

  • Root Admin
  • 6,854 posts
  • Gender:Male
  • Location:USA

Posted 02 January 2017 - 12:30 PM

It should be working for PHP Version 5.4.45 on Tommy.


Heliohost Signup Monitor: http://bybyron.net/helio/sign-up.php


#3 codename25

codename25

    Rank II Member

  • Members
  • PipPip
  • 71 posts

Posted 11 January 2017 - 04:58 PM

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.



#4 Byron

Byron

    Rank X Member

  • Root Admin
  • 6,854 posts
  • Gender:Male
  • Location:USA

Posted 11 January 2017 - 05:44 PM

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;
?>

Heliohost Signup Monitor: http://bybyron.net/helio/sign-up.php


#5 wolstech

wolstech

    Rank X Member

  • Support Admin
  • 3,910 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 11 January 2017 - 07:00 PM

 

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.



#6 Byron

Byron

    Rank X Member

  • Root Admin
  • 6,854 posts
  • Gender:Male
  • Location:USA

Posted 11 January 2017 - 07:34 PM

Your code also works fine on my site with php version 5.4.45


Heliohost Signup Monitor: http://bybyron.net/helio/sign-up.php


#7 codename25

codename25

    Rank II Member

  • Members
  • PipPip
  • 71 posts

Posted 12 January 2017 - 07:04 AM

 

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?



#8 wolstech

wolstech

    Rank X Member

  • Support Admin
  • 3,910 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 12 January 2017 - 12:47 PM

http://tommy.helioho...ager/index.html



#9 codename25

codename25

    Rank II Member

  • Members
  • PipPip
  • 71 posts

Posted 12 January 2017 - 06:21 PM

 

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? 



#10 wolstech

wolstech

    Rank X Member

  • Support Admin
  • 3,910 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 12 January 2017 - 07:21 PM

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.



#11 codename25

codename25

    Rank II Member

  • Members
  • PipPip
  • 71 posts

Posted 14 January 2017 - 09:21 AM

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

 

img1.png

 

 

 

This one is the Converted Image

 

img2.png



#12 Byron

Byron

    Rank X Member

  • Root Admin
  • 6,854 posts
  • Gender:Male
  • Location:USA

Posted 14 January 2017 - 02:19 PM

Escalating to Krydos. Is Ghostscript installed on Tommy? https://www.ghostscript.com/


Heliohost Signup Monitor: http://bybyron.net/helio/sign-up.php


#13 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 10,594 posts
  • Gender:Not Telling

Posted 14 January 2017 - 05:20 PM

PHP Version:
http://krydos.helioh.../54/phpinfo.php

Input:
http://krydos.helioh.../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.helioh.../pdf-sample.png

I shrank the pdf a bit to make the image and it still looks pretty sharp to me.

#14 codename25

codename25

    Rank II Member

  • Members
  • PipPip
  • 71 posts

Posted 15 January 2017 - 06:53 AM

PHP Version:
http://krydos2.helio.../54/phpinfo.php

Input:
http://krydos2.helio.../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.helio.../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.



#15 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 10,594 posts
  • Gender:Not Telling

Posted 15 January 2017 - 06:58 AM

vamdesign.tk/img2.png

Oh, I just assumed you wanted .png since your example was a .png.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users