Configuring PNG on ImageMagick on a Linux Server - linux

I have been trying to run the following script on ImageMagick on a Linux server
convert resized.png -gravity Center -crop 1024X768+0+0 +repage flower.png
but have been hitting the following error:
convert: no decode delegate for this image format `PNG' # error/constitute.c/ReadImage/501.
convert: no images defined `flower.png' # error/convert.c/ConvertImageCommand/3212.
It looks like there is no delegate for PNG.
When I run:
identify -version
I get this result that shows that the PNG delegate is not installed:
Version: ImageMagick 6.9.0-4 Q16 x86_64 2015-01-25 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates (built-in): bzlib freetype jpeg lcms tiff x zlib
As far as I can tell I have 'libpng' installed on my server.
How do I configure the PNG delegate for ImageMagick on my Linux server?
I have 'yum' installed but not 'apt-get'.

I did a lot more searching and found this answer.
It looks like ImageMagick did not know what library to look for.
I did a
locate libpng
and found that it was located in
/usr/lib64/
I was then able to run the commands on this page (from within the ImageMagick directory):
http://www.imagemagick.org/discourse-server/viewtopic.php?t=12366
./configure --enable-shared
make libdir=/usr/lib64
make libdir=/usr/lib64 install
./configure --enable-shared=yes --x-libraries=/usr/lib64 --without-perl
make
make install
Then running
identify -version
showed the following results:
Version: ImageMagick 6.9.0-4 Q16 x86_64 2015-01-30
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates (built-in): bzlib freetype jng jpeg lcms png tiff x zlib
which shows that PNG is now installed as a delegate.

Related

How to compile php-memcached at PHP7.1 correct?

