]> git.pld-linux.org Git - packages/gd.git/commitdiff
This commit was manufactured by cvs2git to create branch 'RA-branch'.
authorcvs2git <feedback@pld-linux.org>
Sun, 7 Nov 2004 17:05:42 +0000 (17:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Sprout from master 2002-08-10 22:43:54 UTC Jakub Bogusz <qboosh@pld-linux.org> '- fix for gdTiled-related SEGV (uninitialized variable) (gdTiled-segv patch)'
Cherrypick from master 2004-08-12 12:50:57 UTC Paweł Gołaszewski <blues@pld-linux.org> '- small fix':
    gd-fontpath.patch -> 1.4
    gd-no_ldflags_in_gdlib-config.patch -> 1.4
    gd-rotate_from_php.patch -> 1.2
Cherrypick from master 2004-11-07 17:05:42 UTC Paweł Gołaszewski <blues@pld-linux.org> '- release 1.1':
    gd.spec -> 1.109

gd-fontpath.patch
gd-no_ldflags_in_gdlib-config.patch [new file with mode: 0644]
gd-rotate_from_php.patch [new file with mode: 0644]
gd.spec

index 43b0836aaa02387fc4cd9b6e7a670d41c80ab0cb..8f836ed53bbf45ea312b9136f78274c4432f2355 100644 (file)
@@ -1,11 +1,11 @@
---- gd-2.0.1/gd.h.orig Sat Aug 10 17:22:09 2002
-+++ gd-2.0.1/gd.h      Sat Aug 10 18:08:33 2002
-@@ -6,7 +6,7 @@
- #endif
- /* default fontpath for unix systems */
--#define DEFAULT_FONTPATH "/usr/share/fonts/truetype"
+--- gd-2.0.23/gd.h.orig        2004-04-21 23:19:49.000000000 +0200
++++ gd-2.0.23/gd.h     2004-04-21 23:24:10.433748224 +0200
+@@ -40,7 +40,7 @@
+ /* 2.0.23: more Type 1 fonts */
+ #ifndef DEFAULT_FONTPATH
+ /* default fontpath for unix systems  - whatever happened to standards ! */
+-#define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:/usr/lib/X11/fonts/Type1:/usr/openwin/lib/X11/fonts/Type1"
 +#define DEFAULT_FONTPATH "/usr/share/fonts/TTF:/usr/share/fonts/Type1"
+ #endif
+ #ifndef PATHSEPARATOR
  #define PATHSEPARATOR ":"
- /* gd.h: declarations file for the graphic-draw module.
diff --git a/gd-no_ldflags_in_gdlib-config.patch b/gd-no_ldflags_in_gdlib-config.patch
new file mode 100644 (file)
index 0000000..c4050e3
--- /dev/null
@@ -0,0 +1,20 @@
+--- gd-2.0.12/config/gdlib-config.in~  Wed Apr 23 19:26:02 2003
++++ gd-2.0.12/config/gdlib-config.in   Wed Apr 23 19:26:02 2003
+@@ -62,7 +62,7 @@
+       echo @GDLIB_REVISION@
+       ;;
+     --ldflags)
+-      echo @LDFLAGS@
++      echo "-L/usr/X11R6/lib"
+       ;;
+     --libs)
+       echo @LIBS@
+@@ -74,7 +71,7 @@
+       echo "GD library  @VERSION@"
+       echo "includedir: $includedir"
+       echo "cflags:     -I@includedir@"
+-      echo "ldflags:    @LDFLAGS@"
++      echo "ldflags:    -L/usr/X11R6/lib"
+       echo "libs:       @LIBS@"
+       echo "libdir:     $libdir"
+       ;;
diff --git a/gd-rotate_from_php.patch b/gd-rotate_from_php.patch
new file mode 100644 (file)
index 0000000..69f6dc2
--- /dev/null
@@ -0,0 +1,561 @@
+--- ./gd.c.org Thu Jul  1 23:30:30 2004
++++ ./gd.c     Thu Aug 12 14:42:03 2004
+@@ -738,14 +738,27 @@
+     default:
+       if (gdImageBoundsSafeMacro (im, x, y))
+       {
+-        if (im->trueColor)
+-          {
+-            if (im->alphaBlendingFlag)
+-              {
+-                im->tpixels[y][x] = gdAlphaBlend (im->tpixels[y][x], color);
+-              }
+-            else
+-              {
++        if (im->trueColor) {
++            if (im->alphaBlendingFlag) {
++                    switch (im->alphaBlendingFlag) {
++                            default:
++                                    im->tpixels[y][x] = gdAlphaBlend (im->tpixels[y][x], color);
++                                    break;
++                            case gdEffectReplace:
++                                    im->tpixels[y][x] = color;
++                                    break;
++/*                          case gdEffectAlphaBlend:
++                                    im->tpixels[y][x] = gdAlphaBlend(im->tpixels[y][x], color);
++                                    break;
++                            case gdEffectNormal:
++                                    im->tpixels[y][x] = gdFullAlphaBlend(im->tpixels[y][x], color);
++                                    break;
++                            case gdEffectOverlay :
++                                    im->tpixels[y][x] = gdLayerOverlay(im->tpixels[y][x], color);
++                                    break; */
++                    }
++                    
++            } else {
+                 im->tpixels[y][x] = color;
+               }
+           }
+@@ -2261,6 +2274,496 @@
+     }
+ }
++/* Taken from php... dirty hack... */
++/*
++ * Rotate function Added on 2003/12 
++ * by Pierre-Alain Joye (pajoye@pearfr.org)
++ **/
++/* Begin rotate function */
++#ifdef ROTATE_PI
++#undef ROTATE_PI
++#endif /* ROTATE_PI */
++
++#define ROTATE_DEG2RAD  3.1415926535897932384626433832795/180
++BGD_DECLARE(void) gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack)
++{
++        typedef int (*FuncPtr)(gdImagePtr, int, int);
++        int i, r, g, b, a, clrBackR, clrBackG, clrBackB, clrBackA;
++        FuncPtr f;
++
++        int pxlOldLeft, pxlLeft=0, pxlSrc; 
++
++        /* Keep clrBack as color index if required */
++        if (src->trueColor) {
++                pxlOldLeft = clrBack; 
++                f = gdImageGetTrueColorPixel;
++        } else {
++                pxlOldLeft = clrBack;
++                clrBackR = gdImageRed(src, clrBack);
++                clrBackG = gdImageGreen(src, clrBack);
++                clrBackB = gdImageBlue(src, clrBack);
++                clrBackA = gdImageAlpha(src, clrBack);
++                clrBack =  gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
++                f = gdImageGetPixel;
++        }
++
++        for (i = 0; i < iOffset; i++) {
++                gdImageSetPixel (dst, i, uRow, clrBack);
++        }
++
++        if (i < dst->sx) {
++                gdImageSetPixel (dst, i, uRow, clrBack);
++        }
++
++        for (i = 0; i < src->sx; i++) {
++                pxlSrc = f (src,i,uRow);
++
++                r = (int)(gdImageRed(src,pxlSrc) * dWeight);
++                g = (int)(gdImageGreen(src,pxlSrc) * dWeight);
++                b = (int)(gdImageBlue(src,pxlSrc) * dWeight);
++                a = (int)(gdImageAlpha(src,pxlSrc) * dWeight);
++
++                pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a);
++
++                if (pxlLeft == -1) {
++                        pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a);
++                }
++
++                r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
++                g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft));
++                b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft));
++                a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft));
++
++        if (r>255) {
++                r = 255;
++        }
++
++                if (g>255) {
++                        g = 255;
++                }
++
++                if (b>255) {
++                        b = 255;
++                }
++
++                if (a>127) {
++                        a = 127;
++                }
++
++                pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
++
++                if (pxlSrc == -1) {
++                        pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a);
++                }
++
++                if ((i + iOffset >= 0) && (i + iOffset < dst->sx)) {
++                        gdImageSetPixel (dst, i+iOffset, uRow,  pxlSrc);
++                }
++
++                pxlOldLeft = pxlLeft;
++        }
++
++        i += iOffset;
++
++        if (i < dst->sx) {
++                gdImageSetPixel (dst, i, uRow, pxlLeft);
++        }
++
++        gdImageSetPixel (dst, iOffset, uRow, clrBack);
++
++        i--;
++
++        while (++i < dst->sx) {
++                gdImageSetPixel (dst, i, uRow, clrBack);
++        }
++}
++
++void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double dWeight, int clrBack)
++{
++        typedef int (*FuncPtr)(gdImagePtr, int, int);
++        int i, iYPos=0, r, g, b, a;
++        FuncPtr f;
++        int pxlOldLeft, pxlLeft=0, pxlSrc;
++
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++
++        for (i = 0; i<=iOffset; i++) {
++                gdImageSetPixel (dst, uCol, i, clrBack);
++        }
++        r = (int)((double)gdImageRed(src,clrBack) * dWeight);
++        g = (int)((double)gdImageGreen(src,clrBack) * dWeight);
++        b = (int)((double)gdImageBlue(src,clrBack) * dWeight);
++        a = (int)((double)gdImageAlpha(src,clrBack) * dWeight);
++
++        pxlOldLeft = gdImageColorAllocateAlpha(dst, r, g, b, a);
++
++        for (i = 0; i < src->sy; i++) {
++                pxlSrc = f (src, uCol, i);
++                iYPos = i + iOffset;
++
++                r = (int)((double)gdImageRed(src,pxlSrc) * dWeight);
++                g = (int)((double)gdImageGreen(src,pxlSrc) * dWeight);
++                b = (int)((double)gdImageBlue(src,pxlSrc) * dWeight);
++                a = (int)((double)gdImageAlpha(src,pxlSrc) * dWeight);
++
++                pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a);
++
++                if (pxlLeft == -1) {
++                        pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a);
++                }
++
++                r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
++                g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft));
++                b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft));
++                a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft));
++
++                if (r>255) {
++                        r = 255;
++                }
++
++                if (g>255) {
++                        g = 255;
++                }
++
++                if (b>255) {
++                        b = 255;
++                }
++
++                if (a>127) {
++                        a = 127;
++                }
++
++                pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
++
++                if (pxlSrc == -1) {
++                        pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a);
++                }
++
++                if ((iYPos >= 0) && (iYPos < dst->sy)) {
++                        gdImageSetPixel (dst, uCol, iYPos, pxlSrc);
++                }
++
++                pxlOldLeft = pxlLeft;
++        }
++
++        i = iYPos;
++        if (i < dst->sy) {
++                gdImageSetPixel (dst, uCol, i, pxlLeft);
++        }
++
++        i--;
++        while (++i < dst->sy) {
++                gdImageSetPixel (dst, uCol, i, clrBack);
++        }
++}
++
++/* Rotates an image by 90 degrees (counter clockwise) */
++BGD_DECLARE(gdImagePtr) gdImageRotate90 (gdImagePtr src)
++{
++        int uY, uX;
++        int c, r,g,b,a;
++        gdImagePtr dst;
++        typedef int (*FuncPtr)(gdImagePtr, int, int);
++        FuncPtr f;
++
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++        dst = gdImageCreateTrueColor(src->sy, src->sx);
++
++        if (dst != NULL) {
++                gdImagePaletteCopy (dst, src);
++
++                for (uY = 0; uY<src->sy; uY++) {
++                        for (uX = 0; uX<src->sx; uX++) {
++                                c = f (src, uX, uY);
++                                if (!src->trueColor) {
++                                        r = gdImageRed(src,c);
++                                        g = gdImageGreen(src,c);
++                                        b = gdImageBlue(src,c);
++                                        a = gdImageAlpha(src,c);
++                                        c = gdTrueColorAlpha(r, g, b, a);
++                                }
++                                gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c);
++                        }
++                }
++        }
++
++        return dst;
++}
++
++/* Rotates an image by 180 degrees (counter clockwise) */
++BGD_DECLARE(gdImagePtr) gdImageRotate180 (gdImagePtr src)
++{
++        int uY, uX;
++        int c,r,g,b,a;
++        gdImagePtr dst;
++        typedef int (*FuncPtr)(gdImagePtr, int, int);
++        FuncPtr f;
++
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++        dst = gdImageCreateTrueColor(src->sx, src->sy);
++
++        if (dst != NULL) {
++                gdImagePaletteCopy (dst, src);
++
++                for (uY = 0; uY<src->sy; uY++) {
++                        for (uX = 0; uX<src->sx; uX++) {
++                                c = f (src, uX, uY);
++                                if (!src->trueColor) {
++                                        r = gdImageRed(src,c);
++                                        g = gdImageGreen(src,c);
++                                        b = gdImageBlue(src,c);
++                                        a = gdImageAlpha(src,c);
++                                        c = gdTrueColorAlpha(r, g, b, a);
++                                }
++                                gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c);
++                        }
++                }
++        }
++
++        return dst;
++}
++
++/* Rotates an image by 270 degrees (counter clockwise) */
++BGD_DECLARE(gdImagePtr) gdImageRotate270 ( gdImagePtr src )
++{
++        int uY, uX;
++        int c,r,g,b,a;
++        gdImagePtr dst;
++        typedef int (*FuncPtr)(gdImagePtr, int, int);
++        FuncPtr f;
++
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++        dst = gdImageCreateTrueColor(src->sy, src->sx);
++
++        if (dst != NULL) {
++                gdImagePaletteCopy (dst, src);
++
++                for (uY = 0; uY<src->sy; uY++) {
++                        for (uX = 0; uX<src->sx; uX++) {
++                                c = f (src, uX, uY);
++                                if (!src->trueColor) {
++                                        r = gdImageRed(src,c);
++                                        g = gdImageGreen(src,c);
++                                        b = gdImageBlue(src,c);
++                                        a = gdImageAlpha(src,c);
++                                        c = gdTrueColorAlpha(r, g, b, a);
++                                }
++                                gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c);
++                        }
++                }
++        }
++
++        return dst;
++}
++
++BGD_DECLARE(gdImagePtr) gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
++{
++        typedef int (*FuncPtr)(gdImagePtr, int, int);
++        gdImagePtr dst1,dst2,dst3;
++        FuncPtr f;
++        double dRadAngle, dSinE, dTan, dShear;
++        double dOffset;     /* Variable skew offset */
++        int u, iShear, newx, newy;
++        int clrBackR, clrBackG, clrBackB, clrBackA;
++
++        /* See GEMS I for the algorithm details */
++        dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
++        dSinE = sin (dRadAngle);
++        dTan = tan (dRadAngle / 2.0);
++
++        newx = (int)(src->sx + src->sy * fabs(dTan));
++        newy = src->sy;
++
++        /* 1st shear */
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++        dst1 = gdImageCreateTrueColor(newx, newy);
++
++        /******* Perform 1st shear (horizontal) ******/
++        if (dst1 == NULL) {
++                return NULL;
++        }
++        dst1->alphaBlendingFlag = gdEffectReplace;
++
++        if (dAngle == 0.0) {
++                /* Returns copy of src */
++                gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy);
++                return dst1;
++        }
++
++        gdImagePaletteCopy (dst1, src);
++
++        dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
++        dSinE = sin (dRadAngle);
++        dTan = tan (dRadAngle / 2.0);
++
++        for (u = 0; u < dst1->sy; u++) {
++                if (dTan >= 0.0) {
++                        dShear = ((double)(u + 0.5)) * dTan;
++                } else {
++                        dShear = ((double)(u - dst1->sy) + 0.5) * dTan;
++                }
++
++                iShear = (int)floor(dShear);
++                gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack);
++        }
++
++        /*
++        The 1st shear may use the original clrBack as color index
++        Convert it once here
++        */
++        if(!src->trueColor) {
++                clrBackR = gdImageRed(src, clrBack);
++                clrBackG = gdImageGreen(src, clrBack);
++                clrBackB = gdImageBlue(src, clrBack);
++                clrBackA = gdImageAlpha(src, clrBack);
++                clrBack =  gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
++        }
++        /* 2nd shear */
++        newx = dst1->sx;
++
++        if (dSinE > 0.0) {
++                dOffset = (src->sx-1) * dSinE;
++        } else {
++                dOffset = -dSinE *  (src->sx - newx);
++        }
++
++        newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1;
++
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++        dst2 = gdImageCreateTrueColor(newx, newy);
++        if (dst2 == NULL) {
++                gdImageDestroy(dst1);
++                return NULL;
++        }
++        dst2->alphaBlendingFlag = gdEffectReplace;
++
++        for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) {
++                iShear = (int)floor (dOffset);
++                gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack);
++        }
++
++        /* 3rd shear */
++        gdImageDestroy(dst1);
++
++        newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1;
++        newy = dst2->sy;
++
++        if (src->trueColor) {
++                f = gdImageGetTrueColorPixel;
++        } else {
++                f = gdImageGetPixel;
++        }
++        dst3 = gdImageCreateTrueColor(newx, newy);
++        if (dst3 == NULL) {
++                gdImageDestroy(dst2);
++                return NULL;
++        }
++        if (dSinE >= 0.0) {
++                dOffset = (double)(src->sx - 1) * dSinE * -dTan;
++        } else {
++                dOffset = dTan * ((double)(src->sx - 1) * -dSinE + (double)(1 - newy));
++        }
++
++        for (u = 0; u < dst3->sy; u++, dOffset += dTan) {
++                int iShear = (int)floor(dOffset);
++                gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack);
++        }
++
++        gdImageDestroy(dst2);
++
++        return dst3;
++}
++
++BGD_DECLARE(gdImagePtr) gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
++{
++        gdImagePtr pMidImg;
++        gdImagePtr rotatedImg;
++        int r,g,b,a;
++        if (src == NULL) {
++                return NULL;
++        }
++
++        if (!gdImageTrueColor(src) && clrBack>=gdImageColorsTotal(src)) {
++                return NULL;
++        }
++
++        while (dAngle >= 360.0) {
++                dAngle -= 360.0;
++        }
++
++        while (dAngle < 0) {
++                dAngle += 360.0;
++        }
++
++        if (dAngle == 90.00) {
++                return gdImageRotate90(src);
++        }
++        if (dAngle == 180.00) {
++                return gdImageRotate180(src);
++        }
++        if(dAngle == 270.00) {
++                return gdImageRotate270 ( src);
++        }
++
++        if ((dAngle > 45.0) && (dAngle <= 135.0)) {
++                pMidImg = gdImageRotate90 (src);
++                dAngle -= 90.0;
++        } else if ((dAngle > 135.0) && (dAngle <= 225.0)) {
++                pMidImg = gdImageRotate180 (src);
++                dAngle -= 180.0;
++        } else if ((dAngle > 225.0) && (dAngle <= 315.0)) {
++                pMidImg = gdImageRotate270 (src);
++                dAngle -= 270.0;
++        } else {
++                return gdImageRotate45 (src, dAngle, clrBack);
++        }
++
++        if (pMidImg == NULL) {
++                return NULL;
++        }
++
++        if(!src->trueColor) {
++                r = gdImageRed(src, clrBack);
++                g = gdImageGreen(src, clrBack);
++                b = gdImageBlue(src, clrBack);
++                a = gdImageAlpha(src, clrBack);
++                clrBack =  gdTrueColorAlpha(r,g,b,a);
++        }
++
++        rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack);
++        gdImageDestroy(pMidImg);
++
++        return rotatedImg;
++}
++/* End Rotate function */
++
++
++/* End of part taken from php... dirty hack... */
++
+ /* When gd 1.x was first created, floating point was to be avoided.
+    These days it is often faster than table lookups or integer
+    arithmetic. The routine below is shamelessly, gloriously
+--- ./gd.h.org Thu Aug 12 13:22:18 2004
++++ ./gd.h     Thu Aug 12 13:44:33 2004
+@@ -106,6 +106,10 @@
+ #define gdTrueColorGetRed(c) (((c) & 0xFF0000) >> 16)
+ #define gdTrueColorGetGreen(c) (((c) & 0x00FF00) >> 8)
+ #define gdTrueColorGetBlue(c) ((c) & 0x0000FF)
++#define gdEffectReplace 0
++#define gdEffectAlphaBlend 1
++#define gdEffectNormal 2
++#define gdEffectOverlay 3
+ /* This function accepts truecolor pixel values only. The 
+       source color is composited with the destination color
+@@ -617,6 +621,12 @@
+                          int srcX, int srcY,
+                          int srcWidth, int srcHeight, int angle);
++gdImagePtr gdImageRotate90(gdImagePtr src);
++gdImagePtr gdImageRotate180(gdImagePtr src);
++gdImagePtr gdImageRotate270(gdImagePtr src);
++gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack);
++gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack);
++
+ BGD_DECLARE(void) gdImageSetBrush (gdImagePtr im, gdImagePtr brush);
+ BGD_DECLARE(void) gdImageSetTile (gdImagePtr im, gdImagePtr tile);
+ BGD_DECLARE(void) gdImageSetAntiAliased (gdImagePtr im, int c);
diff --git a/gd.spec b/gd.spec
index 653a4b8252bbe16f587a56c0d1e73431f25424aa..69f1de4cc2668e0ea1bdc8b72258d678547f9bea 100644 (file)
--- a/gd.spec
+++ b/gd.spec
@@ -1,48 +1,44 @@
 #
-# _without_gif - without GIF support (patch from http://www.rhyme.com.au/gd/)
-# _without_lzw - without LZW compression in GIF creation functions
+# Conditional build:
+%bcond_without fontconfig      # without fontconfig support
+%bcond_without xpm             # without XPM support (requires X11 libs)
 #
 Summary:       Library for PNG, JPEG creation
 Summary(es):   Biblioteca para manipulación de imágenes
 Summary(pl):   Biblioteka do tworzenia grafiki w formacie PNG, JPEG
 Summary(pt_BR):        Biblioteca para manipulação de imagens
 Name:          gd
-Version:       2.0.1
-Release:       7
+Version:       2.0.32
+Release:       1.1
 License:       BSD-like
 Group:         Libraries
-Source0:       http://www.boutell.com/ftp-materials/boutell/gd/%{name}-%{version}.tar.gz
-Patch0:                %{name}-ac_am.patch
-Patch1:                http://downloads.rhyme.com.au/gd/patch_%{name}%{version}_gif_20011107.gz
-Patch2:                %{name}-gif-acam.patch
-Patch3:                %{name}-fontpath.patch
-Patch4:                %{name}-gdTiled-segv.patch
-Patch5:                %{name}-fixes.patch
+Source0:       http://www.boutell.com/gd/http/%{name}-%{version}.tar.gz
+# Source0-md5: f7978941e578de778a3f4da759db7b29
+Patch0:                %{name}-fontpath.patch
+Patch1:                %{name}-rotate_from_php.patch
 URL:           http://www.boutell.com/gd/
-BuildRequires: autoconf
+%{?with_xpm:BuildRequires:     XFree86-devel}
+BuildRequires: autoconf >= 2.54
 BuildRequires: automake
+%{?with_fontconfig:BuildRequires:      fontconfig-devel}
 BuildRequires: freetype-devel >= 2.0
 BuildRequires: libpng-devel
 BuildRequires: libjpeg-devel
 BuildRequires: libtiff-devel
-BuildRequires: libtool
+BuildRequires: libtool >= 1:1.4.3
 BuildRequires: zlib-devel
+Provides:      gd(gif) = %{version}-%{release}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%{!?_without_gif:Provides:     gd(gif) = %{version}}
-
-%define                shlibver        %(echo %{version} | cut -f-2 -d.)
 
 %description
 gd is the image manipulating library. It was created to allow graphs,
 charts and the like to be generated on the fly for use on the World
 wide Web, but is useful for any application in which custom images are
 useful. It is not a paint program; it is a library. gd library creates
-PNG, JPEG and WBMP images. This is a good thing. PNG is a more compact
-format, and full compression is available. JPEG works well with
-photographic images, and is still more compatible with the major Web
-browsers than even PNG is. WBMP is intended for wireless devices (not
-regular web browsers).
-%{!?_without_gif:This version has additional GIF images support.}
+PNG, JPEG, GIF and WBMP images. PNG is a more compact format, and full
+compression is available. JPEG works well with photographic images,
+and is still more compatible with the major Web browsers than even PNG
+is. WBMP is intended for wireless devices (not regular web browsers).
 
 %description -l es
 Esta es la biblioteca gd para el manejo de imágenes. Fue creada para
@@ -55,12 +51,11 @@ gd to biblioteka do obr
 dynamiczne generowanie wykresów i podobnych rzeczy na potrzeby WWW,
 ale mo¿e byæ przydatna tak¿e dla ka¿dej aplikacji tworz±cej w³asne
 obrazy. Biblioteka ta pozwala na tworzenie plików graficznych w
-formatach PNG, JPEG i WBMP. PNG jest zwartym formatem z bezstratn±
-kompresj±. JPEG dobrze nadaje siê do obrazów fotograficznych i jest
-obs³ugiwany nawet przez wiêcej przegl±darek WWW ni¿ PNG. WBMP jest
-przeznaczony dla urz±dzeñ bezprzewodowych (a nie zwyk³ych przegl±darek
-WWW).
-%{!?_without_gif:Ta wersja ma dodatkowo obs³ugê formatu GIF.}
+formatach PNG, JPEG, GIF i WBMP. PNG jest zwartym formatem z
+bezstratn± kompresj±. JPEG dobrze nadaje siê do obrazów
+fotograficznych i jest obs³ugiwany nawet przez wiêcej przegl±darek WWW
+ni¿ PNG. WBMP jest przeznaczony dla urz±dzeñ bezprzewodowych (a nie
+zwyk³ych przegl±darek WWW).
 
 %description -l pt_BR
 Esta é a biblioteca gd para manipulação de imagens. Ela foi criada
@@ -74,12 +69,14 @@ Summary(es):        Archivos de inclusi
 Summary(pl):   Czê¶æ biblioteki GD przeznaczona dla developerów
 Summary(pt_BR):        Arquivos de inclusão e bibliotecas para desenvolver programas usando gd
 Group:         Development/Libraries
-Requires:      %{name} = %{version}
+Requires:      %{name} = %{version}-%{release}
+%{?with_xpm:Requires:  XFree86-devel}
+Requires:      fontconfig-devel
 Requires:      freetype-devel >= 2.0
 Requires:      libjpeg-devel
 Requires:      libpng-devel
 Requires:      zlib-devel
-%{!?_without_gif:Provides:     gd-devel(gif) = %{version}}
+Provides:      gd-devel(gif) = %{version}-%{release}
 
 %description devel
 This package contains the files needed for development of programs
@@ -102,8 +99,8 @@ Summary:     Static GD library
 Summary(pl):   Statyczna biblioteka GD
 Summary(pt_BR):        Bibliotecas estáticas para desenvolvimento com libgd
 Group:         Development/Libraries
-Requires:      %{name}-devel = %{version}
-%{!?_without_gif:Provides:     gd-static(gif) = %{version}}
+Requires:      %{name}-devel = %{version}-%{release}
+Provides:      gd-static(gif) = %{version}-%{release}
 
 %description static
 This package contains static gd library.
@@ -121,8 +118,7 @@ Summary(es):        Programas utilitarios libgd
 Summary(pl):   Narzêdzia u¿ywaj±ce libgd
 Summary(pt_BR):        Programas utilitários libgd
 Group:         Applications/Graphics
-Requires:      %{name} = %{version}
-%{!?_without_gif:Provides:     gd-progs(gif) = %{version}}
+Requires:      %{name} = %{version}-%{release}
 
 %description progs
 These are utility programs supplied with gd, the image manipulation
@@ -141,19 +137,20 @@ para uso pelos programas que usam a libgd.
 %prep
 %setup -q
 %patch0 -p1
-%{!?_without_gif:%patch1 -p1}
-%{!?_without_gif:%patch2 -p1}
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+%patch1 -p1
+
+# hack to avoid inclusion of -s or -L/usr/%{_lib} in --ldflags
+%{__perl} -pi -e 's,\@LDFLAGS\@,-L/usr/X11R6/%{_lib},g' config/gdlib-config.in
 
 %build
 %{__libtoolize}
-aclocal
+%{__aclocal}
 %{__automake}
+%{__autoheader}
 %{__autoconf}
-%{!?_without_lzw:CPPFLAGS="-DLZW_LICENCED"}
-%configure
+%configure \
+       %{!?with_fontconfig:--without-fontconfig} \
+       %{!?with_xpm:--without-xpm}
 %{__make}
 
 %install
@@ -170,14 +167,14 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc readme.txt
+%doc COPYING index.html
 %attr(755,root,root) %{_libdir}/*.so.*.*
 
 %files devel
 %defattr(644,root,root,755)
-%doc index.html
+%attr(755,root,root) %{_bindir}/gdlib-config
 %attr(755,root,root) %{_libdir}/*.so
-%attr(755,root,root) %{_libdir}/*.la
+%{_libdir}/*.la
 %{_includedir}/*
 
 %files static
@@ -187,3 +184,4 @@ rm -rf $RPM_BUILD_ROOT
 %files progs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/*
+%exclude %{_bindir}/gdlib-config
This page took 0.165356 seconds and 4 git commands to generate.