報錯: Uncaught exception 'ImagickException' with message 'Unable to annotate image'
使用phpinfo 函數檢查時,正常.但php代碼調用時,出現如上報錯,或者讀取不了字體,去掉字體就出現上面的報錯了.
原因:和 /usr/share/fonts 下字體有關
字體目錄 /usr/share/fonts ImageMagick 配置字體 /usr/local/lib/ImageMagick-6.5.1/config/type-ghostscript.xml ,若系統在字體目錄下只有 bitstream-vera ,導致type-ghostscript.xml 配置中獲取字體路徑沒有 如: <type name="AvantGarde-Book" fullname="AvantGarde Book" family="AvantGarde" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="a010013l.afm" glyphs="a010013l.pfb"/> 正常的應該是: <type name="AvantGarde-Book" fullname="AvantGarde Book" family="AvantGarde" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts /default/Type1/a010013l.afm" glyphs="/usr/share/fonts/default/Type1/a010013l.pfb"/>
本文出自 「風中人生」 博客,謝絕轉載!
[火星人 ] centos 5.5 64 php imagick 模塊錯誤處理記錄已經有295次圍觀