Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=ryuotesting2.git;a=commitdiff;h=64430b762a5a8514aa271eda994504df9f995c62

commit 64430b762a5a8514aa271eda994504df9f995c62
Author: Baste <[email protected]>
Date:   Wed Jun 27 13:42:58 2012 +0200

libharu-2.2.1-2-x86_64
* add libpng15 patch

diff --git a/source/lib-extra/libharu/FrugalBuild 
b/source/lib-extra/libharu/FrugalBuild
index 5bacd9d..c6c0f9f 100644
--- a/source/lib-extra/libharu/FrugalBuild
+++ b/source/lib-extra/libharu/FrugalBuild
@@ -10,7 +10,8 @@ depends=('libpng>=1.4.3')
groups=('lib-extra')
archs=('i686' 'x86_64')
up2date="Flasttar $url/wiki/Downloads"
-source=($url/files/$pkgname-$pkgver.tar.bz2)
-sha1sums=('bfea7d9df3fb6a112340d0d54731f62f53b26d2f')
+source=($url/files/$pkgname-$pkgver.tar.bz2 libpng15.patch)
+sha1sums=('bfea7d9df3fb6a112340d0d54731f62f53b26d2f' \
+          '3ec1ead6f66a56fe062d19167f9ca3ff8fbfde3b')