I would like installed PHP Memcached on my Operating System. You can find more informations about my system on following facts.
Operating system: Debian 8 (Jessie)
Architecture: armhf
Installed packages: memcached, php7.1-dev, build-essential,
pkg-config, make, git, g++, gcc, libmemcached-dev, libmsgpack-dev,
libmsgpackc2
PHP Version:
PHP 7.1.8-2+0~20170804100723.7+jessie~1.gbpae7f04 (cli) (built: Aug 11 2017 03:58:33) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.8-2+0~20170804100723.7+jessie~1.gbpae7f04, Copyright (c) 1999-2017, by Zend Technologies
PHP Packages
libapache2-mod-php7.1
php-common
php7.1
php7.1-cli
php7.1-common
php7.1-curl
php7.1-dev
php7.1-gd
php7.1-imap
php7.1-json
php7.1-mbstring
php7.1-mcrypt
php7.1-mysql
php7.1-opcache
php7.1-readline
php7.1-xml
php7.1-xmlrpc
php7.1-zip
PHP Modules
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
My error summary
FAILED TEST SUMMARY
---------------------------------------------------------------------
Memcached::getByKey() with CAS [tests/experimental/get_bykey_cas.phpt]
Memcached::getDelayedByKey() with CAS [tests/experimental/getdelayed_bykey_cas.phpt]
Memcached::getDelayedByKey() with callback exception [tests/experimental/getdelayed_cbthrows.phpt]
Memcached::getMulti() bad server [tests/experimental/getmulti_badserver.phpt]
Memcached::getStats() [tests/experimental/stats.phpt]
Memcached::getStats() with bad server [tests/experimental/stats_badserver.phpt]
=====================================================================
I think I forgot to install a library or an PHP package. But I don`t know which one?
You need more informations? No problem I can post the completely Logfile.
I hope you can help me to fix that special problem.

Is it possible to render multi-coloured emojis with ImageMagick?

I have a text that may contain emojis. I want to render it into JPEG image with RMagick (I can also use ImageMagick directly).
I was able to render only monochrome emojis with AndroidEmoji.ttf, but ImageMagick renders interrogation signs if I use AppleColorEmoji.ttf.
Here's how I do it:
require 'rmagick'
granite = Magick::ImageList.new('granite:')
canvas = Magick::ImageList.new
canvas.new_image(300, 100, Magick::TextureFill.new(granite))
input = "👠 👯👢 👣"
text = Magick::Draw.new
text.font = 'AppleColorEmoji.ttf'
text.pointsize = 20
text.gravity = Magick::CenterGravity
text.annotate(canvas, 0, 0, 0, 0, input)
canvas.write('result.jpg')
Is it possible to render coloured emojis with ImageMagick or is there another tool that can help?
You can use pango for text rendering (as of v6.7.6-3):
convert pango:'Hello! 😀How are you?' example.png
Produces this image (using v7.0.8-36)
See https://www.imagemagick.org/Usage/text/#pango for more details on how to use pango with ImageMagick
I'm on Ubuntu 18.04, using ImageMagick 7.0.8-36 (by compiling from source), which looks to have this configuration
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib djvu fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
And it looks like I'm using Pangocairo 1.40.14
$ convert -list format | grep -i pango
PANGO* r-- Pango Markup Language (Pangocairo 1.40.14)
I think you are out of luck... ImageMagick forum.
I suppose you could save all the glyphs as PNG files and append them together to make a "textspeak sentence"
convert smile.png StupidShoeThing.png arnie.png +append txtspeak.png

Node: building from source vs binary distribution

I have downloaded node 0.10.31 source and built on my Linux machine using same steps mentioned in wiki. The source is just as it is and no changes made at all. The build is successful but when I compare bin/node file size with the one from binary downloaded there is around 900kb difference (built from source is bigger).
What is the reason?
Did I miss any optimizer or special config? Actually I wanted to use locally build node (after some change) in production. I just don't want to miss some settings here.
My environment:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release: 6.5
Codename: Santiago
Note: Already posted in node.js groups, sorry for the cross post.
Thanks
You can try and strip out debugging symbols. E.g.,
$ strip node
Debugging symbols are pieces of information embedded in an object file, and useful for debugging purposes. Unfortunately, they take up space in the file, so if you do not plan debugging the node interpreter itself you could get rid of them.
Moreover, please check out strip's manual page for a full list of choices when discarding symbols from object files.

Building Pango with Cairo support

I'm attempting to build a new version of wireshark 1.10 on a RHEL5 box with the intent of making an RPM so that customers that I support can install it. Possibly others if I can find a place to host it.
WS1.10 depends on GTK+ as well as several other libraries that aren't supported by the available rpm packages. Therefore, I have to build them by hand. GTK+ needs pango(1.24.5) with cairo(1.8.8) support.
After having built and installed a newer version of cairo from source, a ./configure of pango gives the following error
checking for CAIRO... yes
checking which cairo font backends could be used... none
configure: Disabling cairo support
and then at the end ./configure displays
configuration:
backends: X
I can verify that Cairo is installed by looking at the pkg_config in my /usr/local/lib.
I've even taken a look at the pango config.log. But I don't see anything that is any different then the messages I copypasta'ed above.
What are some places I should be looking to figure out a less terse error message? I'm kind of at a loss troubleshooting this.
I encountered this issue today and solved it by installing HARFBUZZ, which is mentioned in the README file of Pango. After installation of Harfbuzz we have access to FreeType. So follow this procedure:
Build and install FreeType
Build and install fontconfig
Build and install Cairo (after ./configure please make sure freetype and fontconfig are found)
Build and install Harfbuzz
Build and install Pango
In case of you still have problems even though you are following the guideline of Xiao Jia, take care to look into config.log. It will help you to find out why the package does not find particular components on your system. In my case the fontconfig-devel and freetype-devel package from default repository of my distro was too old.
I could manage it by installing the whole stack into a location outside of /usr (not that difficult as it sounds) by adding configuration file to /etc/ld.so.conf.d and a environment expanding script to /etc/profile.d.

Error message converting PDF to JPG using imagemagick

Command:
convert small.pdf small.jpg
Output:
sh: gs: not found
convert: Postscript delegate failed `small.pdf': ZkQV.cache # error/pdf.c/ReadPDFImage/638.
convert: missing an image filename `small.jpg' # error/convert.c/ConvertImageCommand/2940.
Version:
Version: ImageMagick 6.6.0-4 2012-05-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
File used: http://www.relacweb.org/menuconferencia/menu/manual-memorias.pdf
On Linux.

Resources