[PHP-users 7734] GD を使って PNG を出力できないです。

パック くん php-users@php.gr.jp
Wed, 29 May 2002 16:54:31 +0900 (JST)


はじめまして。パケです。


サブジェクトのとおり、PNG画像を出力する事が
できません・・・。
JPEG画像はインストール一発目から出力する事が
できました。PNGの方が基本的で簡単なモノだと
思ったのですが・・・なんか恥かしいです。
過去ログでも誰も質問してないみたいですし・・・

phpは4.1.2です。
./configure
 --with-pgsql
 --with-apxs=/usr/local/apache/bin/apxs
 --enable-track-vars
 --enable-i18n
 --enable-mbregex
 --with-jpeg-dir=/path/to/jpeg-6b
 --with-zlib-dir=/path/to/zlib
 --with-png-dir=/usr/local/lib
 --with-gd --with-ming
ちょっと試行錯誤の後がありますし、無駄な部分が
あるかも・・・

そして、configのログです。
(GD関連の部分そのままです)

checking whether to include GD support... yes
checking whether to enable truetype string function in
gd... no
checking for the location of libjpeg... yes
checking for jpeg_read_header in -ljpeg... (cached) yes
checking for the location of libpng... yes
checking for png_info_init in -lpng... (cached) yes
checking for the location of libXpm... no
If configure fails try --with-xpm-dir=<DIR>
checking for freetype(2)... no
If configure fails try --with-freetype-dir=<DIR>
checking whether to include include FreeType 1.x
support... no
checking whether to include T1lib support... no
checking for gdImageString16 in -lgd... (cached) yes
checking for gdImagePaletteCopy in -lgd... (cached) yes
checking for gdImageCreateFromPng in -lgd... (cached) no
checking for gdImageCreateFromGif in -lgd... (cached) no
checking for gdImageGif in -lgd... (cached) no
checking for gdImageWBMP in -lgd... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) yes

見てみると、libpng とか -png のところは yes なのに、

checking for the location of libpng... yes
checking for png_info_init in -lpng... (cached) yes

GDの PNG サポートの部分では no となっています。

checking for gdImageCreateFromPng in -lgd... (cached) no


GD自体は PNG をサポートするようにコンパイルして
いますし、gdtopng のようなコマンドも正常に機能
しているので、PNG のライブラリは組み込めていると
思っています。
ちなみに、GDの Makefile の一部です。
(過去ログでこの部分が設定されていないのでは?という記事
がありました)

LIBS=-lgd -lpng -lz -lm -ljpeg

この -ljpeg の部分は付けなくても動いていたのですが、
念のためにつけてみました。ですので、-lpng は最初から
付いていたし、GDの Makefile は関係ないのかなぁ。
と思ってます。

PHPの imagepng($image); を実行すると
ImagePng: No PNG support in this PHP build in ...
となってしまいます。


考えられるとしたら、全てのインストール時のどの
工程で問題がある可能性があるでしょうか。

考えるよりもっと単純なミスのような気がするのですが、
どれだけ試行錯誤してもダメです。何度も同じ作業を
してて、視野が狭くなってるのかも知れないです。


お力を拝借できませんでしょうか。
よろしくお願いします。

パケ


__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/