remove uneeded asserts in png_io

This commit is contained in:
Dane Springmeyer 2014-04-09 19:34:13 -04:00
parent ecbba52bc0
commit d577b0814b

View file

@ -36,9 +36,6 @@
// boost // boost
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
// stl
#include <cassert>
extern "C" extern "C"
{ {
#include <png.h> #include <png.h>
@ -542,11 +539,9 @@ void save_as_png8_oct(T1 & file,
std::vector<rgb> pal; std::vector<rgb> pal;
trees[j].setOffset( static_cast<unsigned>(palette.size())); trees[j].setOffset( static_cast<unsigned>(palette.size()));
trees[j].create_palette(pal); trees[j].create_palette(pal);
assert(pal.size() <= opts.colors);
leftovers = cols[j] - static_cast<unsigned>(pal.size()); leftovers = cols[j] - static_cast<unsigned>(pal.size());
cols[j] = static_cast<unsigned>(pal.size()); cols[j] = static_cast<unsigned>(pal.size());
palette.insert(palette.begin(), pal.begin(), pal.end()); palette.insert(palette.begin(), pal.begin(), pal.end());
assert(palette.size() <= 256);
} }
} }
@ -684,7 +679,6 @@ void save_as_png8_hex(T1 & file,
//transparency values per palette index //transparency values per palette index
std::vector<mapnik::rgba> pal; std::vector<mapnik::rgba> pal;
tree.create_palette(pal); tree.create_palette(pal);
assert(int(pal.size()) <= opts.colors);
std::vector<mapnik::rgb> palette; std::vector<mapnik::rgb> palette;
std::vector<unsigned> alphaTable; std::vector<unsigned> alphaTable;
for(unsigned i=0; i<pal.size(); i++) for(unsigned i=0; i<pal.size(); i++)