summaryrefslogtreecommitdiff
path: root/community/libharu
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-02-23 23:15:11 +0000
committerroot <root@rshg054.dnsready.net>2012-02-23 23:15:11 +0000
commitd466ef49f224a9347fe0375eac8126725e10a0a4 (patch)
treec08a9d7437c4d6de169858ac98fb340fd90202c2 /community/libharu
parent1d9fb21dff6df1679e536ab672edcbbdb4cf3a15 (diff)
Thu Feb 23 23:15:11 UTC 2012
Diffstat (limited to 'community/libharu')
-rw-r--r--community/libharu/PKGBUILD6
-rw-r--r--community/libharu/libpng15.patch76
2 files changed, 41 insertions, 41 deletions
diff --git a/community/libharu/PKGBUILD b/community/libharu/PKGBUILD
index ecbd647ad..31e0e4887 100644
--- a/community/libharu/PKGBUILD
+++ b/community/libharu/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 63644 2012-02-05 12:03:04Z ibiru $
+# $Id: PKGBUILD 66215 2012-02-23 03:29:40Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer : SpepS <dreamspepser at yahoo dot it>
# Contributor: Auguste <auguste@gmail.com>
@@ -6,7 +6,7 @@
pkgname=libharu
pkgver=2.2.1
-pkgrel=2
+pkgrel=3
pkgdesc="C/C++ library for generating PDF documents"
url="http://libharu.org/wiki/Main_Page"
arch=('i686' 'x86_64')
@@ -16,7 +16,7 @@ options=(!libtool)
source=("http://libharu.org/files/$pkgname-$pkgver.tar.gz"
libpng15.patch)
md5sums=('63da8e087744f1d6cf16f9501b1cb766'
- '3793dd30017474bcd277af3b419bc0f6')
+ '01ead345fba55e6374fe2dbf9be0db3e')
build() {
cd "$srcdir/$pkgname-$pkgver"
diff --git a/community/libharu/libpng15.patch b/community/libharu/libpng15.patch
index 05a8d39fc..210c5c29a 100644
--- a/community/libharu/libpng15.patch
+++ b/community/libharu/libpng15.patch
@@ -6,15 +6,15 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
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_image_height(png_ptr, info_ptr) * 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_image_height(png_ptr, info_ptr) * sizeof (png_bytep));
-+ for (i = 0; i < (HPDF_UINT)png_image_height(png_ptr, info_ptr); 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)
@@ -23,7 +23,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
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_image_height(png_ptr, info_ptr); 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;
@@ -32,7 +32,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
/* clean up */
- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
-+ for (i = 0; i < (HPDF_UINT)png_image_height(png_ptr, info_ptr); i++) {
++ for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); i++) {
HPDF_FreeMem (image->mmgr, row_pointers[i]);
}
@@ -41,7 +41,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
HPDF_UINT i;
- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
-+ for (i = 0; i < (HPDF_UINT)png_image_height(png_ptr, info_ptr); 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;
@@ -50,14 +50,14 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
png_bytep *row_ptr;
- row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * sizeof(png_bytep));
-+ row_ptr = HPDF_GetMem (image->mmgr, png_image_height(png_ptr, info_ptr) * 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_image_height(png_ptr, info_ptr); 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--) {
@@ -68,13 +68,13 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
- 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_image_height(png_ptr, info_ptr); j++) {
-+ for (i = 0; i < png_image_width(png_ptr, info_ptr); i++) {
-+ smask_data[png_image_width(png_ptr, info_ptr) * 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_image_width(png_ptr, info_ptr)) != 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;
}
@@ -82,7 +82,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
Error:
- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
-+ for (i = 0; i < (HPDF_UINT)png_image_height(png_ptr, info_ptr); i++) {
++ for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); i++) {
HPDF_FreeMem (image->mmgr, row_ptr[i]);
}
@@ -91,14 +91,14 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
}
- row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * sizeof(png_bytep));
-+ row_ptr = HPDF_GetMem (image->mmgr, png_image_height(png_ptr, info_ptr) * 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_image_height(png_ptr, info_ptr); 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--) {
@@ -109,13 +109,13 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
- 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_image_width(png_ptr, info_ptr) * sizeof(png_byte);
-+ for (j = 0; j < png_image_height(png_ptr, info_ptr); j++) {
-+ for (i = 0; i < png_image_width(png_ptr, info_ptr); 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_image_width(png_ptr, info_ptr) * 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) {
@@ -126,13 +126,13 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
- 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_image_width(png_ptr, info_ptr) * sizeof(png_byte);
-+ for (j = 0; j < png_image_height(png_ptr, info_ptr); j++) {
-+ for (i = 0; i < png_image_width(png_ptr, info_ptr); 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_image_width(png_ptr, info_ptr) * 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) {
@@ -141,7 +141,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
Error:
- for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
-+ for (i = 0; i < (HPDF_UINT)png_image_height(png_ptr, info_ptr); i++) {
++ for (i = 0; i < (HPDF_UINT)png_get_image_height(png_ptr, info_ptr); i++) {
HPDF_FreeMem (image->mmgr, row_ptr[i]);
}
@@ -169,8 +169,8 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
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_image_width(png_ptr, info_ptr));
-+ ret += HPDF_Dict_AddNumber (smask, "Height", (HPDF_UINT)png_image_height(png_ptr, info_ptr));
++ 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));
@@ -182,7 +182,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
}
- smask_data = HPDF_GetMem(image->mmgr, info_ptr->width * info_ptr->height);
-+ smask_data = HPDF_GetMem(image->mmgr, png_image_width(png_ptr, info_ptr) * png_image_height(png_ptr, info_ptr));
++ 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;
@@ -191,7 +191,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
}
- 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_image_width(png_ptr, info_ptr) * png_image_height(png_ptr, info_ptr)) != 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;
@@ -202,8 +202,8 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
- 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_image_width(png_ptr, info_ptr));
-+ ret += HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)png_image_height(png_ptr, info_ptr));
++ 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);
@@ -223,8 +223,8 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
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_image_width(png_ptr, info_ptr));
-+ ret += HPDF_Dict_AddNumber (smask, "Height", (HPDF_UINT)png_image_height(png_ptr, info_ptr));
++ 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));
@@ -236,7 +236,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
}
- smask_data = HPDF_GetMem(image->mmgr, info_ptr->width * info_ptr->height);
-+ smask_data = HPDF_GetMem(image->mmgr, png_image_width(png_ptr, info_ptr) * png_image_height(png_ptr, info_ptr));
++ 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;
@@ -245,7 +245,7 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
}
- 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_image_width(png_ptr, info_ptr) * png_image_height(png_ptr, info_ptr)) != 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;
@@ -262,8 +262,8 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
- 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_image_width(png_ptr, info_ptr));
-+ ret += HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)png_image_height(png_ptr, info_ptr));
++ 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);
@@ -285,12 +285,12 @@ diff -wbBur libharu-2.2.1/src/hpdf_image_png.c libharu-2.2.1.my/src/hpdf_image_p
/* 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_image_width(png_ptr, info_ptr))
++ 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_image_height(png_ptr, info_ptr))
++ if (HPDF_Dict_AddNumber (image, "Height", (HPDF_UINT)png_get_image_height(png_ptr, info_ptr))
!= HPDF_OK)
goto Exit;