Including LibGD with Solaris
Stefan Teleman <Stefan.Teleman at Sun.COM>
15 March 2007
1. Summary and motivation
The inclusion of PHP5 in Solaris has identified a number of
missing capabilities. One of these capabilities is the LibGD
library [http://www.libgd.org/] [1]. According to LibGD's Home
Page, "LibGD is an open source library for the creation of images
by programmers. LibGD creates PNG, JPEG and GIF images, among
other formats. GD is commonly used to generate charts,
graphics, thumbnails, etc., on the fly. While not restricted
to use on the web, the most common applications of GD involve
web site development.
LibGD is written in C and various bindings are available."
LibGD was originally written and maintained by Thomas Boutell
[http://www.boutell.com/] [3]. Recently, LibGD development has
been transferred to the PHP Group [http://www.php.net/] [2].
The "GD" in LibGD originally meant "GIF Draw". It has since
changed its meaning, and now stands for "Graphics Drawing".
This FastTrack proposes the integration of LibGD in Solaris.
Being an open source project, developed outside of SMI, LibGD
is proposed for integration in the SFW Consolidation.
This case proposes the most recent stable release of LibGD
as of time of this writing, 2.0.34, released in February 2007.
This case seeks Micro/Patch Release Binding.
2. Technical issues
2.1. Key objects
/usr/bin/annotate
/usr/bin/gdparttopng
/usr/bin/gdtopng
/usr/bin/gd2copypal
/usr/bin/gd2topng
/usr/bin/pngtogd
/usr/bin/pngtogd2
/usr/bin/webpng
/usr/bin/gd2togif
/usr/bin/gdcmpgif
/usr/bin/giftogd2
/usr/bin/gd2time
/usr/bin/gdlib-config
/usr/lib/libgd.so.2.0.0
/usr/lib/libgd.so.2 -> libgd.so.2.0.0
/usr/lib/libgd.so -> libgd.so.2.0.0
/usr/include/gd2/gd.h
/usr/include/gd2/gdcache.h
/usr/include/gd2/gdfx.h
/usr/include/gd2/gdfontt.h
/usr/include/gd2/gdfonts.h
/usr/include/gd2/gdfontmb.h
/usr/include/gd2/gdfontl.h
/usr/include/gd2/gdfontg.h
/usr/include/gd2/gdhelpers.h
/usr/include/gd2/gd_io.h
/usr/include/gd2/jisx0208.h
/usr/include/gd2/wbmp.h
/usr/share/man/man1/libgd.1
/usr/share/man/man3/libgd.3
/usr/share/doc/gd2/index.html
LibGD's functionality is provided by several executables [outlined
above], and by the GD library proper [libgd.so.2.0.0]. Key aspects
of LibGD's facilities are discussed below.
LibGD installs its include files under /usr/include. We propose to
change this default installation location to a more suitable
/usr/include/gd, for the purpose of avoiding namespace pollution
in /usr/include.
LibGD does not implement any graphics file formats. GD is a wrapper
library, relying on the facilities provided by specific graphics file
libraries. GD provides generic programmatic APIs for the creation of,
and conversion/manipulation between, different graphic file formats.
LibGD relies on external libraries [libpng, libjpeg, libtiff, libxpm]
for the creation and conversion operations supported. If the external
libraries are not available [determination is made at configure time],
LibGD will fail the conversion.
LibGD supports GIF, JPEG, TIFF, WBMP and XPM. It also supports
TrueColor [24-bit] graphics, alpha channels, transparency effects,
and resampling. LibGD also provides facilities for rendering
anti-aliased fonts, if the underlying libraries are available
[FreeType 2 and FontConfig] [the same principles as for graphics
file format apply]. The immediate consequence of LibGD's facilities
is code simplification.
2.2. Language Bindings
LibGD is written in C. Bindings exist for several other languages
[Perl, PHP, Tcl, C#]. None of these bindings are part of the canonical
LibGD release, and are not being considered for Solaris integration
at this time.
2.3. Documentation
LibGD provides documentation in HTML format only, in one file.
This file [index.html] will be included with the Solaris LibGD
release, and will be delivered in /usr/share/doc/gd. LibGD does
not provide documentation in UNIX manual format. Two generic manual
pages [libgd(1) and libgd(3)], modelled after LibIDN, will be
provided with this integration.
3. Interfaces
3.1. Interface Stability
LibGD's development and release schedules are controlled by a group
of developers external to SMI [http://www.boutell.com/] [3] and
[http://www.php.net/] [2]. Although LibGD attempts to maintain API
and ABI compatibility between Major release versions, no such
guarantees are offered by its developers. Moreover, PHP4 and PHP5
are known to include ABI incompatible variants of LibGD in their
canonical distributions.
3.2. Imported interfaces
NAME NOTES
LibPNG LSARC/2003/085
LibTIFF LSARC/2003/085
LibJPEG LSARC/2003/085
LibXPM PSARC/2001/060
Z-Lib [Zlib Compression Library] PSARC/2006/537
LibFreetype2 [Freetype Library] LSARC/2005/397
LibFontconfig [Fontconfig Library] LSARC/2003/273
3.3. Exported Interfaces.
NAME STABILITY NOTES
SUNWgd2core Uncommitted Package Name
SUNWgd2usr Uncommitted Package Name
SUNWgd2doc Uncommitted Package Name
/usr/bin/annotate Uncommitted Executable location
/usr/bin/gdparttopng Uncommitted Executable location
/usr/bin/gdtopng Uncommitted Executable location
/usr/bin/gd2copypal Uncommitted Executable location
/usr/bin/gd2topng Uncommitted Executable location
/usr/bin/pngtogd Uncommitted Executable location
/usr/bin/pngtogd2 Uncommitted Executable location
/usr/bin/webpng Uncommitted Executable location
/usr/bin/gd2togif Uncommitted Executable location
/usr/bin/gdcmpgif Uncommitted Executable location
/usr/bin/giftogd2 Uncommitted Executable location
/usr/bin/gd2time Uncommitted Executable location
/usr/bin/gdlib-config Uncommitted Executable location
/usr/lib/libgd.so.2.0.0 Uncommitted GD Library
/usr/lib/libgd.so.2 Uncommitted Symbolic link
/usr/lib/libgd.so Uncommitted Symbolic link
/usr/include/gd2/ Uncommitted Include files
4. References
[1] http://www.libgd.org/
[2] http://www.php.net/
[3] http://www.boutell.com/
--
Stefan Teleman
Sun Microsystems, Inc.
Stefan.Teleman at Sun.COM