identify and convert have different ImageMagick versions - ruby-on-rails

I am using Carrierwave for photo upload but the image resizing function doesn't work properly. So I spent about 6 hours trying to figure it our on google. I tried uninstalling and installing ImageMagick as it seems to be the root of the problem. This did not help. So I then checked the versions of "identify" and "convert" which are presumably two utilities that come with ImageMagick. They report different ImageMagick version number, as pasted below:
63c55b$ convert --version
Version: ImageMagick 6.7.3-2 2011-10-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
63c55b$ identify --version
Version: ImageMagick 6.6.2-6 2011-03-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
This is right after I installed ImageMagick from source using make install. I don't know how to upgrade the version for identify to match that of convert. Help is greatly appreciated!

Run these commands to find out the installation locations of your convert and identify binaries (I'm assuming you're on Linux or Mac OS X):
which convert
which identify
Should the directory for convert be different from that of identify: have a look if there is another identify in the same directory as convert.
If that doesn't help, try these commands to List the Dynamic Dependencies for each of the binaries:
ldd `which convert`
ldd `which identify`
(Dynamic dependencies are those libs that another lib or executable requires to load at runtime so it can run at all...) One of the two may be 'statically linked' (and hence list no dynamic dependencies at all).

Related

Possible to add imagick webp support for PHP in AWS Linux 2?

I'm running PHP 7.4 on an AWS Linux 2 instance. PHP 7.4 comes with imagick module 3.4.4 compiled by ImageMagick 6.9.10-6, but it doesn't have support for WEBP enabled.
I've installed the libwebp-devel library, but I can't figure out how to recompile the imagick module to support webp. I tried installing from the PECL source a la this comment, but when I check php -i WEBP still isn't listed under supported formats.
I also tried installing ImageMagick from source, and while I was able to get WEBP conversion going in the command line, the PHP extension still doesn't show support.
I'm not currently expert at PHP, but after reading this post Understanding PHP library installation and knowing some linux ecosystem, I think that after recompiling ImageMagick, you have to tell to the imagick module, that you have new version of ImageMagick. Or even recompile module (according to this site: https://help.dreamhost.com/hc/en-us/articles/217253537-Installing-ImageMagick-and-the-imagick-PHP-module-on-Shared-hosting).

How to get Imagemagick to use littlecms2 on WHM Centos 7

I have Imagemagick running fine. However it is missing the lcms2 library that lets it utilise icc color profiles.So it was installed via RPM and also with for different versions of PHP with the PECL php wrapper. I have installed lcms2 also from RPM.
However imagemagick doesn't know anything about lcms2.
How can I add lcms2 delegate/library to my current imagemagick install?
Do I have to make my own build of imagemagick with flags to include lcms2? I hear lcms was removed from the Centos Imagemagick RPM due to security concerns.

Installing moonscript via luarocks on Windows

