Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP with GD Gif support?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Tue Sep 03, 2002 11:19 pm    Post subject: PHP with GD Gif support? Reply with quote

I was wondering if there was an ebuild for an eariler version of GD with gif support, or a patch that would enable gif support?

Also is there an ebuild for ImageMagick 4.2.9

These are needed by the CMS that I want to use for my web-site (www.typo3.com)
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Wed Sep 04, 2002 2:45 am    Post subject: Reply with quote

I use the PNG to GIF conversion option to make the stock GD in PHP 4.2.2 work fine. However, I had to compile IM 4.2.9 from source (which required X headers, even though --without-x is passed to the ./configure), though that works fine too.

And yes, this is because of Typo3 as well. :D
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Thu Sep 05, 2002 5:02 pm    Post subject: Reply with quote

Oh.

Does typo3 work well for you?

I actually found a place for the gif-enabled GD, if you wish to try it, as long as you have all the legalities of using that in place....


The url is:

http://downloads.rhyme.com.au/gd/
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Thu Sep 05, 2002 11:04 pm    Post subject: Reply with quote

fidler wrote:
Does typo3 work well for you?

Indeed, it does. I've learned the syntax of TypoScript, but I'm still learning how exactly I should go about things using it -- after all, I'm the type that won't settle for standard templates. :D

Though, make sure you got a beefy box as a server. A lot of processes will be spawned very quickly (image generation, for instance) and it has to be able to cope with spikes. Additionally, the management interface is much nicer with (gasp) Internet Explorer -- it's worth hitting Ctrl-Alt-F8 to get into VMware to pop up IE. Or Ctrl-Ctrl to switch boxen on a KVM switch. It's not worth dual-booting, but it is nice. (Dropdown menus for page manipulation, for instance. And the RTE is good too, you can even copy & paste pictures.)
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Fri Sep 06, 2002 4:35 pm    Post subject: Reply with quote

The reason why it looks so good on IE is becuse IE is the only browser that has a built-in scriptable editing engine. I know, I programmed it once.

Personally, I use Win4Lin or wine. It is *much* faster than VMWare.

I also want to make my own template, but don't know if I have the time to...
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Wed Sep 18, 2002 2:35 am    Post subject: Re: PHP with GD Gif support? Reply with quote

fidler wrote:
I was wondering if there was an ebuild for an eariler version of GD with gif support, or a patch that would enable gif support?

Also is there an ebuild for ImageMagick 4.2.9


A follow up: you can get GIF support in libgd by finding the appropriate patches and modifying the media-libs/libgd ebuild to point to the modified tarball (*cough*), emerge libgd (PHP uses 1.8.3 currently), emerge php, and /etc/init.d/apache restart.

And for ImageMagick 4.2.9, I made a source distribution available here that works under gcc2 on several distributions on several architectures. (No X needed, either.)
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Wed Sep 18, 2002 11:43 pm    Post subject: Reply with quote

Thats cool

I did get typo3 working on a gentoo system, by doing much the same procedure. Execpt my typo3 distribution is on a gcc3 box.

BTW, the libgd that just came out in the ebuilds is 2.0.3 .... There is also another gif patch somewhere ftp://ftp.rhyme.com.au/pub/gd/ is one url
Back to top
View user's profile Send private message
Scott_the_Great
n00b
n00b


Joined: 08 Aug 2002
Posts: 21

PostPosted: Fri Sep 20, 2002 4:07 am    Post subject: Reply with quote

The other day I slapped together an ebuild for libgd-1.8.4 with the GIF patch from "http://www.rhyme.com.au/gd/"

Now, of course, I must warn: Depending on where you live, this may infringe patents.

It seemed to work pretty well for me (I compiled PHP with GD support and it worked okay...)

---Scott

Code:

# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /usr/local/portage/media-libs/libgd/libgd-1.8.4.ebuild,v 1.5 2002/08/14 13:08:09 scotth Exp $

MY_P=${P/lib/}
S=${WORKDIR}/${MY_P}
DESCRIPTION="A graphics library for fast image creation (with GIF patch)"
SRC_URI="http://downloads.rhyme.com.au/gd/${MY_P}gif.tar.gz"
HOMEPAGE="http://www.rhyme.com.au/gd"

SLOT="0"
LICENSE="as-is | BSD"
KEYWORDS="x86 ppc sparc sparc64"

