only encode if image has dimensions (avoid abort in png writer on zero size width or height)
This commit is contained in:
parent
a682212266
commit
bfd79276a7
1 changed files with 2 additions and 2 deletions
|
@ -248,7 +248,7 @@ void save_to_stream(T const& image,
|
||||||
std::string const& type,
|
std::string const& type,
|
||||||
rgba_palette const& palette)
|
rgba_palette const& palette)
|
||||||
{
|
{
|
||||||
if (stream)
|
if (stream && image.width() > 0 && image.height() > 0)
|
||||||
{
|
{
|
||||||
//all this should go into image_writer factory
|
//all this should go into image_writer factory
|
||||||
std::string t = boost::algorithm::to_lower_copy(type);
|
std::string t = boost::algorithm::to_lower_copy(type);
|
||||||
|
@ -299,7 +299,7 @@ void save_to_stream(T const& image,
|
||||||
std::ostream & stream,
|
std::ostream & stream,
|
||||||
std::string const& type)
|
std::string const& type)
|
||||||
{
|
{
|
||||||
if (stream)
|
if (stream && image.width() > 0 && image.height() > 0)
|
||||||
{
|
{
|
||||||
//all this should go into image_writer factory
|
//all this should go into image_writer factory
|
||||||
std::string t = boost::algorithm::to_lower_copy(type);
|
std::string t = boost::algorithm::to_lower_copy(type);
|
||||||
|
|
Loading…
Reference in a new issue