Building portable ImageMagick ( I Guess static)
Posted: 2010-07-09T17:07:50-07:00
I need to Image magick ++ for converting BMP to JPG ( in memory)
So, first requirements that I need to fullfill is these...
1) There is no root priviliges
2) It must work by coping pasting to any other linux based system (on other system directory differs)
3) I need to support bmp to jpeg conversion
4) Settings environment variables is possible (like $MAGICK_HOME)
I done lot of googling and so else but still did not founded right way ( u could say that I am bit novice to linux)
So here what I got... this one worked for me until I tried copy pasteto other system:
http://studio.imagemagick.org/pipermail ... 16371.html // by that configuration everything worked fine there (also i unistalled previus version of magick image that have been before so it may be possilbe that jpeg conversion left from there)
so i made some code it worked...
but when i transferedeverything to other system... puted LD_LIBRAR_PATH and MAGICK_HOME variablesi got error:
terminate called after throwing an instance of 'Magick::ErrorMissingDelegate'
what(): Magick: no encode delegate for this image format `blog.jpg' @ error/constitute.c/WriteImage/1157
it is because it do not get jpeg delegates (coder/ modulers)... but they files are in the system (jpeg.so and all other kind stuff)...
so identity gives(but MOGRIFY WORKED FINE! in jpeg conversion):
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -fopenmp -g -O2 -Wall -pthread
CONFIGURE ./configure '--enable-shared' '--with-modules' '--with-quantum-depth=16' '--prefix=/home/audrius/libs/ImageMagick-6.6.3-0' '--exec-prefix=/home/audrius/libs/ImageMagick-6.6.3-0' '--disable-installed' '--enable-delegate-build'
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS -I/home/audrius/libs/ImageMagick-6.6.3-0/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES fontconfig freetype jpeg jng png x11 xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --disable-installed --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-perl=no
EXEC-PREFIX /home/audrius/libs/ImageMagick-6.6.3-0
HOST i686-pc-linux-gnu
LDFLAGS -L/home/audrius/libs/ImageMagick-6.6.3-0/lib -L/home/audrius/libs/ImageMagick-6.6.3-0/magick -L/home/audrius/libs/ImageMagick-6.6.3-0/wand
LIB_VERSION 0x663
LIB_VERSION_NUMBER 6,6,3,0
LIBS -lMagickCore -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lm -lgomp -lpthread -lltdl
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /home/audrius/libs/ImageMagick-6.6.3-0
QuantumDepth 16
RELEASE_DATE 2010-07-07
VERSION 6.6.3
WEBSITE http://www.imagemagick.org
we have to keep in mind that here variables like PREFIX are wrong, but if I set it correct in batch before launching program it should work just fine.... ( I used Eclipse to build program)
may be there is even way to make all those needed parts static and put to eclipse ... but i had trouble with that (all errors about references and other erorrs..)
i guess for command line (configuring) it should look like smth:
./configure --disable-shared --enable-delegate-build --with-quantum-depth=16 --prefix=`pwd` --exec-prefix=`pwd` --disable-installed
also by this line jpeg conversion will not be supported how to make this static???
any help will be highly appreciated!
also I will give feedback on this so many will can learn get something with it.
also code lines that use:
Blob blob( testPicture.str().c_str(), sizeof(HEADER)+2+size);
Image image( blob);
image.magick("JPEG");
image.write("blog.jpg");
everything compiles and worked on first linuxplatform
here workfine two if do just BMP writing with no compresion...
I guess thebest idea would be load jpeg delagate module from eclipse... But how ?
Really waiting for somehelp...
So, first requirements that I need to fullfill is these...
1) There is no root priviliges
2) It must work by coping pasting to any other linux based system (on other system directory differs)
3) I need to support bmp to jpeg conversion
4) Settings environment variables is possible (like $MAGICK_HOME)
I done lot of googling and so else but still did not founded right way ( u could say that I am bit novice to linux)
So here what I got... this one worked for me until I tried copy pasteto other system:
http://studio.imagemagick.org/pipermail ... 16371.html // by that configuration everything worked fine there (also i unistalled previus version of magick image that have been before so it may be possilbe that jpeg conversion left from there)
so i made some code it worked...
but when i transferedeverything to other system... puted LD_LIBRAR_PATH and MAGICK_HOME variablesi got error:
terminate called after throwing an instance of 'Magick::ErrorMissingDelegate'
what(): Magick: no encode delegate for this image format `blog.jpg' @ error/constitute.c/WriteImage/1157
it is because it do not get jpeg delegates (coder/ modulers)... but they files are in the system (jpeg.so and all other kind stuff)...
so identity gives(but MOGRIFY WORKED FINE! in jpeg conversion):
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -fopenmp -g -O2 -Wall -pthread
CONFIGURE ./configure '--enable-shared' '--with-modules' '--with-quantum-depth=16' '--prefix=/home/audrius/libs/ImageMagick-6.6.3-0' '--exec-prefix=/home/audrius/libs/ImageMagick-6.6.3-0' '--disable-installed' '--enable-delegate-build'
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS -I/home/audrius/libs/ImageMagick-6.6.3-0/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES fontconfig freetype jpeg jng png x11 xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --disable-installed --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-perl=no
EXEC-PREFIX /home/audrius/libs/ImageMagick-6.6.3-0
HOST i686-pc-linux-gnu
LDFLAGS -L/home/audrius/libs/ImageMagick-6.6.3-0/lib -L/home/audrius/libs/ImageMagick-6.6.3-0/magick -L/home/audrius/libs/ImageMagick-6.6.3-0/wand
LIB_VERSION 0x663
LIB_VERSION_NUMBER 6,6,3,0
LIBS -lMagickCore -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lz -lm -lgomp -lpthread -lltdl
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /home/audrius/libs/ImageMagick-6.6.3-0
QuantumDepth 16
RELEASE_DATE 2010-07-07
VERSION 6.6.3
WEBSITE http://www.imagemagick.org
we have to keep in mind that here variables like PREFIX are wrong, but if I set it correct in batch before launching program it should work just fine.... ( I used Eclipse to build program)
may be there is even way to make all those needed parts static and put to eclipse ... but i had trouble with that (all errors about references and other erorrs..)
i guess for command line (configuring) it should look like smth:
./configure --disable-shared --enable-delegate-build --with-quantum-depth=16 --prefix=`pwd` --exec-prefix=`pwd` --disable-installed
also by this line jpeg conversion will not be supported how to make this static???
any help will be highly appreciated!
also I will give feedback on this so many will can learn get something with it.
also code lines that use:
Blob blob( testPicture.str().c_str(), sizeof(HEADER)+2+size);
Image image( blob);
image.magick("JPEG");
image.write("blog.jpg");
everything compiles and worked on first linuxplatform
here workfine two if do just BMP writing with no compresion...
I guess thebest idea would be load jpeg delagate module from eclipse... But how ?
Really waiting for somehelp...