When I try to install moonscript through luarocks, the process errors out in installing the dependencies for moonscript, saying that "cl" isn't an installed / recognized program.
C:\Users\Kingdaro>luarocks install moonscript
Installing http://luarocks.org/repositories/rocks/moonscript-0.2.4-1.src.rock...
Missing dependencies for moonscript:
lpeg >= 0.10, ~= 0.11
alt-getopt >= 0.7
7-Zip 9.10 beta Copyright (c) 1999-2009 Igor Pavlov 2009-12-22
Processing archive: lpeg-0.12.tar.gz
Extracting lpeg-0.12.tar
Everything is Ok
Size: 245760
Compressed: 66649
7-Zip 9.10 beta Copyright (c) 1999-2009 Igor Pavlov 2009-12-22
Processing archive: lpeg-0.12.tar
Extracting lpeg-0.12
Extracting lpeg-0.12\makefile
Extracting lpeg-0.12\HISTORY
Extracting lpeg-0.12\test.lua
Extracting lpeg-0.12\re.lua
Extracting lpeg-0.12\lpeg.html
Extracting lpeg-0.12\re.html
Extracting lpeg-0.12\lpeg-128.gif
Extracting lpeg-0.12\lptypes.h
Extracting lpeg-0.12\lpcap.h
Extracting lpeg-0.12\lpcap.c
Extracting lpeg-0.12\lpcode.h
Extracting lpeg-0.12\lpcode.c
Extracting lpeg-0.12\lpprint.h
Extracting lpeg-0.12\lpprint.c
Extracting lpeg-0.12\lptree.h
Extracting lpeg-0.12\lptree.c
Extracting lpeg-0.12\lpvm.h
Extracting lpeg-0.12\lpvm.c
Everything is Ok
Folders: 1
Files: 18
Size: 220385
Compressed: 245760
cl /MD /O2 -c -Folpcap.obj -IC:/Program Files (x86)/Lua/5.1/include lpcap.c
'cl' is not recognized as an internal or external command,
operable program or batch file.
Error: Failed installing dependency: http://luarocks.org/repositories/rocks/lpeg
-0.12-1.src.rock - Build error: Failed compiling object lpcap.obj
I'm not sure what to do here; I've been googling a solution for the past couple of days but couldn't find anything relevant. If it helps, I'm using the Lua 5.1.4 installation provided by Lua for Windows.
From MSDN:
cl.exe is a tool that controls the Microsoft C and C++ compilers and
linker. cl.exe can be run only on operating systems that support
Microsoft Visual Studio.
You should run luarocks install inside the Visual Studio Command Prompt.
I tried to install moonscript without Visual Studio and found that moonscript does not have a binary distribution.
Anyway, I found the binary package for each of moonscript's dependencies, the installation procedure is the follwing:
luarocks install lpeg 0.10-1 # this is the one that failed first
luarocks install luafilesystem 1.6.0-1 # this one failed after installing lpeg
But the following:
luarocks install moonscript
Can only be done within the Visual Studio Command Prompt unless you manually download a binary package.
cl is the compiler that is part of Visual Studio. That failure is happening because luarocks is attempting to build lpeg as a dependency. You either need to find a way to get luarocks to install a pre-built lpeg (which I assume it would have done if one existed in its database) or you need to get a copy of visual studio (I believe some versions are free).

Issue enabling HDRI for ImageMagick

I am installing ImageMagick on my server and upon entering the following config command:
./configure --enable-hdri
I get an output for the configuration that shows:
--enable-hdri=yes yes
But, when I try:
identify -version
Am am given:
Version: ImageMagick 6.6.0-4 2010-11-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
With HDRI missing from the Features section.
Anyone know what gives? Thanks!
You should run
which identify
to see where your called identify binary is located:
Is this really the one you have compiled and installed?
Or is it rather another one (which pre-dates your own build and which wasn't cleanly removed)?
You may be able to 'fix' this by tweaking your $PATH variable, or by calling the identify you really want with its full path...

phpThumb cannot find ImageMagick / Imagick

I'm having a problem with phpThumb. It says in the documentation that to get the best out of it, use ImageMagick / Imagick.
I've got this installed on the Server (running Centos 5.1), and can run convert --version and get the right info back. I can also run which convert which returns /usr/bin/convert
However, phpThumb can't location the convert program - the demo's show that:
(requires ImageMagick, this server is running "n/a" so it will not work)
Does anyone have any pointers on how to fix this?
Cheers,
Matt
ImageMagick changed the way it reports the version, and phpThumb no longer recognizes the version info.
From:
Version: ImageMagick 6.3.7 06/04/09
Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008
ImageMagick Studio LLC
To:
Version: ImageMagick 6.6.2-6
2010-12-02 Q16
http://www.imagemagick.org Copyright:
Copyright (C) 1999-2010 ImageMagick
Studio LLC
There are now DASHES in the version! This is a simple fix, open phpthumb.class.php
look for the line:
if (eregi('^Version: [^0-9]*([ 0-9\\.\\:Q/]+) (http|file)\:', $versionstring[1], $matches)) {
Simply add a dash '-' after the Q/ and it will work. New line:
if (eregi('^Version: [^0-9]*([ 0-9\\.\\:Q/-] (http|file)\:', $versionstring[1], $matches)) {
Have you checked phpinfo() to make sure imagick is installed? If not, you will need to install it.
ImageMagick Install Instructions
The problem with phpThumb is often not a missing ImageMagick problem, but a problem with access to the exec function, because phpThumb is using binaries (convert) to create thumbnails. Make sure You have seen this http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=phpThumb and http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-1598

Resources