DEPEND=">=media-libs/jpeg-6b
        >=media-libs/libpng-1.0.7
        ~media-libs/freetype-2.0.6
        X? ( virtual/x11 )"

src_unpack() {

        unpack ${A}
        cd ${S}

        cp Makefile Makefile.orig
        if [ "`use X`" ]
        then
                sed -e "s/^\(CFLAGS\)=.*/\1=$CFLAGS -DHAVE_LIBXPM -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_LIBGPNG -DHAVE_LIBTTF /" \
                -e "s/^.*-DHAVE_LIBFREETYPE.$//" \
                -e "s/^\(LIBS\)=.*/\1=-lm -lgd -lpng -lz -ljpeg -lttf -lfreetype -lXpm -lX11/" \
                -e "s/^\(INCLUDEDIRS\)=/\1=-I\/usr\/include\/freetype /" \
                Makefile.orig > Makefile
        else
                sed -e "s/^\(CFLAGS\)=.*/\1=$CFLAGS -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_LIBTTF -DHAVE_PNG /" \
                -e "s/^.*-DHAVE_LIBFREETYPE.$//" \
                -e "s/^\(LIBS\)=.*/\1=-lm -lgd -lpng -lz -ljpeg -lttf -lfreetype/" \
                -e "s/^\(INCLUDEDIRS\)=/\1=-I\/usr\/include\/freetype /" \
                Makefile.orig > Makefile
        fi

}

src_compile() {

        emake || die

}

src_install() {

        dodir /usr/{bin,lib,include}

        make    \
                INSTALL_LIB=${D}/usr/lib        \
                INSTALL_BIN=${D}/usr/bin \
                INSTALL_INCLUDE=${D}/usr/include        \
                install || die

        preplib /usr

        dodoc readme.txt
        dohtml -r ./
}
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Fri Sep 20, 2002 4:21 am    Post subject: Reply with quote

Do you have a link that explains the potential patent infringement?
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Sep 20, 2002 4:55 am    Post subject: Reply with quote

kanuslupus wrote:
Do you have a link that explains the potential patent infringement?

It's the Unisys patent on the LZW compression algorithm used in the GIF standard. Here's a site specifically related to GD, and here's a more strident activist take on the issue.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Thu Dec 12, 2002 12:50 am    Post subject: Reply with quote

I think that software patent is silly. I was wondering if by the same logic I won't be able to view DVDs on my Linux box...
Back to top
View user's profile Send private message
Panik
n00b
n00b


Joined: 22 Dec 2002
Posts: 1
Location: Switzerland

PostPosted: Sun Dec 22, 2002 10:20 pm    Post subject: Re: PHP with GD Gif support? Reply with quote

Quote:
A follow up: you can get GIF support in libgd by finding the appropriate patches and modifying the media-libs/libgd ebuild to point to the modified tarball (*cough*), emerge libgd (PHP uses 1.8.3 currently), emerge php, and /etc/init.d/apache restart.


I pointed the libsgd ebuild to the modified tarball, emerged the patched libgd (gd-1.8.3gif.tar.gz) and re-emerged php, strangely enough it doesn't compile with GD support.

Any ideas why?
Back to top
View user's profile Send private message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Mon Dec 23, 2002 4:32 pm    Post subject: Reply with quote

rac wrote:
kanuslupus wrote:
Do you have a link that explains the potential patent infringement?

It's the Unisys patent on the LZW compression algorithm used in the GIF standard. Here's a site specifically related to GD, and here's a more strident activist take on the issue.


It seems that educational institutions do not have to worry about this patent?

Does anyone know if that is right?
Back to top
View user's profile Send private message
fidler
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 162
Location: Utah

PostPosted: Mon Dec 23, 2002 4:33 pm    Post subject: Re: PHP with GD Gif support? Reply with quote

Panik wrote:
Quote:
A follow up: you can get GIF support in libgd by finding the appropriate patches and modifying the media-libs/libgd ebuild to point to the modified tarball (*cough*), emerge libgd (PHP uses 1.8.3 currently), emerge php, and /etc/init.d/apache restart.


I pointed the libsgd ebuild to the modified tarball, emerged the patched libgd (gd-1.8.3gif.tar.gz) and re-emerged php, strangely enough it doesn't compile with GD support.

