<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[140228] trunk/dports/print/libharu</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/140228">140228</a></dd>
<dt>Author</dt> <dd>takeshi@macports.org</dd>
<dt>Date</dt> <dd>2015-09-12 20:02:36 -0700 (Sat, 12 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>libharu: update to 2.3.0</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsprintlibharuPortfile">trunk/dports/print/libharu/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsprintlibharufilespatchCMakeListstxtdiff">trunk/dports/print/libharu/files/patch-CMakeLists.txt.diff</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsprintlibharufilespatchsrchpdf_image_pngcdiff">trunk/dports/print/libharu/files/patch-src-hpdf_image_png.c.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsprintlibharuPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/print/libharu/Portfile (140227 => 140228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/print/libharu/Portfile        2015-09-12 23:32:11 UTC (rev 140227)
+++ trunk/dports/print/libharu/Portfile        2015-09-13 03:02:36 UTC (rev 140228)
</span><span class="lines">@@ -2,10 +2,10 @@
</span><span class="cx"> # $Id$
</span><span class="cx"> 
</span><span class="cx"> PortSystem          1.0
</span><ins>+PortGroup           cmake 1.0
</ins><span class="cx"> 
</span><span class="cx"> name                libharu
</span><del>-version             2.2.1
-revision            2
</del><ins>+version             2.3.0
</ins><span class="cx"> categories          print
</span><span class="cx"> platforms           darwin
</span><span class="cx"> maintainers         nomaintainer
</span><span class="lines">@@ -23,20 +23,27 @@
</span><span class="cx">         8. CJK fonts and encodings.
</span><span class="cx"> 
</span><span class="cx"> homepage            http://libharu.org
</span><del>-master_sites        ${homepage}/files/
-use_bzip2           yes
</del><ins>+master_sites        https://github.com/${name}/${name}/archive/
</ins><span class="cx"> depends_lib         port:libpng \
</span><span class="cx">                     port:zlib
</span><span class="cx"> 
</span><del>-checksums           md5     4febd7e677b1c5d54db59a608b84e79f \
-                    sha1    bfea7d9df3fb6a112340d0d54731f62f53b26d2f \
-                    rmd160  2f5b66b5e63d15039940fa9a38630b06e74a1360
</del><ins>+regsub -all {\.} ${version} {_} versu
+distname            RELEASE_${versu}
+worksrcdir          ${name}-${distname}
</ins><span class="cx"> 
</span><del>-patchfiles          patch-src-hpdf_image_png.c.diff
</del><ins>+checksums           rmd160  c90ec08c3cc04e4d93f6aa9565368dd3a31a74bc \
+                    sha256  8f9e68cc5d5f7d53d1bc61a1ed876add1faf4f91070dbc360d8b259f46d9a4d2
</ins><span class="cx"> 
</span><del>-configure.args-append --with-png=${prefix} \
-                      --with-zlib=${prefix}
</del><ins>+patchfiles          patch-CMakeLists.txt.diff
</ins><span class="cx"> 
</span><ins>+cmake.out_of_source yes
+
+configure.args-append \
+                    -DPNG_INCLUDE_DIR=${prefix}/include \
+                    -DPNG_LIBRARIES=${prefix}/lib/libpng.dylib \
+                    -DZLIB_INCLUDE_DIR=${prefix}/include \
+                    -DZLIB_LIBRARIES=${prefix}/lib/libz.dylib
+
</ins><span class="cx"> livecheck.type      regex
</span><del>-livecheck.url       [lindex ${master_sites} 0]
-livecheck.regex     (?i)lib(?:haru|hpdf)-(\[0-9.\]+)${extract.suffix}
</del><ins>+livecheck.url       ${homepage}
+livecheck.regex      v(\[0-9.\]+)
</ins></span></pre></div>
<a id="trunkdportsprintlibharufilespatchCMakeListstxtdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/print/libharu/files/patch-CMakeLists.txt.diff (0 => 140228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/print/libharu/files/patch-CMakeLists.txt.diff                                (rev 0)
+++ trunk/dports/print/libharu/files/patch-CMakeLists.txt.diff        2015-09-13 03:02:36 UTC (rev 140228)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+--- CMakeLists.txt.orig        2013-10-30 22:11:59.000000000 +0900
++++ CMakeLists.txt        2015-09-13 11:50:45.000000000 +0900
+@@ -25,7 +25,7 @@

+ # information about libharu
+ set(LIBHPDF_MAJOR 2)
+-set(LIBHPDF_MINOR 2)
++set(LIBHPDF_MINOR 3)
+ set(LIBHPDF_PATCH 0)
+ set(LIBHPDF_VERSION ${LIBHPDF_MAJOR}.${LIBHPDF_MINOR}.${LIBHPDF_PATCH})
+ set(LIBHPDF_DESCRIPTION &quot;libHaru is a free, cross platform, open source library for generating PDF files.&quot;)
+@@ -210,9 +210,9 @@
+ install(FILES ${haru_HDRS} DESTINATION include)

+ # install various files
+-install(FILES README CHANGES INSTALL DESTINATION .)
++install(FILES README CHANGES INSTALL DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libharu)
+ if(NOT DEVPAK)
+-  install(DIRECTORY if DESTINATION .)
++  install(DIRECTORY if DESTINATION ${CMAKE_INSTALL_PREFIX}/share/libharu)
+ endif(NOT DEVPAK)
+ if(DEVPAK)
+   install(FILES ${CMAKE_BINARY_DIR}/libharu.DevPackage DESTINATION .)
</ins></span></pre></div>
<a id="trunkdportsprintlibharufilespatchsrchpdf_image_pngcdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/print/libharu/files/patch-src-hpdf_image_png.c.diff (140227 => 140228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/print/libharu/files/patch-src-hpdf_image_png.c.diff        2015-09-12 23:32:11 UTC (rev 140227)
+++ trunk/dports/print/libharu/files/patch-src-hpdf_image_png.c.diff        2015-09-13 03:02:36 UTC (rev 140228)
</span><span class="lines">@@ -1,342 +0,0 @@
</span><del>---- src/hpdf_image_png.c.orig
-+++ src/hpdf_image_png.c
-@@ -109,14 +109,15 @@ ReadPngData_Interlaced  (HPDF_Dict    image,
-                          png_infop    info_ptr)
- {
-     png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr);
-+    png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
-     png_bytep* row_pointers = HPDF_GetMem (image-&gt;mmgr,
--                info_ptr-&gt;height * sizeof (png_bytep));
-+                height * sizeof (png_bytep));

