GraphicsMagick安裝、實時生成縮略圖

感謝有奉獻精神的人

轉自: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

 

C代碼  收藏代碼
  1. GraphicsMagick 1.3.17 2012-10-13 Q8 http://www.GraphicsMagick.org/  
  2. Copyright (C) 2002-2012 GraphicsMagick Group.  
  3. Additional copyrights and licenses apply to this software.  
  4. See http://www.GraphicsMagick.org/www/Copyright.html for details.  
  5.   
  6. Feature Support:  
  7.   Thread Safe              yes  
  8.   Large Files (> 32 bit)   yes  
  9.   Large Memory (> 32 bit)  yes  
  10.   BZIP                     yes  
  11.   DPS                      no  
  12.   FlashPix                 no  
  13.   FreeType                 yes  
  14.   Ghostscript (Library)    no  
  15.   JBIG                     no  
  16.   JPEG-2000                yes  
  17.   JPEG                     yes  
  18.   Little CMS               no  
  19.   Loadable Modules         no  
  20.   OpenMP                   no  
  21.   PNG                      yes  
  22.   TIFF                     no  
  23.   TRIO                     no  
  24.   UMEM                     no  
  25.   WMF                      no  
  26.   X11                      no  
  27.   XML                      yes  
  28.   ZLIB                     yes  
  29.   
  30. Host type: x86_64-apple-darwin11.4.2  
  31.   
  32. Configured using the command:  
  33.     ./configure  '--disable-dependency-tracking' '--prefix=/usr/local/Cellar/graphicsmagick/1.3.17'   
  34.   '--enable-shared' '--disable-static' '--disable-openmp' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts'   
  35.   '--without-x' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'   
  36.   'LDFLAGS=-L/usr/local/lib -F/usr/local/Frameworks -L/usr/X11/lib' 'CPPFLAGS=-F/usr/local/Frameworks -I/usr/X11/include'   
  37.   'CXX=/usr/bin/llvm-g++' 'CXXFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'  
  38. Final Build Parameters:  
  39.   CC       = /usr/bin/llvm-gcc -std=gnu99  
  40.   CFLAGS   = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -Wall -D_THREAD_SAFE  
  41.   CPPFLAGS = -F/usr/local/Frameworks -I/usr/X11/include -I/usr/local/Cellar/freetype/2.4.10/include/freetype2 -I/usr/include/libxml2  
  42.   CXX      = /usr/bin/llvm-g++  
  43.   CXXFLAGS = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -D_THREAD_SAFE  
  44.   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  
  45.   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的過程中會出現以下錯誤:

 

C代碼  收藏代碼
  1. Undefined symbols for architecture x86_64:  
  2.   "___builtin_object_size", referenced from:  
  3.       _BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)  
  4.       _XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)  
  5.       _YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)  
  6. ld: symbol(s) not found for architecture x86_64  
  7. collect2: ld returned 1 exit status  
  8. make[1]: *** [utilities/gm] Error 1  
  9. make: *** [all] Error 2  
  10.   
  11. ----------  
  12. ld: symbol(s) not found for architecture x86_64     
  13. collect2: ld returned 1 exit status     
  14. make[1]: *** [magick/libGraphicsMagick.la] Error 1  
  15. 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

 

C代碼  收藏代碼
  1. GraphicsMagick 1.3.17 2012-10-13 Q8 http://www.GraphicsMagick.org/  
  2. Copyright (C) 2002-2012 GraphicsMagick Group.  
  3. Additional copyrights and licenses apply to this software.  
  4. See http://www.GraphicsMagick.org/www/Copyright.html for details.  
  5.   
  6. Feature Support:  
  7.   Thread Safe              yes  
  8.   Large Files (> 32 bit)   yes  
  9.   Large Memory (> 32 bit)  yes  
  10.   BZIP                     yes  
  11.   DPS                      no  
  12.   FlashPix                 no  
  13.   FreeType                 yes  
  14.   Ghostscript (Library)    no  
  15.   JBIG                     no  
  16.   JPEG-2000                yes  
  17.   JPEG                     yes  
  18.   Little CMS               no  
  19.   Loadable Modules         no  
  20.   OpenMP                   no  
  21.   PNG                      yes  
  22.   TIFF                     no  
  23.   TRIO                     no  
  24.   UMEM                     no  
  25.   WMF                      no  
  26.   X11                      no  
  27.   XML                      yes  
  28.   ZLIB                     yes  
  29.   
  30. Host type: x86_64-apple-darwin11.4.2  
  31.   
  32. Configured using the command:  
  33.     ./configure  '--disable-dependency-tracking' '--prefix=/usr/local/Cellar/graphicsmagick/1.3.17'   
  34.   '--enable-shared' '--disable-static' '--disable-openmp' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts'   
  35.   '--without-x' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'   
  36.   'LDFLAGS=-L/usr/local/lib -F/usr/local/Frameworks -L/usr/X11/lib' 'CPPFLAGS=-F/usr/local/Frameworks -I/usr/X11/include'   
  37.   'CXX=/usr/bin/llvm-g++' 'CXXFLAGS=-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7'  
  38. Final Build Parameters:  
  39.   CC       = /usr/bin/llvm-gcc -std=gnu99  
  40.   CFLAGS   = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -Wall -D_THREAD_SAFE  
  41.   CPPFLAGS = -F/usr/local/Frameworks -I/usr/X11/include -I/usr/local/Cellar/freetype/2.4.10/include/freetype2 -I/usr/include/libxml2  
  42.   CXX      = /usr/bin/llvm-g++  
  43.   CXXFLAGS = -Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7 -D_THREAD_SAFE  
  44.   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  
  45.   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的過程中會出現以下錯誤:

 

C代碼  收藏代碼
  1. Undefined symbols for architecture x86_64:  
  2.   "___builtin_object_size", referenced from:  
  3.       _BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)  
  4.       _XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)  
  5.       _YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)  
  6. ld: symbol(s) not found for architecture x86_64  
  7. collect2: ld returned 1 exit status  
  8. make[1]: *** [utilities/gm] Error 1  
  9. make: *** [all] Error 2  
  10.   
  11. ----------  
  12. ld: symbol(s) not found for architecture x86_64     
  13. collect2: ld returned 1 exit status     
  14. make[1]: *** [magick/libGraphicsMagick.la] Error 1  
  15. 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

結果:打印出很多信息。



發佈了103 篇原創文章 · 獲贊 60 · 訪問量 70萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章