Any ideas why?


I don't know, It could be the md5 sum that isn't working correctly on the GD, or do you have the gd use flag installed?
Back to top
View user's profile Send private message
dumdey
n00b
n00b


Joined: 08 Jul 2002
Posts: 47
Location: Höchstadt, Germany

PostPosted: Thu Jan 09, 2003 2:40 pm    Post subject: Reply with quote

With the folowing i have a GIF enabled libgd:

Code:

neptun root # cat libgd-1.8.4.ebuild
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /usr/local/portage/media-libs/libgd/libgd-1.8.4.ebuild,v 1.5 2002/08/14 13:08:09 scotth Exp $
        #~media-libs/freetype-2.0.6

MY_P=${P/lib/}
S=${WORKDIR}/${MY_P}
DESCRIPTION="A graphics library for fast image creation (with GIF patch)"
SRC_URI="http://downloads.rhyme.com.au/gd/${MY_P}gif.tar.gz"
HOMEPAGE="http://www.rhyme.com.au/gd"

SLOT="0"
LICENSE="as-is | BSD"
KEYWORDS="x86 ppc sparc sparc64"

DEPEND=">=media-libs/jpeg-6b
        >=media-libs/libpng-1.0.7
        ~media-libs/freetype-2.1.3-r2
        X? ( virtual/x11 )"

src_unpack() {

        unpack ${A}
        cd ${S}

        cp Makefile Makefile.orig
        if [ "`use X`" ]
        then
                sed -e "s/^\(CFLAGS\)=.*/\1=$CFLAGS -DHAVE_LIBXPM -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_LIBGPNG -DHAVE_LIBTTF /" \
                -e "s/^.*-DHAVE_LIBFREETYPE.$//" \
                -e "s/^\(LIBS\)=.*/\1=-lm -lgd -lpng -lz -ljpeg -lttf -lfreetype -lXpm -lX11/" \
                -e "s/^\(INCLUDEDIRS\)=/\1=-I\/usr\/include\/freetype /" \
                Makefile.orig > Makefile
        else
                sed -e "s/^\(CFLAGS\)=.*/\1=$CFLAGS -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE -DHAVE_LIBTTF -DHAVE_PNG /" \
                -e "s/^.*-DHAVE_LIBFREETYPE.$//" \
                -e "s/^\(LIBS\)=.*/\1=-lm -lgd -lpng -lz -ljpeg -lttf -lfreetype/" \
                -e "s/^\(INCLUDEDIRS\)=/\1=-I\/usr\/include\/freetype /" \
                Makefile.orig > Makefile
        fi

}

src_compile() {

        emake || die

}

src_install() {

        dodir /usr/{bin,lib,include}

        make    \
                INSTALL_LIB=${D}/usr/lib        \
                INSTALL_BIN=${D}/usr/bin \
                INSTALL_INCLUDE=${D}/usr/include        \
                install || die

        preplib /usr

        dodoc readme.txt
        dohtml -r ./
}
neptun root #


and with this i have a gd enabled php

Code:

neptun php # cat php-4.3.0-r2.ebuild
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# Update: Roman Weber <gentoo@gonzo.ch>
# $Header: /home/cvsroot/gentoo-x86/dev-php/php/php-4.3.0-r2.ebuild,v 1.2 2003/01/08 20:26:40 rphillips Exp $

IUSE="gd truetype postgres tiff libwww nls jpeg readline ssl oci8 mysql X gdbm curl imap xml2 xml cjk pdflib qt snmp crypt flash odbc ldap berkdb freetds firebird pam"

MY_P=php-${PV}
S=${WORKDIR}/${MY_P}
DESCRIPTION="PHP Shell Interpreter"
SRC_URI="http://us3.php.net/distributions/${MY_P}.tar.bz2"
HOMEPAGE="http://www.php.net/"
LICENSE="PHP"
SLOT="0"
PROVIDE="virtual/php"
KEYWORDS="x86 ~sparc"

        # too many users not being able to compile with gmp support
        # - rphillips
        # >=dev-libs/gmp-3.1.1

