轉自:http://elf8848.iteye.com/blog/1708994
GraphicsMagick資料
----------------------------------------------------------------------------
GraphicsMagick官網 http://www.graphicsmagick.org
GraphicsMagick編程接口 http://www.graphicsmagick.org/programming.html
ImageMagick 程序接口 http://www.imagemagick.org/api/MagickCore/
Im4java 下載地址:http://sourceforge.net/projects/im4java/files/
IM4JAVA+GraphicsMagick處理網站圖片 http://javantsky.iteye.com/blog/747807
GraphicsMagick 實時、動態縮圖
----------------------------------------------------------------------------
Nginx,L ua_nginx,GraphicsMagick 靈活自定義縮略圖片尺寸大小方案分享
http://www.iteye.com/topic/1125126
nginx + lua + GraphicsMagick 動態生成指定大小縮圖
http://www.chinaz.com/web/2012/0903/272395.shtml
Mac OS x 安裝 GraphicsMagick
----------------------------------------------------------------------------
安裝依賴庫,參考:ImageMagick +Jmagick安裝
安裝jpeg包
----------------
brew install libjpeg
安裝在了/usr/local/Cellar/jpeg/8d
安裝jasper包
----------------
brew install jasper
安裝在/usr/local/Cellar/jasper/1.900.1
安裝libpng
----------------
由於是Mac ,所以使用brew包管理器,快速安裝
rew install libpng
安裝在了/usr/local/Cellar/libpng/1.5.13
安裝freetype包
----------------
brew install freetype
安裝在了/usr/local/Cellar/freetype/2.4.10
安裝zlib包
----------------
系統自帶不用安裝了
自動安裝GraphicsMagick
----------------
自動安裝:brew install GraphicsMagick
安裝在了/usr/local/Cellar/graphicsmagick/1.3.17
查看安裝信息:
zhaorai@zhaomatoMacBook-Pro lib$ gm -version
- GraphicsMagick 1.3.17 2012-10-13 Q8 http://www.GraphicsMagick.org/
- Copyright (C) 2002-2012 GraphicsMagick Group.
- Additional copyrights and licenses apply to this software.
- See http://www.GraphicsMagick.org/www/Copyright.html for details.
- Feature Support:
- Thread Safe yes
- Large Files (> 32 bit) yes
- Large Memory (> 32 bit) yes
- BZIP yes
- DPS no
- FlashPix no
- FreeType yes
- Ghostscript (Library) no
- JBIG no
- JPEG-2000 yes
- JPEG yes
- Little CMS no
- Loadable Modules no
- OpenMP no
- PNG yes
- TIFF no
- TRIO no
- UMEM no
- WMF no
- X11 no
- XML yes
- ZLIB yes
- Host type: x86_64-apple-darwin11.4.2
- Configured using the command:
- ./configure '--disable-dependency-tracking' '--prefix=/usr/local/Cellar/graphicsmagick/1.3.17'
- '--enable-shared' '--disable-static' '--disable-openmp' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts'
- '--without-x' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'
- 'LDFLAGS=-L/usr/local/lib -F/usr/local/Frameworks -L/usr/X11/lib' 'CPPFLAGS=-F/usr/local/Frameworks -I/usr/X11/include'
- 'CXX=/usr/bin/llvm-g++' 'CXXFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'
- Final Build Parameters:
- CC = /usr/bin/llvm-gcc -std=gnu99
- CFLAGS = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -Wall -D_THREAD_SAFE
- CPPFLAGS = -F/usr/local/Frameworks -I/usr/X11/include -I/usr/local/Cellar/freetype/2.4.10/include/freetype2 -I/usr/include/libxml2
- CXX = /usr/bin/llvm-g++
- CXXFLAGS = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -D_THREAD_SAFE
- LDFLAGS = -L/usr/local/lib -F/usr/local/Frameworks -L/usr/X11/lib -L/usr/local/Cellar/freetype/2.4.10/lib -L/usr/lib
- LIBS = -lfreetype -ljasper -ljpeg -lpng15 -lbz2 -lxml2 -lz -lm -lpthread
* –prefix=/opt/local 讓ImageMagick/GraphicsMagick與MacPorts的庫文件安裝到同一個目錄。
如果你想要安裝到其它目錄,則輸入不同的目錄路徑,如果不聲明–prefix,默認會將其安裝到/usr/local。
* –disable-static和–with-modules使得ImageMagick/GraphicsMagick以動態鏈接庫的方式安裝,
現在安裝ImageMagick/GraphicsMagick只是爲了在Ruby中使用,所以我用–without-perl和–without-magick-plus-plus以免去安裝Perl和C++的支持
* –with-quantum-depth=8配置ImageMagick使用8位的色深。默認是16位。參與RMagick Hints & Tips Forum論壇中的討論Speed up your RMagick apps in 1 easy step瞭解這個選項有什麼作用。
* –with-gs-font-dir=/opt/local/share/ghostscript/fonts讓ImageMagick/GraphicsMagick知道Ghostscript字體安裝在哪個角落裏。
如果你某個目錄裏有“標準”的windows TrueType字體,也可以設置–with-windows-font-dir=選項讓ImageMagick/GraphicsMagick使用它們。
查看ImageMagick/GraphicsMagick的README.txt文件瞭解更多選項的信息。
手動安裝GraphicsMagick
----------------------
手動安裝
下載地址 ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/
tar zvxf GraphicsMagick-1.3.17.tar.gz
cd GraphicsMagick-1.3.17
./configure CC=clang --prefix=/usr/local/GraphicsMagick-1.3.17 --with-quantum-depth=16 --enable-shared --enable-static
make
make install
注意confiure命令後面的CC=clang。它指定了編譯器爲Mac下推薦使用的clang。如果沒有這個參數,Makefile將會使用系統默認的編譯器進行編譯,而這個編譯器不是GraphicsMagic所推薦的,並且在make的過程中會出現以下錯誤:
- Undefined symbols for architecture x86_64:
- "___builtin_object_size", referenced from:
- _BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)
- _XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
- _YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
- ld: symbol(s) not found for architecture x86_64
- collect2: ld returned 1 exit status
- make[1]: *** [utilities/gm] Error 1
- make: *** [all] Error 2
- ----------
- ld: symbol(s) not found for architecture x86_64
- collect2: ld returned 1 exit status
- make[1]: *** [magick/libGraphicsMagick.la] Error 1
- make: *** [all] Error 2
最後還是有錯,未成功。
(可參考上面“自動安裝”時的的./configure設置編譯器,應該會成功)
手動安裝的配置信息:
Windows 上安裝GM
----------------------------------------
1、安裝:略
2、信息
常用管理命令
--------------------------------------------------------------------------------------------
查看版本後安裝情況:gm identify -version
結果::打印出信息
識別圖片:gm identify /Users/zhaorai/Pictures/照片/100CANON-1/IMG_4108.JPG
結果:/Users/zhaorai/Pictures/照片/100CANON-1/IMG_4108.JPG JPEG 3648x2736+0+0 DirectClass 8-bit 2.5M 0.000u 0:01
識別圖片(高級):gm identify -verbose /Users/zhaorai/Desktop/4.png
結果:打印出很多信息。
GraphicsMagick資料
----------------------------------------------------------------------------
GraphicsMagick官網 http://www.graphicsmagick.org
GraphicsMagick編程接口 http://www.graphicsmagick.org/programming.html
ImageMagick 程序接口 http://www.imagemagick.org/api/MagickCore/
Im4java 下載地址:http://sourceforge.net/projects/im4java/files/
IM4JAVA+GraphicsMagick處理網站圖片 http://javantsky.iteye.com/blog/747807
GraphicsMagick 實時、動態縮圖
----------------------------------------------------------------------------
Nginx,L ua_nginx,GraphicsMagick 靈活自定義縮略圖片尺寸大小方案分享
http://www.iteye.com/topic/1125126
nginx + lua + GraphicsMagick 動態生成指定大小縮圖
http://www.chinaz.com/web/2012/0903/272395.shtml
Mac OS x 安裝 GraphicsMagick
----------------------------------------------------------------------------
安裝依賴庫,參考:ImageMagick +Jmagick安裝
安裝jpeg包
----------------
brew install libjpeg
安裝在了/usr/local/Cellar/jpeg/8d
安裝jasper包
----------------
brew install jasper
安裝在/usr/local/Cellar/jasper/1.900.1
安裝libpng
----------------
由於是Mac ,所以使用brew包管理器,快速安裝
rew install libpng
安裝在了/usr/local/Cellar/libpng/1.5.13
安裝freetype包
----------------
brew install freetype
安裝在了/usr/local/Cellar/freetype/2.4.10
安裝zlib包
----------------
系統自帶不用安裝了
自動安裝GraphicsMagick
----------------
自動安裝:brew install GraphicsMagick
安裝在了/usr/local/Cellar/graphicsmagick/1.3.17
查看安裝信息:
zhaorai@zhaomatoMacBook-Pro lib$ gm -version
- GraphicsMagick 1.3.17 2012-10-13 Q8 http://www.GraphicsMagick.org/
- Copyright (C) 2002-2012 GraphicsMagick Group.
- Additional copyrights and licenses apply to this software.
- See http://www.GraphicsMagick.org/www/Copyright.html for details.
- Feature Support:
- Thread Safe yes
- Large Files (> 32 bit) yes
- Large Memory (> 32 bit) yes
- BZIP yes
- DPS no
- FlashPix no
- FreeType yes
- Ghostscript (Library) no
- JBIG no
- JPEG-2000 yes
- JPEG yes
- Little CMS no
- Loadable Modules no
- OpenMP no
- PNG yes
- TIFF no
- TRIO no
- UMEM no
- WMF no
- X11 no
- XML yes
- ZLIB yes
- Host type: x86_64-apple-darwin11.4.2
- Configured using the command:
- ./configure '--disable-dependency-tracking' '--prefix=/usr/local/Cellar/graphicsmagick/1.3.17'
- '--enable-shared' '--disable-static' '--disable-openmp' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts'
- '--without-x' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'
- 'LDFLAGS=-L/usr/local/lib -F/usr/local/Frameworks -L/usr/X11/lib' 'CPPFLAGS=-F/usr/local/Frameworks -I/usr/X11/include'
- 'CXX=/usr/bin/llvm-g++' 'CXXFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'
- Final Build Parameters:
- CC = /usr/bin/llvm-gcc -std=gnu99
- CFLAGS = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -Wall -D_THREAD_SAFE
- CPPFLAGS = -F/usr/local/Frameworks -I/usr/X11/include -I/usr/local/Cellar/freetype/2.4.10/include/freetype2 -I/usr/include/libxml2
- CXX = /usr/bin/llvm-g++
- CXXFLAGS = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -D_THREAD_SAFE
- LDFLAGS = -L/usr/local/lib -F/usr/local/Frameworks -L/usr/X11/lib -L/usr/local/Cellar/freetype/2.4.10/lib -L/usr/lib
- LIBS = -lfreetype -ljasper -ljpeg -lpng15 -lbz2 -lxml2 -lz -lm -lpthread
* –prefix=/opt/local 讓ImageMagick/GraphicsMagick與MacPorts的庫文件安裝到同一個目錄。
如果你想要安裝到其它目錄,則輸入不同的目錄路徑,如果不聲明–prefix,默認會將其安裝到/usr/local。
* –disable-static和–with-modules使得ImageMagick/GraphicsMagick以動態鏈接庫的方式安裝,
現在安裝ImageMagick/GraphicsMagick只是爲了在Ruby中使用,所以我用–without-perl和–without-magick-plus-plus以免去安裝Perl和C++的支持
* –with-quantum-depth=8配置ImageMagick使用8位的色深。默認是16位。參與RMagick Hints & Tips Forum論壇中的討論Speed up your RMagick apps in 1 easy step瞭解這個選項有什麼作用。
* –with-gs-font-dir=/opt/local/share/ghostscript/fonts讓ImageMagick/GraphicsMagick知道Ghostscript字體安裝在哪個角落裏。
如果你某個目錄裏有“標準”的windows TrueType字體,也可以設置–with-windows-font-dir=選項讓ImageMagick/GraphicsMagick使用它們。
查看ImageMagick/GraphicsMagick的README.txt文件瞭解更多選項的信息。
手動安裝GraphicsMagick
----------------------
手動安裝
下載地址 ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/
tar zvxf GraphicsMagick-1.3.17.tar.gz
cd GraphicsMagick-1.3.17
./configure CC=clang --prefix=/usr/local/GraphicsMagick-1.3.17 --with-quantum-depth=16 --enable-shared --enable-static
make
make install
注意confiure命令後面的CC=clang。它指定了編譯器爲Mac下推薦使用的clang。如果沒有這個參數,Makefile將會使用系統默認的編譯器進行編譯,而這個編譯器不是GraphicsMagic所推薦的,並且在make的過程中會出現以下錯誤:
- Undefined symbols for architecture x86_64:
- "___builtin_object_size", referenced from:
- _BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)
- _XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
- _YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
- ld: symbol(s) not found for architecture x86_64
- collect2: ld returned 1 exit status
- make[1]: *** [utilities/gm] Error 1
- make: *** [all] Error 2
- ----------
- ld: symbol(s) not found for architecture x86_64
- collect2: ld returned 1 exit status
- make[1]: *** [magick/libGraphicsMagick.la] Error 1
- make: *** [all] Error 2
最後還是有錯,未成功。
(可參考上面“自動安裝”時的的./configure設置編譯器,應該會成功)
手動安裝的配置信息:
Windows 上安裝GM
----------------------------------------
1、安裝:略
2、信息
常用管理命令
--------------------------------------------------------------------------------------------
查看版本後安裝情況:gm identify -version
結果::打印出信息
識別圖片:gm identify /Users/zhaorai/Pictures/照片/100CANON-1/IMG_4108.JPG
結果:/Users/zhaorai/Pictures/照片/100CANON-1/IMG_4108.JPG JPEG 3648x2736+0+0 DirectClass 8-bit 2.5M 0.000u 0:01
識別圖片(高級):gm identify -verbose /Users/zhaorai/Desktop/4.png
結果:打印出很多信息。