summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yang <chao.yang@linaro.org>2011-11-14 14:18:54 +0000
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2011-12-17 11:54:47 +0059
commitf64cfc7d50d12ec58d4bb978bc035db08ff4f660 (patch)
tree10e78a79328a493a03567799c7de83f79545411b
parent8d8a0f7c7c31714446f88710910d86906c059c88 (diff)
downloadbase-f64cfc7d50d12ec58d4bb978bc035db08ff4f660.tar.gz
aapt: update interfaces to libpng 1.5.7 beta 01
Libpng 1.5.7 beta 01 is integrated, where some interfaces are changed and some structures are not visible to libpng clients any more. The structure information can be retrieved through specific interfaces. The call to png_set_filler() is removed as it can corrupt some png files. This function was used for libpng 1.2.4, but actually it did nothing in aapt. Remove a building warning in ZipFile.h. Change-Id: I92ca6a2c0d734f9a5187d5a7f6727b8be0e77133
-rw-r--r--tools/aapt/Images.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp
index ffbe875b72f7..37e253c1045e 100644
--- a/tools/aapt/Images.cpp
+++ b/tools/aapt/Images.cpp
@@ -18,7 +18,8 @@
static void
png_write_aapt_file(png_structp png_ptr, png_bytep data, png_size_t length)
{
- status_t err = ((AaptFile*)png_ptr->io_ptr)->writeData(data, length);
+ AaptFile* io_ptr = (AaptFile*)png_get_io_ptr(png_ptr);
+ status_t err = io_ptr->writeData(data, length);
if (err != NO_ERROR) {
png_error(png_ptr, "Write Error");
}
@@ -83,7 +84,7 @@ static void read_png(const char* imageName,
png_set_palette_to_rgb(read_ptr);
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
- png_set_gray_1_2_4_to_8(read_ptr);
+ png_set_expand_gray_1_2_4_to_8(read_ptr);
if (png_get_valid(read_ptr, read_info, PNG_INFO_tRNS)) {
//printf("Has PNG_INFO_tRNS!\n");
@@ -937,7 +938,6 @@ static void write_png(const char* imageName,
png_bytepp rows;
if (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
- png_set_filler(write_ptr, 0, PNG_FILLER_AFTER);
rows = imageInfo.rows;
} else {
rows = outRows;