DEPEND="
        truetype? ( ~media-libs/freetype-1.3.1 >=media-libs/t1lib-1.3.1 )
        jpeg? ( >=media-libs/jpeg-6b )
        tiff? ( >=media-libs/tiff-3.5.5 )
        gd? ( >=media-libs/libgd-1.8.3 )
        X? ( virtual/x11 )
        qt? ( x11-libs/qt )
        nls? ( sys-devel/gettext )
        pam? ( >=sys-libs/pam-0.75 )
        xml? ( >=net-libs/libwww-5.3.2 >=app-text/sablotron-0.95-r1 )
        ssl? ( >=dev-libs/openssl-0.9.5 )
        curl? ( >=net-ftp/curl-7.8.1 )
        snmp? ( >=net-analyzer/ucd-snmp-4.2.3 )
        imap? ( >=net-mail/uw-imap-2001a-r1 )
        gdbm? ( >=sys-libs/gdbm-1.8.0 )
        ldap? ( >=net-nds/openldap-1.2.11 )
        odbc? ( >=dev-db/unixODBC-1.8.13 )
        xml2? ( dev-libs/libxml2 )
        crypt? ( >=dev-libs/libmcrypt-2.4 >=app-crypt/mhash-0.8 )
        mysql? ( >=dev-db/mysql-3.23.26 )
        freetds? ( >=dev-db/freetds-0.53 )
        flash? ( media-libs/libswf >=media-libs/ming-0.2a )
        berkdb? ( >=sys-libs/db-3 )
        libwww? ( >=net-libs/libwww-5.3.2 )
        firebird? ( >=dev-db/firebird-1.0 )
        pdflib? ( >=media-libs/pdflib-4.0.1-r2 )
        postgres? ( >=dev-db/postgresql-7.1 )
        readline? ( >=sys-libs/ncurses-5.1
        >=sys-libs/readline-4.1 )"

#Removed
#java? ( virtual/jdk )

RDEPEND="
        xml? ( >=app-text/sablotron-0.95-r1 >=net-libs/libwww-5.3.2 )
        qt? ( >=x11-libs/qt-2.3.0 )"

src_unpack() {
        unpack ${MY_P}.tar.bz2
        cd ${S}

        # Configure Patch for wired uname -a
        mv configure configure.old
        cat configure.old | sed "s/PHP_UNAME=\`uname -a\`/PHP_UNAME=\`uname -s -n -r -v\`/g" > configure
        chmod 755 configure

        # fix PEAR installer
        cp pear/PEAR/Registry.php pear/PEAR/Registry.old
        sed "s:\$pear_install_dir\.:\'$D/usr/lib/php/\' . :g" pear/PEAR/Registry.old > pear/PEAR/Registry.php

        # if [ "`use java`" ] ; then

        #       cp configure configure.orig
        #       cat configure.orig | \
        #               sed -e 's/LIBS="-lttf $LIBS"/LIBS="-lttf $LIBS"/' \
        #               > configure

        #       cp ext/gd/gd.c ext/gd/gd.c.orig
        #       cat ext/gd/gd.c.orig | \
        #               sed -e "s/typedef FILE gdIOCtx;//" \
        #               > ext/gd/gd.c
        #       if [ "$JAVAC" ];
        #       then
        #             cp ext/java/Makefile.in ext/java/Makefile.in.orig
        #              cat ext/java/Makefile.in.orig | \
        #                      sed -e "s/^\tjavac/\t\$(JAVAC)/" \
        #                      > ext/java/Makefile.in
        #       fi
        # fi
}

