Hello community,
here is the log from the commit of package perl-GD
checked in at Thu Jul 13 17:56:29 CEST 2006.
--------
--- perl-GD/perl-GD.changes 2006-01-25 21:39:42.000000000 +0100
+++ perl-GD/perl-GD.changes 2006-07-13 12:55:12.000000000 +0200
@@ -1,0 +2,6 @@
+Thu Jul 13 11:12:05 CEST 2006 - anicka@suse.cz
+
+- update to 2.34
+ * many bugfixes since 2.30 added
+
+-------------------------------------------------------------------
Old:
----
GD-2.30.tar.bz2
New:
----
GD-2.34.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-GD.spec ++++++
--- /var/tmp/diff_new_pack.PgJ1aU/_old 2006-07-13 17:55:20.000000000 +0200
+++ /var/tmp/diff_new_pack.PgJ1aU/_new 2006-07-13 17:55:20.000000000 +0200
@@ -1,18 +1,18 @@
#
-# spec file for package perl-GD (Version 2.30)
+# spec file for package perl-GD (Version 2.34)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://bugs.opensuse.org
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: perl-GD
BuildRequires: freetype2-devel gd-devel libjpeg-devel libpng-devel xorg-x11-devel
-Version: 2.30
+Version: 2.34
Release: 1
Provides: GD
Requires: perl = %{perl_version}
@@ -76,6 +76,9 @@
/var/adm/perl-modules/%{name}
%changelog -n perl-GD
+* Thu Jul 13 2006 - anicka@suse.cz
+- update to 2.34
+ * many bugfixes since 2.30 added
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Jan 03 2006 - anicka@suse.cz
++++++ GD-2.30.tar.bz2 -> GD-2.34.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/ChangeLog new/GD-2.34/ChangeLog
--- old/GD-2.30/ChangeLog 2005-10-19 09:03:12.000000000 +0200
+++ new/GD-2.34/ChangeLog 2006-06-01 21:56:31.000000000 +0200
@@ -1,3 +1,18 @@
+2.34 Added a check for stray gd.h include files from older installations. If any are
+ found, Makefile.PL will issue a warning.
+ Fixed incorrect documentation of GD::Simple->string() method. The method call
+ *does* move the pen.
+2.33 Added appropriate #ifdefs to allow to compile under version 5.6.0 (due to lack of
+ threading macros before 5.8).
+2.32 Added a GD::Simple->HSVtoRGB() method.
+ Documentation fixes from Mark Manning.
+ Added a clear() method to GD::Polygon to remove all vertices.
+2.31 Fixed GD::Simple->transparent to support symbolic color names.
+ Made changes that should render the module thread-safe.
+ Changed newSVpv calls to newSVpvn, in hopes of improving performance.
+ Added a GD::Simple->HSVtoRGB() method.
+ Fixed incorrect freeing of user-provided raw data in newFromGdData() and newFromGd2Data()
+ (this caused segfaults; patch provided by Nigel Sandever)
2.30 Migrated polyline() support into GD::Simple.
2.29 Better support for fonts and brushed patterns in GD::Simple
2.28 Having troubles getting all the modules installed correctly. Should work now.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/GD/Polygon.pm new/GD-2.34/GD/Polygon.pm
--- old/GD-2.30/GD/Polygon.pm 2005-08-06 16:47:43.000000000 +0200
+++ new/GD-2.34/GD/Polygon.pm 2006-03-08 21:12:34.000000000 +0100
@@ -52,6 +52,11 @@
undef $self->{'points'};
}
+sub clear {
+ my $self = shift;
+ $self->{'points'} = [];
+}
+
# add an x,y vertex to the polygon
sub addPt {
my($self,$x,$y) = @_;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/GD/Simple.pm new/GD-2.34/GD/Simple.pm
--- old/GD-2.30/GD/Simple.pm 2005-10-19 08:57:35.000000000 +0200
+++ new/GD-2.34/GD/Simple.pm 2006-06-01 21:55:28.000000000 +0200
@@ -423,12 +423,12 @@
=item $img->string($string)
This method draws the indicated string starting at the current
-position of the pen. The pen is B<not> moved. Depending on the font
-selected with the font() method, this will use either a bitmapped GD
-font or a TrueType font. The angle of the pen will be consulted when
-drawing the text. For TrueType fonts, any angle is accepted. For GD
-bitmapped fonts, the angle can be either 0 (draw horizontal) or -90
-(draw upwards).
+position of the pen. The pen is moved to the end of the drawn string.
+Depending on the font selected with the font() method, this will use
+either a bitmapped GD font or a TrueType font. The angle of the pen
+will be consulted when drawing the text. For TrueType fonts, any angle
+is accepted. For GD bitmapped fonts, the angle can be either 0 (draw
+horizontal) or -90 (draw upwards).
For consistency between the TrueType and GD font behavior, the string
is always drawn so that the current position of the pen corresponds to
@@ -678,6 +678,12 @@
return $self->colorResolve($r,$g,$b);
}
+sub transparent {
+ my $self = shift;
+ my $index = $self->translate_color(@_);
+ $self->gd->transparent($index);
+}
+
=item $index = $img->alphaColor(@args,$alpha)
Creates an alpha color. You may pass either an (r,g,b) triple or a
@@ -724,8 +730,6 @@
Return the internal GD::Image object. Usually you will not need to
call this since all GD methods are automatically referred to this object.
-=back
-
=cut
sub gd { shift->{gd} }
@@ -750,6 +754,103 @@
}
}
+=item ($red,$green,$blue) = GD::Simple->HSVtoRGB($hue,$saturation,$value)
+
+Convert a Hue/Saturation/Value (HSV) color into an RGB triple. The
+hue, saturation and value are integers from 0 to 255.
+
+=cut
+
+sub HSVtoRGB {
+ my $self = shift;
+ @_ == 3 or croak "Usage: GD::Simple->HSVtoRGB(\$hue,\$saturation,\$value)";
+
+ my ($h,$s,$v)=@_;
+ my ($r,$g,$b,$i,$f,$p,$q,$t);
+
+ if( $s == 0 ) {
+ ## achromatic (grey)
+ return ($v,$v,$v);
+ }
+ $h %= 255;
+ $s /= 255; ## scale saturation from 0.0-1.0
+ $h /= 255; ## scale hue from 0 to 1.0
+ $h *= 360; ## and now scale it to 0 to 360
+
+ $h /= 60; ## sector 0 to 5
+ $i = $h % 6;
+ $f = $h - $i; ## factorial part of h
+ $p = $v * ( 1 - $s );
+ $q = $v * ( 1 - $s * $f );
+ $t = $v * ( 1 - $s * ( 1 - $f ) );
+
+ if($i<1) {
+ $r = $v;
+ $g = $t;
+ $b = $p;
+ } elsif($i<2){
+ $r = $q;
+ $g = $v;
+ $b = $p;
+ } elsif($i<3){
+ $r = $p;
+ $g = $v;
+ $b = $t;
+ } elsif($i<4){
+ $r = $p;
+ $g = $q;
+ $b = $v;
+ } elsif($i<5){
+ $r = $t;
+ $g = $p;
+ $b = $v;
+ } else {
+ $r = $v;
+ $g = $p;
+ $b = $q;
+ }
+ return (int($r+0.5),int($g+0.5),int($b+0.5));
+}
+
+=item ($hue,$saturation,$value) = GD::Simple->RGBtoHSV($hue,$saturation,$value)
+
+Convert a Red/Green/Blue (RGB) value into a Hue/Saturation/Value (HSV)
+triple. The hue, saturation and value are integers from 0 to 255.
+
+=back
+
+=cut
+
+sub RGBtoHSV {
+ my $self = shift;
+ my ($r, $g ,$bl) = @_;
+ my ($min,undef,$max) = sort {$a<=>$b} ($r,$g,$bl);
+ return (0,0,0) unless $max > 0;
+
+ my $v = $max;
+ my $s = 255 * ($max - $min)/$max;
+ my $h;
+ my $range = $max - $min;
+
+ if ($range == 0) { # all colors are equal, so monochrome
+ return (0,0,$max);
+ }
+
+ if ($max == $r) {
+ $h = 60 * ($g-$bl)/$range;
+ }
+ elsif ($max == $g) {
+ $h = 60 * ($bl-$r)/$range + 120;
+ }
+ else {
+ $h = 60 * ($r-$g)/$range + 240;
+ }
+
+ $h = int($h*255/360 + 0.5);
+
+ return ($h, $s, $v);
+}
+
1;
__DATA__
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/GD.pm new/GD-2.34/GD.pm
--- old/GD-2.30/GD.pm 2005-10-19 09:49:26.000000000 +0200
+++ new/GD-2.34/GD.pm 2006-06-01 21:54:45.000000000 +0200
@@ -16,7 +16,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
-$VERSION = '2.30';
+$VERSION = '2.34';
@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
@@ -163,10 +163,11 @@
drawings using a large number of graphics primitives, and emit the
drawings as PNG files.
-GD defines the following three classes:
+GD defines the following four classes:
=over 5
+
=item CGD::Image
An image class, which holds the image data and accepts graphic
@@ -182,6 +183,14 @@
A simple polygon object, used for storing lists of vertices prior to
rendering a polygon into an image.
+=item CGD::Simple
+
+A "simple" class that simplifies the GD::Image API and then adds a set
+of object-oriented drawing methods using turtle graphics, simplified
+font handling, ability to work in polar coordinates, HSV color spaces,
+and human-readable color names like "lightblue". Please see
+LGD::Simple for a description of these methods.
+
=back
A Simple Example:
@@ -189,7 +198,7 @@
#!/usr/local/bin/perl
use GD;
-
+
# create a new image
$im = new GD::Image(100,100);
@@ -373,7 +382,7 @@
=item B<$image = GD::Image-E<gt>newFromGif($file)>
-=item B<$image = GD::Image-E<gt>newFromGif($data)>
+=item B<$image = GD::Image-E<gt>newFromGifData($data)>
These methods will create an image from a GIF file. They work just
like newFromPng() and newFromPngData(), and will accept the same
@@ -418,7 +427,7 @@
=item B<$image = GD::Image-E<gt>newFromGd2Part($file,srcX,srcY,width,height)>
This class method allows you to read in just a portion of a GD2 image
-file. In additionto a filehandle, it accepts the top-left corner and
+file. In addition to a filehandle, it accepts the top-left corner and
dimensions (width,height) of the region of the image to read. For
example:
@@ -502,7 +511,7 @@
$gifdata .= $image->gifanimend; # finish the animated GIF
print $gifdata; # write animated gif to STDOUT
-If you do not wish to to store the data in memory, you can print it to
+If you do not wish to store the data in memory, you can print it to
stdout or a file.
The image that you call gifanimbegin on is used to set the image size,
@@ -597,13 +606,6 @@
to 127 (transparent). The C<alphaBlending> function changes the way this
alpha channel affects the resulting image.
-=item B<$index = $image-E<gt>colorAllocateAlpha(reg,green,blue,alpha)>
-
-This allocates a color with the specified red, green, and blue components,
-plus the specified alpha channel. The alpha value may range from 0 (opaque)
-to 127 (transparent). The C<alphaBlending> function changes the way this
-alpha channel affects the resulting image.
-
=item B<$image-E<gt>colorDeallocate(colorIndex)>
This marks the color at the specified index as being ripe for
@@ -630,7 +632,7 @@
This also attempts to return the color closest in the color table to the
red green and blue components specified. It uses a Hue/White/Black
-color representation to make the selected colour more likely to match
+color representation to make the selected color more likely to match
human perceptions of similar colors.
If no colors have yet been
@@ -659,7 +661,7 @@
$rosey = $myImage->colorResolve(255,100,80);
warn "Everything's coming up roses.\n" if $rosey >= 0;
-=item B<$colorsTotal = $image-E<gt>colorsTotal)> I<object method>
+=item B<$colorsTotal = $image-E<gt>colorsTotal> I<object method>
This returns the total number of colors allocated in the object.
@@ -840,7 +842,7 @@
=head2 Drawing Commands
-These methods allow you to draw lines, rectangles, and elipses, as
+These methods allow you to draw lines, rectangles, and ellipses, as
well as to perform various special operations like flood-fill.
=over 4
@@ -866,7 +868,7 @@
Example:
- # Draw a diagonal line using the currently defind
+ # Draw a diagonal line using the currently defined
# paintbrush pattern.
$myImage->line(0,0,150,150,gdBrushed);
@@ -1002,7 +1004,7 @@
gdNoFill outline the arc or chord
gdEdged connect beginning and ending of the arc to the center
-gdArc and gdChord are mutally exclusive. gdChord just connects the
+gdArc and gdChord are mutually exclusive. gdChord just connects the
starting and ending angles with a straight line, while gdArc produces
a rounded edge. gdPie is a synonym for gdArc. gdNoFill indicates that
the arc or chord should be outlined, not filled. gdEdged, used
@@ -1134,7 +1136,7 @@
sizes for the source and destination rectangles. The source and
destination rectangle's are specified independently by (srcW,srcH) and
(destW,destH) respectively. copyResized() will stretch or shrink the
-image to accomodate the size requirements.
+image to accommodate the size requirements.
Example:
@@ -1163,7 +1165,7 @@
Like copyResized() but the $angle argument specifies an arbitrary
amount to rotate the image clockwise (in degrees). In addition, $dstX
and $dstY species the B<center> of the destination image, and not the
-topleft corner.
+top left corner.
=item B<$image-E<gt>trueColorToPalette([$dither], [$colors])>
@@ -1237,7 +1239,7 @@
=item B<$image-E<gt>string($font,$x,$y,$string,$color)>
-This method draws a string startin at position (x,y) in the specified
+This method draws a string starting at position (x,y) in the specified
font and color. Your choices of fonts are gdSmallFont, gdMediumBoldFont,
gdTinyFont, gdLargeFont and gdGiantFont.
@@ -1308,7 +1310,7 @@
using an inexpensive operation. You can use this to perform layout
operations prior to drawing.
-Using a negative color index will disable anti-aliasing, as described
+Using a negative color index will disable antialiasing, as described
in the libgd manual page at
Lhttp://www.boutell.com/gd/manual2.0.9.html#gdImageStringFT.
@@ -1372,7 +1374,7 @@
The call signature is somewhat complex. Here is an excerpt from the
libgd manual page:
-Draws the text strings specified by top and bottom on im, curved along
+Draws the text strings specified by top and bottom on the image, curved along
the edge of a circle of radius radius, with its center at cx and
cy. top is written clockwise along the top; bottom is written
counterclockwise along the bottom. textRadius determines the "height"
@@ -1430,7 +1432,7 @@
By default, GD (libgd 2.0.2 and above) does not attempt to save full
alpha channel information (as opposed to single-color transparency)
when saving PNG images. (PNG is currently the only output format
-supported by gd which can accommodate alpa channel information.) This
+supported by gd which can accommodate alpha channel information.) This
saves space in the output file. If you wish to create an image with
alpha channel information for use with tools that support it, call
C to turn on saving of such information, and call
@@ -1460,7 +1462,7 @@
=item B<($width,$height) = $image-E<gt>getBounds()>
This method will return a two-member list containing the width and
-height of the image. You query but not not change the size of the
+height of the image. You query but not change the size of the
image once it's created.
=item B<$width = $image-E<gt>width>
@@ -1471,12 +1473,12 @@
=item B<$is_truecolor = $image-E<gt>isTrueColor()>
-This method will return a boolean representing whether the image
+This method will return a Boolean representing whether the image
is true color or not.
=item B<$flag = $image1-E<gt>compare($image2)>
-Compare two images and return a bitmap describing the differenes
+Compare two images and return a bitmap describing the differences
found, if any. The return value must be logically ANDed with one or
more constants in order to determine the differences. The following
constants are available:
@@ -1565,7 +1567,12 @@
Delete the specified vertex, returning its value.
- ($x,$y) = $poly->deletePt(1);
+ ($x,$y) = $poly->deletePt(1);
+
+
+=item B<$poly-E<gt>clear()>
+
+Delete all vertices, restoring the polygon to its initial empty state.
=item B<$poly-E<gt>toPt($dx,$dy)>
@@ -1585,7 +1592,7 @@
=item B<@vertices = $poly-E<gt>vertices>
-Return a list of all the verticies in the polygon object. Each member
+Return a list of all the vertices in the polygon object. Each member
of the list is a reference to an (x,y) array.
@vertices = $poly->vertices;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/GD.xs new/GD-2.34/GD.xs
--- old/GD-2.30/GD.xs 2005-10-19 05:18:39.000000000 +0200
+++ new/GD-2.34/GD.xs 2006-03-31 01:20:07.000000000 +0200
@@ -51,6 +51,10 @@
#define snprintf _snprintf
#endif
+#ifndef START_MY_CXT
+static truecolor_default = 0;
+#endif
+
static int
not_here(char *s)
{
@@ -496,12 +500,6 @@
(gdImageTrueColorPixel(dst,dx,dy)=gdImageTrueColorPixel(src,sx,sy)) : \
(gdImagePalettePixel(dst,dx,dy)=gdImagePalettePixel(src,sx,sy))
-/* Current image true color default
- * 0 - create palette based images by default
- * 1 - create true color images by default
- */
-static int truecolor_default = 0;
-
/* Check the image format being returned */
void
gd_chkimagefmt(GD__Image image, int truecolor) {
@@ -513,12 +511,36 @@
}
}
+/* GLOBAL THREAD-SAFE DATA */
+
+#ifdef START_MY_CXT
+
+#define MY_CXT_KEY "GD::_guts" XS_VERSION
+typedef struct {
+ /* Current image true color default
+ * 0 - create palette based images by default
+ * 1 - create true color images by default
+ */
+ int truecolor_default;
+} my_cxt_t;
+
+START_MY_CXT
+#endif
+
MODULE = GD PACKAGE = GD
double
constant(name)
char * name
+BOOT:
+{
+#ifdef START_MY_CXT
+ MY_CXT_INIT;
+ MY_CXT.truecolor_default = 0;
+#endif
+}
+
MODULE = GD PACKAGE = GD::Image PREFIX=gd
# Set the new image true color default
@@ -529,12 +551,20 @@
char * packname
PROTOTYPE: $$
PREINIT:
- int previous_value;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int previous_value = MY_CXT.truecolor_default;
+#else
+ int previous_value = truecolor_default;
+#endif
CODE:
{
- previous_value = truecolor_default;
if (items > 1)
- truecolor_default = (int)SvIV(ST(1));
+#ifdef START_MY_CXT
+ MY_CXT.truecolor_default = (int)SvIV(ST(1));
+#else
+ truecolor_default = (int)SvIV(ST(1));
+#endif
RETVAL = previous_value;
}
OUTPUT:
@@ -547,7 +577,12 @@
int y
PROTOTYPE: $;$$$
PREINIT:
- int truecolor = truecolor_default;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
+ int truecolor = truecolor_default;
+#endif
CODE:
{
gdImagePtr theImage;
@@ -570,8 +605,12 @@
InputStream filehandle
PROTOTYPE: $$;$
PREINIT:
- int truecolor = truecolor_default;
- SV* errormsg;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
+ int truecolor = truecolor_default;
+#endif
CODE:
RETVAL = (GD__Image) GDIMAGECREATEFROMPNG(filehandle);
if (items > 2) truecolor = (int)SvIV(ST(2));
@@ -588,8 +627,12 @@
gdIOCtx* ctx;
char* data;
STRLEN len;
- SV* errormsg;
- int truecolor = truecolor_default;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
+ int truecolor = truecolor_default;
+#endif
CODE:
data = SvPV(imageData,len);
ctx = newDynamicCtx(data,len);
@@ -613,7 +656,6 @@
CODE:
data = SvPV(imageData,len);
RETVAL = (GD__Image) gdImageCreateFromGdPtr(len,(void*) data);
- safefree(data);
OUTPUT:
RETVAL
@@ -628,7 +670,6 @@
CODE:
data = SvPV(imageData,len);
RETVAL = (GD__Image) gdImageCreateFromGd2Ptr(len,(void*) data);
- safefree(data);
OUTPUT:
RETVAL
@@ -642,8 +683,12 @@
gdIOCtx* ctx;
char* data;
STRLEN len;
- SV* errormsg;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
int truecolor = truecolor_default;
+#endif
CODE:
data = SvPV(imageData,len);
ctx = newDynamicCtx(data,len);
@@ -665,7 +710,12 @@
gdIOCtx* ctx;
char* data;
STRLEN len;
- int truecolor = truecolor_default;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
+ int truecolor = truecolor_default;
+#endif
CODE:
data = SvPV(imageData,len);
ctx = newDynamicCtx(data,len);
@@ -713,8 +763,12 @@
InputStream filehandle
PROTOTYPE: $$;$
PREINIT:
- SV* errormsg;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
int truecolor = truecolor_default;
+#endif
CODE:
RETVAL = GDIMAGECREATEFROMJPEG(filehandle);
if (items > 2) truecolor = (int)SvIV(ST(2));
@@ -791,8 +845,12 @@
InputStream filehandle
PROTOTYPE: $$;$
PREINIT:
- SV* errormsg;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
int truecolor = truecolor_default;
+#endif
CODE:
RETVAL = GDIMAGECREATEFROMGIF(filehandle);
OUTPUT:
@@ -807,8 +865,12 @@
gdIOCtx* ctx;
char* data;
STRLEN len;
- SV* errormsg;
+#ifdef START_MY_CXT
+ dMY_CXT;
+ int truecolor = MY_CXT.truecolor_default;
+#else
int truecolor = truecolor_default;
+#endif
CODE:
data = SvPV(imageData,len);
ctx = newDynamicCtx(data,len);
@@ -834,7 +896,6 @@
GD::Image image
PROTOTYPE: $;$
PREINIT:
- SV* errormsg;
CODE:
{
void* data;
@@ -846,7 +907,7 @@
} else {
data = (void *) gdImagePngPtr(image,&size);
}
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
}
OUTPUT:
@@ -873,7 +934,7 @@
sv_setpv(errormsg,"libgd was not built with jpeg support\n");
XSRETURN_EMPTY;
}
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
}
OUTPUT:
@@ -888,14 +949,13 @@
int loops
PROTOTYPE: $$$
PREINIT:
- SV* errormsg;
CODE:
{
void* data;
int size;
#ifdef HAVE_ANIMGIF
data = (void *) gdImageGifAnimBeginPtr(image,&size,globalcm,loops);
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
#else
die("libgd 2.0.33 or higher required for animated GIF support");
@@ -920,7 +980,7 @@
int size;
#ifdef HAVE_ANIMGIF
data = (void *) gdImageGifAnimAddPtr(image,&size,localcm,leftofs,topofs,delay,disposal,previm);
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
#else
die("libgd 2.0.33 or higher required for animated GIF support");
@@ -939,7 +999,7 @@
int size;
#ifdef HAVE_ANIMGIF
data = (void *) gdImageGifAnimEndPtr(&size);
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
#else
die("libgd 2.0.33 or higher required for animated GIF support");
@@ -966,7 +1026,7 @@
sv_setpv(errormsg,"libgd was not built with WBMP support\n");
XSRETURN_EMPTY;
}
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
}
OUTPUT:
@@ -990,7 +1050,7 @@
sv_setpv(errormsg,"libgd was not built with gif support\n");
XSRETURN_EMPTY;
}
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
}
OUTPUT:
@@ -1007,7 +1067,7 @@
void* data;
int size;
data = gdImageGdPtr(image,&size);
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
}
OUTPUT:
@@ -1022,7 +1082,7 @@
void* data;
int size;
data = gdImageGd2Ptr(image,0,GD2_FMT_COMPRESSED,&size);
- RETVAL = newSVpv((char*) data,size);
+ RETVAL = newSVpvn((char*) data,size);
gdFree(data);
}
OUTPUT:
@@ -2156,7 +2216,7 @@
int fgcolor
PROTOTYPE: $$$$$$$$$$$
PREINIT:
- char* err;
+ char* err;
SV* errormsg;
CODE:
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/META.yml new/GD-2.34/META.yml
--- old/GD-2.30/META.yml 2005-10-19 09:49:33.000000000 +0200
+++ new/GD-2.34/META.yml 2006-06-01 22:00:45.000000000 +0200
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: GD
-version: 2.30
+version: 2.34
version_from: GD.pm
installdirs: site
requires:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/Makefile.PL new/GD-2.34/Makefile.PL
--- old/GD-2.30/Makefile.PL 2005-10-19 05:22:22.000000000 +0200
+++ new/GD-2.34/Makefile.PL 2006-06-01 21:59:19.000000000 +0200
@@ -1,14 +1,12 @@
use ExtUtils::MakeMaker qw(prompt WriteMakefile);
+use Config;
+use strict;
require 5.6.0;
unless (@ARGV) {
warn < {'bdf_scripts/bdf2gdfont.PLS' => 'bdf_scripts/bdf2gdfont.pl',
'GD/Image.pm.PLS' => 'GD/Image.pm',
},
+# 'CFLAGS' => '-nostdinclude',
'EXE_FILES' => ['bdf_scripts/bdf2gdfont.pl'],
'AUTHOR' => 'Lincoln Stein (lstein@cshl.org)',
'ABSTRACT' => 'Interface to Gd Graphics Library',
@@ -247,6 +248,8 @@
'DEFINE' => $DEFINES,
);
+exit 0;
+
sub try_to_autoconfigure {
my ($options,$lib_gd_path,$INC,$LIBPATH,$LIBS) = @_;
my $config = `gdlib-config --all`;
@@ -256,11 +259,12 @@
my ($version) = $config =~ /^GD library\s+(\S+)/m;
warn "Configuring for libgd version $version.\n";
- my ($cflags) = $config =~ /^cflags:\s+(.+)/m;
- my ($ldflags) = $config =~ /^ldflags:\s+(.+)/m;
- my ($libs) = $config =~ /^libs:\s+(.+)/m;
- my ($libdir) = $config =~ /^libdir:\s+(.+)/m;
- my ($features) = $config =~ /^features:\s+(.+)/m;
+ my ($cflags) = $config =~ /^cflags:\s+(.+)/m;
+ my ($ldflags) = $config =~ /^ldflags:\s+(.+)/m;
+ my ($libs) = $config =~ /^libs:\s+(.+)/m;
+ my ($libdir) = $config =~ /^libdir:\s+(.+)/m;
+ my ($features) = $config =~ /^features:\s+(.+)/m;
+ my ($includedir) = $config =~ /^includedir:\s+(.+)/m;
@$INC = map {s/^-I// && "-I$_"} split /\s+/,$cflags;
@$LIBPATH = map {s/^-L// && "-L$_"} split /\s+/,$ldflags;
@@ -273,6 +277,31 @@
my ($minor) = $version =~ /^2\.\d+\.(\d+)$/;
$$options .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33" if defined($minor) && $minor >= 33;
+
+ my @correct_inc = map {s/^-I// && $_} split /\s+/,$cflags;
+ check_for_stray_headers(@correct_inc);
+}
+
+sub check_for_stray_headers {
+ my @official_libraries = @_;
+ my %official_libraries = map {$_=>1} @official_libraries;
+ print STDERR "Checking for stray libgd header files...";
+ my $cc = $Config{'cc'};
+ my $data = `$cc -print-search-dirs`;
+ $data ||= '';
+ my ($libraries) = $data =~ /^libraries: =(.+)/m;
+ my %libraries = map {$_=>1} (split /:/,$libraries),'/include','/usr/include','/usr/local/include','/opt/include','/usr/X11R6/include';
+ my $problems;
+ foreach (keys %libraries) {
+ s/\blib\b/include/;
+ next if $official_libraries{$_};
+
+ next unless -e "${_}/gd.h";
+ warn "\n\n** WARNING: found gd.h header file in ${_}gd.h, but it is expected at $official_libraries[0]/gd.h. This may cause compile errors! **\n";
+ $problems++;
+ }
+ print STDERR $problems ? "** Possible problems found **\n" : "none found.\n";
+ print STDERR "\n";
}
sub MY::postamble {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/README new/GD-2.34/README
--- old/GD-2.30/README 2005-10-19 05:18:39.000000000 +0200
+++ new/GD-2.34/README 2006-06-01 21:15:22.000000000 +0200
@@ -282,7 +282,31 @@
See (1).
-4. My scripts fail with "Can't locate object method 'png' via package "GD::Image".
+4. The %! thing doesn't compile at all! I'm getting lots of compile errors!
+
+ Does "make" fail with messages like these?
+
+ GD.xs: In function 'newDynamicCtx':
+ GD.xs:440: error: 'gdIOCtx' has no member named 'gd_free'
+ GD.xs: In function 'gd_cloneDim':
+ GD.xs:460: error: 'struct gdImageStruct' has no member named 'alpha'
+ GD.xs:460: error: 'struct gdImageStruct' has no member named 'alpha'
+ GD.xs:466: error: 'struct gdImageStruct' has no member named 'thick'
+ GD.xs:466: error: 'struct gdImageStruct' has no member named 'thick'
+
+ If so, then you may have an old gd.h include file located somewhere
+ in your system include path. Please find it and remove it. A typical
+ location is /usr/include/gd.h. The way to make sure you are removing
+ the correct gd.h is to run "gdlib-config --cflags" to find out where
+ the current gd.h lives:
+
+ % gdlib-config --cflags
+ -I/usr/local/include
+
+ This tells you that /usr/local/include/gd.h is the correct gd.h. Please
+ find and remove any other gd.h.
+
+5. My scripts fail with "Can't locate object method 'png' via package "GD::Image".
libgd can now be built with support for one or more of the PNG, GIF, XPM or
JPEG formats. If one or more of these formats are not supported by libgd, then
@@ -299,25 +323,25 @@
As of libgd 2.0.33, GIF support is always compiled in, so (for the time being!)
this is a safe fallback.
-5. Is there a utility to convert X Windows BDF fonts into GD fonts.
+6. Is there a utility to convert X Windows BDF fonts into GD fonts.
Yes. See the utility bdf2gdfont.pl. Run "bdf2gdfont.pl -h" to get help
on using this.
-6. Does GD run with Macintosh OS X?
+7. Does GD run with Macintosh OS X?
Yes. GD compiles just fine under OSX. However, you may need to
remove old versions of libgd, libpng, and libz and reinstall the
current versions before you try to install GD.
-7. Does GD run with Win32 Perl?
+8. Does GD run with Win32 Perl?
The latest ActiveState binaries for Win32 systems come with GD
already compiled in and ready to go. I don't own any Win32 systems,
and cannot provide you with help in compiling GD from scratch on such
systems.
-8. GD won't compile on system XX.
+9. GD won't compile on system XX.
Because libgd relies on multiple external libraries, GD does as well.
Unfortunately, different systems place their libraries in different
@@ -338,19 +362,19 @@
thing to do is to recompile Perl from source code, thereby ensuring
that it is complete.
-9. When I try to load an XPM file, all I get is blackness!
+10. When I try to load an XPM file, all I get is blackness!
The libgd createFromXpm() function works with some XPM files, and
not with others. The problem is buried deep in the libXpm library
somewhere.
-10. The stringFTCircle() method doesn't work!
+11. The stringFTCircle() method doesn't work!
I know. I think this might be a problem in libgd because I have
never gotten it to work as a C program. If you have any insight
into this problem let me know.
-11. Test XX fails
+12. Test XX fails
The regression tests for GD involve generating images, saving
them as PNG, JPEG or GIF files, and then comparing the files bit-for-bit
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/GD-2.30/bdf_scripts/bdf2gdfont.pl new/GD-2.34/bdf_scripts/bdf2gdfont.pl
--- old/GD-2.30/bdf_scripts/bdf2gdfont.pl 2004-11-12 15:42:12.000000000 +0100
+++ new/GD-2.34/bdf_scripts/bdf2gdfont.pl 2004-11-09 23:16:47.000000000 +0100
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# Simple convertor from bdf to loadable GD font format.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit-help@opensuse.org