# optimization OK
diff --git a/source/lib-extra/libharu/libpng15.patch 
b/source/lib-extra/libharu/libpng15.patch
new file mode 100644
index 0000000..d59056c
--- /dev/null
+++ b/source/lib-extra/libharu/libpng15.patch
@@ -0,0 +1,303 @@
+diff -wbBur libharu-2.2.1/src/hpdf_image_png.c 
libharu-2.2.1.my/src/hpdf_image_png.c
+--- libharu-2.2.1/src/hpdf_image_png.c 2010-02-08 12:27:51.000000000 +0300
++++ libharu-2.2.1.my/src/hpdf_image_png.c      2012-01-23 12:53:05.000000000 
+0400
+@@ -110,13 +110,13 @@
+ {
+     png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr);
+     png_bytep* row_pointers = HPDF_GetMem (image->mmgr,
+-                info_ptr->height * sizeof (png_bytep));
++                png_get_image_height(png_ptr, info_ptr) * sizeof (png_bytep));
+
+     if (row_pointers) {
+         HPDF_UINT i;
+
+-        HPDF_MemSet (row_pointers, 0, info_ptr->height * sizeof (png_bytep));
+-        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++        HPDF_MemSet (row_pointers, 0, png_get_image_height(png_ptr, info_ptr) 
* sizeof (png_bytep));
++        for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); 
i++) {
+             row_pointers[i] = HPDF_GetMem (image->mmgr, len);
+
+             if (image->error->error_no != HPDF_OK)
+@@ -126,7 +126,7 @@
+         if (image->error->error_no == HPDF_OK) {
+             png_read_image(png_ptr, row_pointers);
+             if (image->error->error_no == HPDF_OK) {       /* add this line */
+-                for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++                for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, 
info_ptr); i++) {
+                     if (HPDF_Stream_Write (image->stream, row_pointers[i], 
len) !=
+                             HPDF_OK)
+                         break;
+@@ -135,7 +135,7 @@
+         }
+
+         /* clean up */
+-        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++        for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); 
i++) {
+             HPDF_FreeMem (image->mmgr, row_pointers[i]);
+         }
+
+@@ -156,7 +156,7 @@
+     if (buf_ptr) {
+         HPDF_UINT i;
+
+-        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++        for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); 
i++) {
+             png_read_rows(png_ptr, (png_byte**)&buf_ptr, NULL, 1);
+             if (image->error->error_no != HPDF_OK)
+                 break;
+@@ -183,13 +183,13 @@
+       HPDF_UINT i, j;
+       png_bytep *row_ptr;
+
+-      row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * 
sizeof(png_bytep));
++      row_ptr = HPDF_GetMem (image->mmgr, png_get_image_height(png_ptr, 
info_ptr) * sizeof(png_bytep));
+       if (!row_ptr) {
+               return HPDF_FAILD_TO_ALLOC_MEM;
+       } else {
+               png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr);
+
+-              for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++              for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, 
info_ptr); i++) {
+                       row_ptr[i] = HPDF_GetMem(image->mmgr, len);
+                       if (!row_ptr[i]) {
+                               for (; i >= 0; i--) {
+@@ -207,19 +207,19 @@
+               goto Error;
+       }
+
+-      for (j = 0; j < info_ptr->height; j++) {
+-              for (i = 0; i < info_ptr->width; i++) {
+-                      smask_data[info_ptr->width * j + i] = (row_ptr[j][i] < 
num_trans) ? trans[row_ptr[j][i]] : 0xFF;
++      for (j = 0; j < png_get_image_height(png_ptr, info_ptr); j++) {
++              for (i = 0; i < png_get_image_width(png_ptr, info_ptr); i++) {
++                      smask_data[png_get_image_width(png_ptr, info_ptr) * j + 
i] = (row_ptr[j][i] < num_trans) ? trans[row_ptr[j][i]] : 0xFF;
+               }
+
+-              if (HPDF_Stream_Write (image->stream, row_ptr[j], 
info_ptr->width) != HPDF_OK) {
++              if (HPDF_Stream_Write (image->stream, row_ptr[j], 
png_get_image_width(png_ptr, info_ptr)) != HPDF_OK) {
+                       ret = HPDF_FILE_IO_ERROR;
+                       goto Error;
+               }
+       }
+
+ Error:
+-      for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++      for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); 
i++) {
+               HPDF_FreeMem (image->mmgr, row_ptr[i]);
+       }
+
+@@ -245,13 +245,13 @@
+               return HPDF_INVALID_PNG_IMAGE;
+       }
+
+-      row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * 
sizeof(png_bytep));
++      row_ptr = HPDF_GetMem (image->mmgr, png_get_image_height(png_ptr, 
info_ptr) * sizeof(png_bytep));
+       if (!row_ptr) {
+               return HPDF_FAILD_TO_ALLOC_MEM;
+       } else {
+               png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr);
+
+-              for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++              for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, 
info_ptr); i++) {
+                       row_ptr[i] = HPDF_GetMem(image->mmgr, len);
+                       if (!row_ptr[i]) {
+                               for (; i >= 0; i--) {
+@@ -271,12 +271,12 @@
+
+       switch (color_type) {
+               case PNG_COLOR_TYPE_RGB_ALPHA:
+-                      row_len = 3 * info_ptr->width * sizeof(png_byte);
+-                      for (j = 0; j < info_ptr->height; j++) {
+-                              for (i = 0; i < info_ptr->width; i++) {
++                      row_len = 3 * png_get_image_width(png_ptr, info_ptr) * 
sizeof(png_byte);
++                      for (j = 0; j < png_get_image_height(png_ptr, 
info_ptr); j++) {
++                              for (i = 0; i < png_get_image_width(png_ptr, 
info_ptr); i++) {
+                                       row = row_ptr[j];
+                                       memmove(row + (3 * i), row + (4*i), 3);
+-                                      smask_data[info_ptr->width * j + i] = 
row[4 * i + 3];
++                                      smask_data[png_get_image_width(png_ptr, 
info_ptr) * j + i] = row[4 * i + 3];
+                               }
+
+                               if (HPDF_Stream_Write (image->stream, row, 
row_len) != HPDF_OK) {
+@@ -286,12 +286,12 @@
+                       }
+                       break;
+               case PNG_COLOR_TYPE_GRAY_ALPHA:
+-                      row_len = info_ptr->width * sizeof(png_byte);
+-                      for (j = 0; j < info_ptr->height; j++) {
+-                              for (i = 0; i < info_ptr->width; i++) {
++                      row_len = png_get_image_width(png_ptr, info_ptr) * 
sizeof(png_byte);
++                      for (j = 0; j < png_get_image_height(png_ptr, 
info_ptr); j++) {
++                              for (i = 0; i < png_get_image_width(png_ptr, 
info_ptr); i++) {
+                                       row = row_ptr[j];
+                                       row[i] = row[2 * i];
+-                                      smask_data[info_ptr->width * j + i] = 
row[2 * i + 1];
++                                      smask_data[png_get_image_width(png_ptr, 
info_ptr) * j + i] = row[2 * i + 1];
+                               }
+
+                               if (HPDF_Stream_Write (image->stream, row, 
row_len) != HPDF_OK) {
+@@ -306,7 +306,7 @@
+       }
+
+ Error:
+-      for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
++      for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); 
i++) {
+               HPDF_FreeMem (image->mmgr, row_ptr[i]);
+       }
+
+@@ -448,7 +448,7 @@
+       }
+
+       /* 16bit images are not supported. */
+-      if (info_ptr->bit_depth == 16) {
++      if (png_get_bit_depth(png_ptr, info_ptr) == 16) {
+               png_set_strip_16(png_ptr);
+       }
+
+@@ -458,7 +458,7 @@
+       }
+
+       /* check palette-based images for transparent areas and load them 
immediately if found */
+-      if (xref && PNG_COLOR_TYPE_PALETTE & info_ptr->color_type) {
++      if (xref && PNG_COLOR_TYPE_PALETTE & png_get_color_type(png_ptr, 
info_ptr)) {
+               png_bytep trans;
+               int num_trans;
+               HPDF_Dict smask;
+@@ -478,10 +478,10 @@
+               smask->header.obj_class |= HPDF_OSUBCLASS_XOBJECT;
+               ret = HPDF_Dict_AddName (smask, "Type", "XObject");
+               ret += HPDF_Dict_AddName (smask, "Subtype", "Image");
+-              ret += HPDF_Dict_AddNumber (smask, "Width", 
(HPDF_UINT)info_ptr->width);
+-              ret += HPDF_Dict_AddNumber (smask, "Height", 
(HPDF_UINT)info_ptr->height);
++              ret += HPDF_Dict_AddNumber (smask, "Width", 
(HPDF_UINT)png_get_image_width(png_ptr, info_ptr));
++              ret += HPDF_Dict_AddNumber (smask, "Height", 
(HPDF_UINT)png_get_image_height(png_ptr, info_ptr));
+               ret += HPDF_Dict_AddName (smask, "ColorSpace", "DeviceGray");
+-              ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", 
(HPDF_UINT)info_ptr->bit_depth);
++              ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", 
(HPDF_UINT)png_get_bit_depth(png_ptr, info_ptr));
+
+               if (ret != HPDF_OK) {
+                       HPDF_Dict_Free(smask);
+@@ -489,7 +489,7 @@
+                       goto Exit;
+               }
+
+-              smask_data = HPDF_GetMem(image->mmgr, info_ptr->width * 
info_ptr->height);
++              smask_data = HPDF_GetMem(image->mmgr, 
png_get_image_width(png_ptr, info_ptr) * png_get_image_height(png_ptr, 
info_ptr));
+               if (!smask_data) {
+                       HPDF_Dict_Free(smask);
+                       ret = HPDF_FAILD_TO_ALLOC_MEM;
+@@ -503,7 +503,7 @@
+                       goto Exit;
+               }
+
+-              if (HPDF_Stream_Write(smask->stream, smask_data, 
info_ptr->width * info_ptr->height) != HPDF_OK) {
++              if (HPDF_Stream_Write(smask->stream, smask_data, 
png_get_image_width(png_ptr, info_ptr) * png_get_image_height(png_ptr, 
info_ptr)) != HPDF_OK) {
+                       HPDF_FreeMem(image->mmgr, smask_data);
+                       HPDF_Dict_Free(smask);
+                       ret = HPDF_FILE_IO_ERROR;
+@@ -513,9 +513,9 @@
+
+
+               ret += CreatePallet(image, png_ptr, info_ptr);
+-              ret += HPDF_Dict_AddNumber (image, "Width", 
(HPDF_UINT)info_ptr->width);
+-              ret += HPDF_Dict_AddNumber (image, "Height", 
(HPDF_UINT)info_ptr->height);
+-              ret += HPDF_Dict_AddNumber (image, "BitsPerComponent",  
(HPDF_UINT)info_ptr->bit_depth);
++              ret += HPDF_Dict_AddNumber (image, "Width", 
(HPDF_UINT)png_get_image_width(png_ptr, info_ptr));
++              ret += HPDF_Dict_AddNumber (image, "Height", 
(HPDF_UINT)png_get_image_height(png_ptr, info_ptr));
++              ret += HPDF_Dict_AddNumber (image, "BitsPerComponent",  
(HPDF_UINT)png_get_bit_depth(png_ptr, info_ptr));
+               ret += HPDF_Dict_Add (image, "SMask", smask);
+
+               png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+@@ -526,7 +526,7 @@
+
+       /* read images with alpha channel right away
+          we have to do this because image transparent mask must be added to 
the Xref */
+-      if (xref && PNG_COLOR_MASK_ALPHA & info_ptr->color_type) {
++      if (xref && PNG_COLOR_MASK_ALPHA & png_get_color_type(png_ptr, 
info_ptr)) {
+               HPDF_Dict smask;
+               png_bytep smask_data;
+
+@@ -539,10 +539,10 @@
+               smask->header.obj_class |= HPDF_OSUBCLASS_XOBJECT;
+               ret = HPDF_Dict_AddName (smask, "Type", "XObject");
+               ret += HPDF_Dict_AddName (smask, "Subtype", "Image");
+-              ret += HPDF_Dict_AddNumber (smask, "Width", 
(HPDF_UINT)info_ptr->width);
+-              ret += HPDF_Dict_AddNumber (smask, "Height", 
(HPDF_UINT)info_ptr->height);
++              ret += HPDF_Dict_AddNumber (smask, "Width", 
(HPDF_UINT)png_get_image_width(png_ptr, info_ptr));
++              ret += HPDF_Dict_AddNumber (smask, "Height", 
(HPDF_UINT)png_get_image_height(png_ptr, info_ptr));
+               ret += HPDF_Dict_AddName (smask, "ColorSpace", "DeviceGray");
+-              ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", 
(HPDF_UINT)info_ptr->bit_depth);
++              ret += HPDF_Dict_AddNumber (smask, "BitsPerComponent", 
(HPDF_UINT)png_get_bit_depth(png_ptr, info_ptr));
+
+               if (ret != HPDF_OK) {
+                       HPDF_Dict_Free(smask);
+@@ -550,7 +550,7 @@
+                       goto Exit;
+               }
+
+-              smask_data = HPDF_GetMem(image->mmgr, info_ptr->width * 
info_ptr->height);
++              smask_data = HPDF_GetMem(image->mmgr, 
png_get_image_width(png_ptr, info_ptr) * png_get_image_height(png_ptr, 
info_ptr));
+               if (!smask_data) {
+                       HPDF_Dict_Free(smask);
+                       ret = HPDF_FAILD_TO_ALLOC_MEM;
+@@ -564,7 +564,7 @@
+                       goto Exit;
+               }
+
+-              if (HPDF_Stream_Write(smask->stream, smask_data, 
info_ptr->width * info_ptr->height) != HPDF_OK) {
++              if (HPDF_Stream_Write(smask->stream, smask_data, 
png_get_image_width(png_ptr, info_ptr) * png_get_image_height(png_ptr, 
info_ptr)) != HPDF_OK) {
+                       HPDF_FreeMem(image->mmgr, smask_data);
+                       HPDF_Dict_Free(smask);
+                       ret = HPDF_FILE_IO_ERROR;
+@@ -572,14 +572,14 @@
+               }
+               HPDF_FreeMem(image->mmgr, smask_data);
+
+-              if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
++              if (png_get_color_type(png_ptr, info_ptr) == 
PNG_COLOR_TYPE_GRAY_ALPHA) {
+                       ret += HPDF_Dict_AddName (image, "ColorSpace", 
"DeviceGray");
+               } else {
+                       ret += HPDF_Dict_AddName (image, "ColorSpace", 
"DeviceRGB");
+               }
+-              ret += HPDF_Dict_AddNumber (image, "Width", 
(HPDF_UINT)info_ptr->width);
+-              ret += HPDF_Dict_AddNumber (image, "Height", 
(HPDF_UINT)info_ptr->height);
+-              ret += HPDF_Dict_AddNumber (image, "BitsPerComponent",  
(HPDF_UINT)info_ptr->bit_depth);
++              ret += HPDF_Dict_AddNumber (image, "Width", 
(HPDF_UINT)png_get_image_width(png_ptr, info_ptr));
++              ret += HPDF_Dict_AddNumber (image, "Height", 
(HPDF_UINT)png_get_image_height(png_ptr, info_ptr));
++              ret += HPDF_Dict_AddNumber (image, "BitsPerComponent",  
(HPDF_UINT)png_get_bit_depth(png_ptr, info_ptr));
+               ret += HPDF_Dict_Add (image, "SMask", smask);
+
+               png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+@@ -589,9 +589,9 @@
+       /* if the image has color palette, copy the pallet of the image to
+        * create color map.
+        */
+-      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
++      if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE)
+               ret = CreatePallet(image, png_ptr, info_ptr);
+-      else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
++      else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY)
+               ret = HPDF_Dict_AddName (image, "ColorSpace", "DeviceGray");
+       else
+               ret = HPDF_Dict_AddName (image, "ColorSpace", "DeviceRGB");
+@@ -617,16 +617,16 @@
+       }
+
+       /* setting the info of the image. */
+-      if (HPDF_Dict_AddNumber (image, "Width", (HPDF_UINT)info_ptr->width)
++      if (HPDF_Dict_AddNumber (image, "Width", 
(HPDF_UINT)png_get_image_width(png_ptr, info_ptr))
+                       != HPDF_OK)
+               goto Exit;
+
+-      if (HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)info_ptr->height)
++      if (HPDF_Dict_AddNumber (image, "Height", 
(HPDF_UINT)png_get_image_height(png_ptr, info_ptr))
+                       != HPDF_OK)
+               goto Exit;
+
+       if (HPDF_Dict_AddNumber (image, "BitsPerComponent",
+-                              (HPDF_UINT)info_ptr->bit_depth) != HPDF_OK)
++                              (HPDF_UINT)png_get_bit_depth(png_ptr, 
info_ptr)) != HPDF_OK)
+               goto Exit;
+
+       /* clean up */
+
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to