Improve message error when loading a sequence of png files whose color modes don't match (fix #3751)

This commit is contained in:
Martín Capello 2023-04-04 16:33:49 -03:00 committed by David Capello
parent 7422abf490
commit e577852eb4
2 changed files with 4 additions and 4 deletions

View File

@ -1309,8 +1309,10 @@ ImageRef FileOp::sequenceImage(PixelFormat pixelFormat, int w, int h)
else {
sprite = m_document->sprite();
if (sprite->pixelFormat() != pixelFormat)
if (sprite->pixelFormat() != pixelFormat) {
setError("Error: image does not match color mode\n");
return nullptr;
}
}
if (m_seq.last_cel) {

View File

@ -279,10 +279,8 @@ bool PngFormat::onLoad(FileOp* fop)
int imageWidth = png_get_image_width(png, info);
int imageHeight = png_get_image_height(png, info);
ImageRef image = fop->sequenceImage(pixelFormat, imageWidth, imageHeight);
if (!image) {
fop->setError("file_sequence_image %dx%d\n", imageWidth, imageHeight);
if (!image)
return false;
}
// Transparent color
png_color_16p png_trans_color = NULL;