Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

This is a discussion on How do I install Imagemagick? in the Shared & Semi-Dedicated forum
My buddy and I are trying something that requires calls to imagemagick. I've search for it but I did not see anything current. If so: ...

  1. #1
    Squeegy Boy TeeJay's Avatar
    Join Date
    Feb 2002
    Location
    Nueva Ecija
    Posts
    147

    How do I install Imagemagick?

    My buddy and I are trying something that requires calls to imagemagick. I've search for it but I did not see anything current.
    If so:
    1.) Is this an old application? What is a comparable program?
    2.) Is this supported on a shared server? I'm on adrastea and I did not see it in my own home directory usr/bin
    3.) Am I allowed to install it myself or do I open a support ticket to have it installed for me?

  2. #2
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    Did you try typing:

    Code:
    whereis mogrify
    Or

    Code:
    whereis convert
    Or

    Code:
    man mogrify
    For more information about the mogrify command, point your browser to
    file:///usr/share/doc/ImageMagick-6.4.0/www/mogrify.html
    or
    http://www.imagemagick.org/script/mogrify.php
    Overview:
    http://www.imagemagick.org/script/index.php
    Last edited by Ron; 06-02-2009 at 11:42 PM.
    Good luck

  3. #3
    JPC Dream Team
    Join Date
    Mar 2009
    Posts
    925
    ImageMagick is installed in adrastea.

    -------------
    root@adrastea [~]# /usr/bin/convert --version
    Version: ImageMagick 6.4.0 04/22/08 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
    -------------

    Please open a ticket if you need any assistance on this.

    Regards,
    Anoop | Support Dept.
    JaguarPC.com

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    As Ron sort of pointed out, there is no "ImageMagick" program. It is, instead, a package of several small programs used to do various types of image manipulation. The program most commonly used by scripts is the one called "mogrify," so a good way to check in ImageMagick is installed is to type "which mogrify" on the command line.

    There are several similar, but not directly compatible, command line image manipulation tools out there. Among the more common ones are GD (which is technically a library, though support for it is built into PHP and there are command line tools like fly that use it) and Netpmb.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  5. #5
    Squeegy Boy TeeJay's Avatar
    Join Date
    Feb 2002
    Location
    Nueva Ecija
    Posts
    147
    Thanks for all the replies, guys. I performed "whereis mogrify" command, and it returned the following paths:

    /usr/bin/mogrify /usr/share/man/man1/mogrify.1.gz /usr/share/man/man1/mogrify.1

    So ImageMagick is under /usr/bin directory. The part that I am having trouble with is this error I got when trying out a PHP test script that contains only this code:

    <?php
    $canvas = new Imagick();
    ?>

    The error is:

    Fatal error: Cannot instantiate non-existent class: imagick in /home/domain_name/public_html/test.php on line 2

    It seems like I am not pointing to the right directory path, so the Imagick() class is not known. Is there any way I can provide a path to ImageMagick (i.e. /usr/bin) inside the script? Am I heading in the right direction?

    Many thanks!

  6. #6
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    You are trying to access the ImageMagick extension for PHP. It isn't a normal part of the PHP distribution (in fact, I had never heard of it until about a week ago) and is therefore not included in JPC's standard PHP distribution. If you ask support they may be willing to install it for you. Ask them if they will install the "imagick extension from pecl" and hopefully they'll know what you're talking about.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  7. #7
    Squeegy Boy TeeJay's Avatar
    Join Date
    Feb 2002
    Location
    Nueva Ecija
    Posts
    147

    Thumbs up

    Thanks, Jason. Before I contact support to install PECL extension, is there any way I can run ImageMagick as is, e.g. bash scripts? Basically I want to create a web front-end to allow users to manipulate their images. PHP first came to mind since it is logical to process these commands on the server side. That is how I found out about Imagick() class. I would do it without PECL if there are other ways to access the ImageMagick commands. Thanks again.

  8. #8
    Not A Senior Member homoludens's Avatar
    Join Date
    Sep 2005
    Location
    H-Town
    Posts
    582
    Is there a particular reason why you need Imagemagick over GD2? There's (probably) a bunch of image manipulation classes that use GD2 on phpclasses.org if you need something to do some of the heavy lifting for you.

  9. #9
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    The most common way to do it is to call the command line programs from within PHP. See this section of the PHP manual for everything you need to know about doing this. Pay clase attention to the section on escaping shell argumetns (escapeshellarg) so that you don't open yourself up to any security breeches.

    Lots of PHP scripts use ImageMagick this way, so you should be able to find examples. Like I said, I didn't even know the extension/object existed until about a week ago when I was doing some image manipulation work of my own and I was looking up one of the GD functions in the PHP Manual and noticed the inclusion.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  10. #10
    Squeegy Boy TeeJay's Avatar
    Join Date
    Feb 2002
    Location
    Nueva Ecija
    Posts
    147

    Wink

    I am new to the image manipulation programs. I read from other forums, and people seem to prefer imagemagick over GD due to batch processing speed and overall picture quality. Has GD2 has been improved over GD?

    From another forum, I just found out that I could call 'exec' command from my php script to issue imagemagick commands. Below is a simple example for those interested:

    <?php
    echo exec("convert -size '1024x512' gradient:snow-CornflowerBlue gradient.jpg");
    ?>

    This will do the trick for now. One thing I am not sure is the security implication - if there is any - by calling 'exec' directly from the script.

    Thank you for all your help! Appreciate it.

  11. #11
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    I was just doing some simple resizing to make thumbnails. I didn't care too much about quality, so I went with GD because it was easiest to use in my environment. I have heard ImageMagick is superior, but to be honest, I do so little with image manipulation, I've never worried about it.

    The only security implication with calling exec() is being aware of what you pass to it. If you need to pass user-provided arguments to an exec command, just be sure to escape those values (using escapeshellargs() and I mentioned previously) and you should be fine.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  12. #12
    Not A Senior Member homoludens's Avatar
    Join Date
    Sep 2005
    Location
    H-Town
    Posts
    582
    As far as I understand IM has more shiny, cool stuff, but GD is better in most other respects. I recall benchmarks suggesting that GD was substantially faster than IM for resizing, etc, so if you really care about resources you might want to look into that.

    Ultimately, it's like nix / windows / mac / whatever. Whatever tool suits you best.

    I do so little with image manipulation, I've never worried about it.
    Same. A few thumbnails with some fancy cropping is all I ever do in terms of images. And I found that shockingly easy to do with GD and PHP.

  13. #13
    Not A Senior Member homoludens's Avatar
    Join Date
    Sep 2005
    Location
    H-Town
    Posts
    582
    It seems a few people are complaining about IM not having a stable enough API. If you get bored, you might want to check out, GraphicsMagick (a fork) which has a stable API and claims to be much faster.

    Flickr use it, apparently. Although I suspect they really use a secret army of b3tans.

  14. #14
    Yeah, I know a LOT! VinDSL's Avatar
    Join Date
    Mar 2009
    Location
    Arizona Uplands Intelligence Quotient: 138+
    Posts
    46
    Odd!

    I'm an ImageMagick fanboi from way back! It rawks!

    I used ImageMagick on JagPC, well before it was officially sanctioned, by uploading pre-compiled files to the server.

    I also use ImageMagick on my desktop machines, and personal web server, here at the abode.

    The reason I say this is odd...

    I just updated my local install(s). There was a SECURITY UPDATE on 1-June!

    http://secunia.com/advisories/35216/ (ImageMagick "XMakeImage()" Integer Overflow Vuln)

    If you're running ImageMagick, I highly recommend that you update it ASAP!

    http://www.imagemagick.org/script/binary-releases.php (ImageMagick Binaries)

    Hrm...

    I wonder if I should mention this to Tech Support. I'll go check the version on 'my server'...

    Whoops!

    Code:
    Version: ImageMagick 6.4.0 04/22/08 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
    Current ver: ImageMagick 6.5.3
    Last edited by VinDSL; 06-05-2009 at 12:20 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2009

  15. #15
    JPC Dream Team JPC-Tracie's Avatar
    Join Date
    Oct 2007
    Posts
    390
    Rizwan is looking into this.
    ~Tracie

    Director of Client Operations
    JaguarPC.com

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •