GraphicsMagick is a powerful tool for processing image files. I'm using MinGW to build GraphicsMagick for Windows.
zlib 1.2.7
Download the zlib source (zlib-1.2.7.tar.gz) and unpack it.
tar xzvf zlib-1.2.7.tar.gz
cd zlib-1.2.7Compile and install zlib.
make -f win32/Makefile.gcc
cp -iv zlib1.dll /mingw/bin
cp -iv zconf.h zlib.h /mingw/include
cp -iv libz.a /mingw/lib
cp -iv libz.dll.a /mingw/libbzip2
Now download bzip2 source from bzip.org and unpack it.
tar xzvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6Change line 78 of bzlib.h to read:
#if defined(_WIN32) && !defined(__MINGW32__)
Compile and install bzip2.
make
cp bzlib.h /mingw/include/
cp libbz2.a /mingw/libliblzma
Get the XZ Utils source code and unpack it. Go to the src/liblzma folder and compile liblzma like this:
tar xzvf xz-5.0.4.tar.gz
cd xz-5.0.4
./configure --prefix=/mingw
cd src/liblzma
make
make installlibpng 1.5.12 and libjpeg 8d
Compile libpng and libjpeg as follows:
./configure --prefix=/mingw
make
make installlibjasper
Compile Jasper:
./configure --prefix=/mingw
make
make installIf you encounter an error "undefined reference to _sleep", replace sleep() with _sleep with a factor of 1000 in the code:
_sleep(1000)
JBig
Get jbigkit from here.
make
cp libjbig/*.h /mingw/include
cp libjbig/*.a /mingw/liblibtiff 4.0.2
Compile libtiff like this:
./configure --prefix=/mingw
make
make installIf the shared library libtiff-5.dll is not generated and you want to create it manually, use such a command as the following and update libtiff.la accordingly:
gcc -shared -o libtiff-5.dll -Wl,--out-implib,libtiff.dll.a -Wl,--whole-archive /mingw/lib/libtiff.a -Wl,--no-whole-archive -L/mingw/lib -ljpeg -ljbig -llzma -lz
freetype
Compile freetype:
./configure --prefix=/mingw
make
make installlibxml2
Compile libxml2:
./configure --prefix=/mingw
make
make installlibwmf 0.2.8.4
Compile libwmf:
./configure --prefix=/mingw
make
make installLittle CMS
Compile liblcms:
./configure --prefix=/mingw
make
make installBuild GraphicsMagick
Get GraphicsMagick code and build it like this:
./configure --prefix=/mingw --with-gs-font-dir='C:/Windows/Fonts' --with-windows-font-dir='C:/Windows/Fonts' LIBS='-ljbig'
make
make install
Creating a PDF document from JPEG files
GraphicsMagick comes in handy when you want to convert scanned JPEG images to a PDF document:
gm convert *.jpg doc.pdf
No comments:
Post a Comment