-     if (row_pointers) {
-         HPDF_UINT i;

--        HPDF_MemSet (row_pointers, 0, info_ptr-&gt;height * sizeof (png_bytep));
--        for (i = 0; i &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+        HPDF_MemSet (row_pointers, 0, height * sizeof (png_bytep));
-+        for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-             row_pointers[i] = HPDF_GetMem (image-&gt;mmgr, len);

-             if (image-&gt;error-&gt;error_no != HPDF_OK)
-@@ -126,7 +127,7 @@ ReadPngData_Interlaced  (HPDF_Dict    image,
-         if (image-&gt;error-&gt;error_no == HPDF_OK) {
-             png_read_image(png_ptr, row_pointers);
-             if (image-&gt;error-&gt;error_no == HPDF_OK) {       /* add this line */
--                for (i = 0; i &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+                for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-                     if (HPDF_Stream_Write (image-&gt;stream, row_pointers[i], len) !=
-                             HPDF_OK)
-                         break;
-@@ -135,7 +136,7 @@ ReadPngData_Interlaced  (HPDF_Dict    image,
-         }

-         /* clean up */
--        for (i = 0; i &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+        for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-             HPDF_FreeMem (image-&gt;mmgr, row_pointers[i]);
-         }

-@@ -151,12 +152,13 @@ ReadPngData  (HPDF_Dict    image,
-               png_infop    info_ptr)
- {
-     png_uint_32 len = png_get_rowbytes(png_ptr, info_ptr);
-+    png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
-     png_bytep buf_ptr = HPDF_GetMem (image-&gt;mmgr, len);

-     if (buf_ptr) {
-         HPDF_UINT i;

--        for (i = 0; i &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+        for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-             png_read_rows(png_ptr, (png_byte**)&amp;buf_ptr, NULL, 1);
-             if (image-&gt;error-&gt;error_no != HPDF_OK)
-                 break;
-@@ -182,17 +184,19 @@ ReadTransparentPaletteData  (HPDF_Dict    image,
-         HPDF_STATUS ret = HPDF_OK;
-         HPDF_UINT i, j;
-         png_bytep *row_ptr;
-+        png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
-+        png_uint_32 width = png_get_image_width(png_ptr, info_ptr);

--        row_ptr = HPDF_GetMem (image-&gt;mmgr, info_ptr-&gt;height * sizeof(png_bytep));
-+        row_ptr = HPDF_GetMem (image-&gt;mmgr, height * 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 &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+                for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-                         row_ptr[i] = HPDF_GetMem(image-&gt;mmgr, len);
-                         if (!row_ptr[i]) {
--                                for (; i &gt;= 0; i--) {
-+                                for (; i &gt; 0; i--) {
-                                         HPDF_FreeMem (image-&gt;mmgr, row_ptr[i]);
-                                 }
-                                 HPDF_FreeMem (image-&gt;mmgr, row_ptr);
-@@ -207,19 +211,19 @@ ReadTransparentPaletteData  (HPDF_Dict    image,
-                 goto Error;
-         }

--        for (j = 0; j &lt; info_ptr-&gt;height; j++) {
--                for (i = 0; i &lt; info_ptr-&gt;width; i++) {
--                        smask_data[info_ptr-&gt;width * j + i] = (row_ptr[j][i] &lt; num_trans) ? trans[row_ptr[j][i]] : 0xFF;
-+        for (j = 0; j &lt; height; j++) {
-+                for (i = 0; i &lt; width; i++) {
-+                        smask_data[width * j + i] = (row_ptr[j][i] &lt; num_trans) ? trans[row_ptr[j][i]] : 0xFF;
-                 }

--                if (HPDF_Stream_Write (image-&gt;stream, row_ptr[j], info_ptr-&gt;width) != HPDF_OK) {
-+                if (HPDF_Stream_Write (image-&gt;stream, row_ptr[j], width) != HPDF_OK) {
-                         ret = HPDF_FILE_IO_ERROR;
-                         goto Error;
-                 }
-         }

- Error:
--        for (i = 0; i &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+        for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-                 HPDF_FreeMem (image-&gt;mmgr, row_ptr[i]);
-         }

-@@ -238,6 +242,8 @@ ReadTransparentPngData  (HPDF_Dict    image,
-         HPDF_UINT i, j;
-         png_bytep *row_ptr, row;
-         png_byte color_type;
-+        png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
-+        png_uint_32 width = png_get_image_width(png_ptr, info_ptr);

-         color_type = png_get_color_type(png_ptr, info_ptr);

-@@ -245,16 +251,16 @@ ReadTransparentPngData  (HPDF_Dict    image,
-                 return HPDF_INVALID_PNG_IMAGE;
-         }

--        row_ptr = HPDF_GetMem (image-&gt;mmgr, info_ptr-&gt;height * sizeof(png_bytep));
-+        row_ptr = HPDF_GetMem (image-&gt;mmgr, height * 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 &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+                for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-                         row_ptr[i] = HPDF_GetMem(image-&gt;mmgr, len);
-                         if (!row_ptr[i]) {
--                                for (; i &gt;= 0; i--) {
-+                                for (; i &gt; 0; i--) {
-                                         HPDF_FreeMem (image-&gt;mmgr, row_ptr[i]);
-                                 }
-                                 HPDF_FreeMem (image-&gt;mmgr, row_ptr);
-@@ -271,12 +277,12 @@ ReadTransparentPngData  (HPDF_Dict    image,

-         switch (color_type) {
-                 case PNG_COLOR_TYPE_RGB_ALPHA:
--                        row_len = 3 * info_ptr-&gt;width * sizeof(png_byte);
--                        for (j = 0; j &lt; info_ptr-&gt;height; j++) {
--                                for (i = 0; i &lt; info_ptr-&gt;width; i++) {
-+                        row_len = 3 * width * sizeof(png_byte);
-+                        for (j = 0; j &lt; height; j++) {
-+                                for (i = 0; i &lt; width; i++) {
-                                         row = row_ptr[j];
-                                         memmove(row + (3 * i), row + (4*i), 3);
--                                        smask_data[info_ptr-&gt;width * j + i] = row[4 * i + 3];
-+                                        smask_data[width * j + i] = row[4 * i + 3];
-                                 }

-                                 if (HPDF_Stream_Write (image-&gt;stream, row, row_len) != HPDF_OK) {
-@@ -286,12 +292,12 @@ ReadTransparentPngData  (HPDF_Dict    image,
-                         }
-                         break;
-                 case PNG_COLOR_TYPE_GRAY_ALPHA:
--                        row_len = info_ptr-&gt;width * sizeof(png_byte);
--                        for (j = 0; j &lt; info_ptr-&gt;height; j++) {
--                                for (i = 0; i &lt; info_ptr-&gt;width; i++) {
-+                        row_len = width * sizeof(png_byte);
-+                        for (j = 0; j &lt; height; j++) {
-+                                for (i = 0; i &lt; width; i++) {
-                                         row = row_ptr[j];
-                                         row[i] = row[2 * i];
--                                        smask_data[info_ptr-&gt;width * j + i] = row[2 * i + 1];
-+                                        smask_data[width * j + i] = row[2 * i + 1];
-                                 }

-                                 if (HPDF_Stream_Write (image-&gt;stream, row, row_len) != HPDF_OK) {
-@@ -306,7 +312,7 @@ ReadTransparentPngData  (HPDF_Dict    image,
-         }

- Error:
--        for (i = 0; i &lt; (HPDF_UINT)info_ptr-&gt;height; i++) {
-+        for (i = 0; i &lt; (HPDF_UINT)height; i++) {
-                 HPDF_FreeMem (image-&gt;mmgr, row_ptr[i]);
-         }

-@@ -415,7 +421,8 @@ LoadPngData  (HPDF_Dict     image,

- {
-         HPDF_STATUS ret = HPDF_OK;
--
-+        png_uint_32 width, height;
-+        int bit_depth, color_type;
-         png_structp png_ptr = NULL;
-         png_infop info_ptr = NULL;

-@@ -447,8 +454,10 @@ LoadPngData  (HPDF_Dict     image,
-                 goto Exit;
-         }

-+        png_get_IHDR(png_ptr, info_ptr, &amp;width, &amp;height, &amp;bit_depth, &amp;color_type, NULL, NULL, NULL);
-+
-         /* 16bit images are not supported. */
--        if (info_ptr-&gt;bit_depth == 16) {
-+        if (bit_depth == 16) {
-                 png_set_strip_16(png_ptr);
-         }

-@@ -458,7 +467,7 @@ LoadPngData  (HPDF_Dict     image,
-         }

-         /* check palette-based images for transparent areas and load them immediately if found */
--        if (xref &amp;&amp; PNG_COLOR_TYPE_PALETTE &amp; info_ptr-&gt;color_type) {
-+        if (xref &amp;&amp; PNG_COLOR_TYPE_PALETTE &amp; color_type) {
-                 png_bytep trans;
-                 int num_trans;
-                 HPDF_Dict smask;
-@@ -478,10 +487,10 @@ LoadPngData  (HPDF_Dict     image,
-                 smask-&gt;header.obj_class |= HPDF_OSUBCLASS_XOBJECT;
-                 ret = HPDF_Dict_AddName (smask, &quot;Type&quot;, &quot;XObject&quot;);
-                 ret += HPDF_Dict_AddName (smask, &quot;Subtype&quot;, &quot;Image&quot;);
--                ret += HPDF_Dict_AddNumber (smask, &quot;Width&quot;, (HPDF_UINT)info_ptr-&gt;width);
--                ret += HPDF_Dict_AddNumber (smask, &quot;Height&quot;, (HPDF_UINT)info_ptr-&gt;height);
-+                ret += HPDF_Dict_AddNumber (smask, &quot;Width&quot;, (HPDF_UINT)width);
-+                ret += HPDF_Dict_AddNumber (smask, &quot;Height&quot;, (HPDF_UINT)height);
-                 ret += HPDF_Dict_AddName (smask, &quot;ColorSpace&quot;, &quot;DeviceGray&quot;);
--                ret += HPDF_Dict_AddNumber (smask, &quot;BitsPerComponent&quot;, (HPDF_UINT)info_ptr-&gt;bit_depth);
-+                ret += HPDF_Dict_AddNumber (smask, &quot;BitsPerComponent&quot;, (HPDF_UINT)bit_depth);

-                 if (ret != HPDF_OK) {
-                         HPDF_Dict_Free(smask);
-@@ -489,7 +498,7 @@ LoadPngData  (HPDF_Dict     image,
-                         goto Exit;
-                 }

--                smask_data = HPDF_GetMem(image-&gt;mmgr, info_ptr-&gt;width * info_ptr-&gt;height);
-+                smask_data = HPDF_GetMem(image-&gt;mmgr, width * height);
-                 if (!smask_data) {
-                         HPDF_Dict_Free(smask);
-                         ret = HPDF_FAILD_TO_ALLOC_MEM;
-@@ -503,7 +512,7 @@ LoadPngData  (HPDF_Dict     image,
-                         goto Exit;
-                 }

--                if (HPDF_Stream_Write(smask-&gt;stream, smask_data, info_ptr-&gt;width * info_ptr-&gt;height) != HPDF_OK) {
-+                if (HPDF_Stream_Write(smask-&gt;stream, smask_data, width * height) != HPDF_OK) {
-                         HPDF_FreeMem(image-&gt;mmgr, smask_data);
-                         HPDF_Dict_Free(smask);
-                         ret = HPDF_FILE_IO_ERROR;
-@@ -513,9 +522,9 @@ LoadPngData  (HPDF_Dict     image,


-                 ret += CreatePallet(image, png_ptr, info_ptr);
--                ret += HPDF_Dict_AddNumber (image, &quot;Width&quot;, (HPDF_UINT)info_ptr-&gt;width);
--                ret += HPDF_Dict_AddNumber (image, &quot;Height&quot;, (HPDF_UINT)info_ptr-&gt;height);
--                ret += HPDF_Dict_AddNumber (image, &quot;BitsPerComponent&quot;,        (HPDF_UINT)info_ptr-&gt;bit_depth);
-+                ret += HPDF_Dict_AddNumber (image, &quot;Width&quot;, (HPDF_UINT)width);
-+                ret += HPDF_Dict_AddNumber (image, &quot;Height&quot;, (HPDF_UINT)height);
-+                ret += HPDF_Dict_AddNumber (image, &quot;BitsPerComponent&quot;,        (HPDF_UINT)bit_depth);
-                 ret += HPDF_Dict_Add (image, &quot;SMask&quot;, smask);

-                 png_destroy_read_struct(&amp;png_ptr, &amp;info_ptr, NULL);
-@@ -526,7 +535,7 @@ no_transparent_color_in_palette:

-         /* read images with alpha channel right away 
-            we have to do this because image transparent mask must be added to the Xref */
--        if (xref &amp;&amp; PNG_COLOR_MASK_ALPHA &amp; info_ptr-&gt;color_type) {
-+        if (xref &amp;&amp; PNG_COLOR_MASK_ALPHA &amp; color_type) {
-                 HPDF_Dict smask;
-                 png_bytep smask_data;

-@@ -539,10 +548,10 @@ no_transparent_color_in_palette:
-                 smask-&gt;header.obj_class |= HPDF_OSUBCLASS_XOBJECT;
-                 ret = HPDF_Dict_AddName (smask, &quot;Type&quot;, &quot;XObject&quot;);
-                 ret += HPDF_Dict_AddName (smask, &quot;Subtype&quot;, &quot;Image&quot;);
--                ret += HPDF_Dict_AddNumber (smask, &quot;Width&quot;, (HPDF_UINT)info_ptr-&gt;width);
--                ret += HPDF_Dict_AddNumber (smask, &quot;Height&quot;, (HPDF_UINT)info_ptr-&gt;height);
-+                ret += HPDF_Dict_AddNumber (smask, &quot;Width&quot;, (HPDF_UINT)width);
-+                ret += HPDF_Dict_AddNumber (smask, &quot;Height&quot;, (HPDF_UINT)height);
-                 ret += HPDF_Dict_AddName (smask, &quot;ColorSpace&quot;, &quot;DeviceGray&quot;);
--                ret += HPDF_Dict_AddNumber (smask, &quot;BitsPerComponent&quot;, (HPDF_UINT)info_ptr-&gt;bit_depth);
-+                ret += HPDF_Dict_AddNumber (smask, &quot;BitsPerComponent&quot;, (HPDF_UINT)bit_depth);

-                 if (ret != HPDF_OK) {
-                         HPDF_Dict_Free(smask);
-@@ -550,7 +559,7 @@ no_transparent_color_in_palette:
-                         goto Exit;
-                 }

--                smask_data = HPDF_GetMem(image-&gt;mmgr, info_ptr-&gt;width * info_ptr-&gt;height);
-+                smask_data = HPDF_GetMem(image-&gt;mmgr, width * height);
-                 if (!smask_data) {
-                         HPDF_Dict_Free(smask);
-                         ret = HPDF_FAILD_TO_ALLOC_MEM;
-@@ -564,7 +573,7 @@ no_transparent_color_in_palette:
-                         goto Exit;
-                 }

--                if (HPDF_Stream_Write(smask-&gt;stream, smask_data, info_ptr-&gt;width * info_ptr-&gt;height) != HPDF_OK) {
-+                if (HPDF_Stream_Write(smask-&gt;stream, smask_data, width * height) != HPDF_OK) {
-                         HPDF_FreeMem(image-&gt;mmgr, smask_data);
-                         HPDF_Dict_Free(smask);
-                         ret = HPDF_FILE_IO_ERROR;
-@@ -572,14 +581,14 @@ no_transparent_color_in_palette:
-                 }
-                 HPDF_FreeMem(image-&gt;mmgr, smask_data);

--                if (info_ptr-&gt;color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
-+                if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
-                         ret += HPDF_Dict_AddName (image, &quot;ColorSpace&quot;, &quot;DeviceGray&quot;);
-                 } else {
-                         ret += HPDF_Dict_AddName (image, &quot;ColorSpace&quot;, &quot;DeviceRGB&quot;);
-                 }
--                ret += HPDF_Dict_AddNumber (image, &quot;Width&quot;, (HPDF_UINT)info_ptr-&gt;width);
--                ret += HPDF_Dict_AddNumber (image, &quot;Height&quot;, (HPDF_UINT)info_ptr-&gt;height);
--                ret += HPDF_Dict_AddNumber (image, &quot;BitsPerComponent&quot;,        (HPDF_UINT)info_ptr-&gt;bit_depth);
-+                ret += HPDF_Dict_AddNumber (image, &quot;Width&quot;, (HPDF_UINT)width);
-+                ret += HPDF_Dict_AddNumber (image, &quot;Height&quot;, (HPDF_UINT)height);
-+                ret += HPDF_Dict_AddNumber (image, &quot;BitsPerComponent&quot;,        (HPDF_UINT)bit_depth);
-                 ret += HPDF_Dict_Add (image, &quot;SMask&quot;, smask);

-                 png_destroy_read_struct(&amp;png_ptr, &amp;info_ptr, NULL);
-@@ -589,9 +598,9 @@ no_transparent_color_in_palette:
-         /* if the image has color palette, copy the pallet of the image to
-          * create color map.
-          */
--        if (info_ptr-&gt;color_type == PNG_COLOR_TYPE_PALETTE)
-+        if (color_type == PNG_COLOR_TYPE_PALETTE)
-                 ret = CreatePallet(image, png_ptr, info_ptr);
--        else if (info_ptr-&gt;color_type == PNG_COLOR_TYPE_GRAY)
-+        else if (color_type == PNG_COLOR_TYPE_GRAY)
-                 ret = HPDF_Dict_AddName (image, &quot;ColorSpace&quot;, &quot;DeviceGray&quot;);
-         else
-                 ret = HPDF_Dict_AddName (image, &quot;ColorSpace&quot;, &quot;DeviceRGB&quot;);
-@@ -617,16 +626,16 @@ no_transparent_color_in_palette:
-         }

-         /* setting the info of the image. */
--        if (HPDF_Dict_AddNumber (image, &quot;Width&quot;, (HPDF_UINT)info_ptr-&gt;width)
-+        if (HPDF_Dict_AddNumber (image, &quot;Width&quot;, (HPDF_UINT)width)
-                         != HPDF_OK)
-                 goto Exit;

--        if (HPDF_Dict_AddNumber (image, &quot;Height&quot;, (HPDF_UINT)info_ptr-&gt;height)
-+        if (HPDF_Dict_AddNumber (image, &quot;Height&quot;, (HPDF_UINT)height)
-                         != HPDF_OK)
-                 goto Exit;

-         if (HPDF_Dict_AddNumber (image, &quot;BitsPerComponent&quot;,
--                                (HPDF_UINT)info_ptr-&gt;bit_depth) != HPDF_OK)
-+                                (HPDF_UINT)bit_depth) != HPDF_OK)
-                 goto Exit;

-         /* clean up */
</del></span></pre>
</div>
</div>

</body>
</html>