Skip to content

Commit

Permalink
FIX: Crash when trying to use indexed images as input
Browse files Browse the repository at this point in the history
  • Loading branch information
spillerrec committed Sep 20, 2015
1 parent c9eb44d commit 466d6d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ class Image {
* \param [in] img The image data */
Image( QPoint pos, QImage img ) : pos(pos), img(img) { }

/** \param [in] img QImage which will be converted to ARGB32 and positioned at {0,0} */
Image( QImage img ) : Image( {0,0}, img.convertToFormat(QImage::Format_ARGB32) ) { }

/** \param [in] path Load the image at **path** on the file system */
Image( QString path ) : Image( {0,0}, QImage(path).convertToFormat(QImage::Format_ARGB32) ) { }
Image( QString path ) : Image( QImage(path) ) { }

private:
Image( QPoint pos, QImage img, QImage mask ) : pos(pos), img(img), mask(mask) { }
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ int main( int argc, char* argv[] ){

MultiImage multi_img( format );
for( auto image : images )
multi_img.append( Image( {0,0}, image.second ) );
multi_img.append( Image( image.second ) );

doMultiImg( multi_img, name );
}
Expand Down Expand Up @@ -175,7 +175,7 @@ int main( int argc, char* argv[] ){
if( options.contains( "--auto" ) && !last.isNull() && !isSimilar( current, last ) )
break;

multi_img.append( Image( {0,0}, current ) );
multi_img.append( Image( current ) );
last = current;
}

Expand Down

0 comments on commit 466d6d9

Please sign in to comment.