From 76cf6fc0d6dc29a0a86e68c5f788acf5f6b7c5bf Mon Sep 17 00:00:00 2001 From: Lymia Aluysia Date: Wed, 18 Jan 2017 09:14:17 -0600 Subject: [PATCH] Suppress libpng errors. --- src/data/installer.cpp | 4 ++-- src/gfx/generated_image.cpp | 4 ++-- src/gui/control/image_card_list.cpp | 3 ++- src/gui/control/package_list.cpp | 3 ++- src/gui/util.cpp | 33 ++++++++++++++++++++++------- src/gui/util.hpp | 8 +++++++ src/gui/value/image.cpp | 10 +++++++-- src/render/value/image.cpp | 2 +- src/render/value/package_choice.cpp | 3 ++- 9 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/data/installer.cpp b/src/data/installer.cpp index bba4b7d7..21e0ad23 100644 --- a/src/data/installer.cpp +++ b/src/data/installer.cpp @@ -51,7 +51,7 @@ void Installer::validate(Version file_app_version) { try{ String filename = p->name + _("/") + p->icon_url; InputStreamP img = openIn(p->name + _("/") + p->icon_url); - p->icon.LoadFile(*img); + image_load_file(p->icon, *img); } catch (...) { // ignore errors, it's just an image p->icon_url.clear(); @@ -236,7 +236,7 @@ PackageDescription::PackageDescription(const Packaged& package) } // icon InputStreamP file = const_cast(package).openIconFile(); - if (file) icon.LoadFile(*file); + if (file) image_load_file(icon, *file); } IMPLEMENT_REFLECTION_NO_SCRIPT(PackageDescription) { diff --git a/src/gfx/generated_image.cpp b/src/gfx/generated_image.cpp index bbada75c..00338254 100644 --- a/src/gfx/generated_image.cpp +++ b/src/gfx/generated_image.cpp @@ -419,7 +419,7 @@ Image PackagedImage::generate(const Options& opt) const { if (!opt.package) throw ScriptError(_("Can only load images in a context where an image is expected")); InputStreamP file = opt.package->openIn(filename); Image img; - if (img.LoadFile(*file)) { + if (image_load_file(img, *file)) { if (img.HasMask()) img.InitAlpha(); // we can't handle masks return img; } else { @@ -495,7 +495,7 @@ Image ImageValueToImage::generate(const Options& opt) const { Image image; if (!filename.empty()) { InputStreamP image_file = opt.local_package->openIn(filename); - image.LoadFile(*image_file); + image_load_file(image, *image_file); } if (!image.Ok()) { image = Image(max(1,opt.width), max(1,opt.height)); diff --git a/src/gui/control/image_card_list.cpp b/src/gui/control/image_card_list.cpp index 47cc9c99..cc2d0f68 100644 --- a/src/gui/control/image_card_list.cpp +++ b/src/gui/control/image_card_list.cpp @@ -14,6 +14,7 @@ #include #include #include +#include DECLARE_TYPEOF_COLLECTION(FieldP); @@ -62,7 +63,7 @@ class CardThumbnailRequest : public ThumbnailRequest { try { ImageCardList* parent = (ImageCardList*)owner; Image image; - if (image.LoadFile(*parent->set->openIn(filename))) { + if (image_load_file(image, *parent->set->openIn(filename))) { // two step anti aliased resampling image.Rescale(36, 28); // step 1: no anti aliassing return resample(image, 18, 14); // step 2: with anti aliassing diff --git a/src/gui/control/package_list.cpp b/src/gui/control/package_list.cpp index dd691961..5bf460de 100644 --- a/src/gui/control/package_list.cpp +++ b/src/gui/control/package_list.cpp @@ -11,6 +11,7 @@ #include #include #include