summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yang <chao.yang@linaro.org>2011-11-14 14:19:18 +0000
committerTony Mansson <tony.mansson@linaro.org>2011-11-30 14:20:00 +0100
commitff5356497da16cecbd511303844b935b4a98dd55 (patch)
tree589375cae0960cf943de15cf1f7dde474a4094c3
parent4abc51753c40d39701beae07a658ef0364c0c245 (diff)
downloadbase-ff5356497da16cecbd511303844b935b4a98dd55.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;