src_compile() {

        local myconf

        use readline && myconf="${myconf} --with-readline"
        use nls && myconf="${myconf} --with-gettext" || myconf="${myconf} --without-gettext"
        use ssl && myconf="${myconf} --with-openssl"
        use cjk && myconf="${myconf} --enable-mbstring"
        use curl && myconf="${myconf} --with-curl"
        use snmp && myconf="${myconf} --with-snmp --enable-ucd-snmp-hack"
        use gdbm && myconf="${myconf} --with-gdbm=/usr"
        use berkdb && myconf="${myconf} --with-db3=/usr"
        use mysql && myconf="${myconf} --with-mysql=/usr" || myconf="${myconf} --without-mysql"
        use freetds && myconf="${myconf} --with-sybase=/usr"
        use postgres && myconf="${myconf} --with-pgsql=/usr"
        use odbc && myconf="${myconf} --with-unixODBC=/usr"
        use ldap &&  myconf="${myconf} --with-ldap"
        use firebird && myconf="${myconf} --with-interbase=/opt/interbase"
        use truetype && myconf="${myconf} --with-ttf --with-t1lib"
        use pdflib && myconf="${myconf} --enable-pdflib=/usr"
        use jpeg && myconf="${myconf} --with-jpeg-dir=/usr/lib"
        use tiff && myconf="${myconf} --with-tiff-dir=/usr"
        use gd && myconf="${myconf} --with-gd"

        # optional support for oracle oci8
        if [ "`use oci8`" ] ; then
                        if [ "$ORACLE_HOME" ] ; then
                                        myconf="${myconf} --with-oci8=${ORACLE_HOME}"
                        fi
        fi

        use qt && ( \
                export QTDIR=/usr/qt/2 #hope this helps - danarmak
                myconf="${myconf} --with-qtdom"
        )

        if [ "`use imap`" ] ; then
                if [ "`use ssl`" ] && [ "`strings ${ROOT}/usr/lib/c-client.a \
                                        | grep ssl_onceonlyinit`" ] ; then
                        echo "Compiling imap with SSL support"
                        myconf="${myconf} --with-imap --with-imap-ssl"
                else
                        echo "Compiling imap without SSL support"
                        myconf="${myconf} --with-imap"
                fi
        fi
        use libwww && myconf="${myconf} --with-xml" || myconf="${myconf} --disable-xml"
        use flash && myconf="${myconf} --with-swf=/usr --with-ming=/usr"

        if [ "`use xml`" ] ; then
                export LIBS="-lxmlparse -lxmltok"
                myconf="${myconf} --enable-xslt"
                myconf="${myconf} --with-xslt-sablot=/usr"
                myconf="${myconf} --with-xmlrpc"
        fi

        use xml2 && myconf="${myconf} --with-dom"
        use crypt && myconf="${myconf} --enable-mcrypt=/usr --with-mhash"
        #use java && myconf="${myconf} --with-java=${JDK_HOME}"

        LDFLAGS="$LDFLAGS -ltiff -ljpeg"

        if [ "`use X`" ] ; then
                myconf="${myconf} --with-xpm-dir=/usr/X11R6"
                LDFLAGS="$LDFLAGS -L/usr/X11R6/lib"
        fi
                # --with-gmp \

        ./configure \
                --prefix=/usr \
                --with-bz2 \
                --enable-ftp \
                --enable-dbase \
                --with-zlib=yes \
                --enable-bcmath \
                --enable-sysvsem \
                --enable-sysvshm \
                --with-gd \
                --enable-sockets \
                --enable-pcntl \
                --enable-cli \
                --disable-cgi \
                --enable-calendar \
                --enable-trans-sid \
                --enable-versioning \
                --enable-track-vars \
                --enable-inline-optimization \
                --with-config-file-path=/etc/php4 \
                --with-pear \
                --host=${CHOST} ${myconf} || die "bad ./configure"

        make || die "compile problem"
}


src_install() {
        addwrite /usr/share/snmp/mibs/.index

        make INSTALL_ROOT=${D} install-pear || die

        dodoc CODING_STANDARDS LICENSE EXTENSIONS
        dodoc RELEASE_PROCESS README.* TODO NEWS
        dodoc ChangeLog* *.txt

        # php executable is located in ./sapi/cli/
        cp sapi/cli/php .
        exeinto /usr/bin
        doexe php

        insinto /etc/php4
        mv php.ini-dist php.ini
        doins php.ini
        dosym /usr/lib/php/extensions/no-debug-non-zts-20020429 /etc/php4/lib

        # This fixes the permission from world writeable to the correct one.
        # - novell@kiruna.se
}

pkg_postinst() {
        # This fixes the permission from world writeable to the correct one.
        # - novell@kiruna.se
        chmod 755 /usr/bin/pear

        # This is more correct information.
        einfo
        einfo "This is a CLI only build."
        einfo "You can not use it on a webserver."
        einfo
}


Hope this helps :D
_________________
http://www.k-u-h.org/harry/
Back to top
View user's profile Send private message
humillo
n00b
n00b


Joined: 26 Oct 2002
Posts: 49

PostPosted: Mon Jan 27, 2003 8:42 pm    Post subject: Reply with quote

From PHP 4.3.0 the GD library is bundled, so you dont need to install it separately. The good news is that it supports GIF too!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum