bugfixes for static init filereader concrete classes

This commit is contained in:
Mark Vejvoda
2010-03-24 22:50:45 +00:00
parent b22adbfa02
commit 844ca894b4
6 changed files with 59 additions and 18 deletions

View File

@@ -108,6 +108,7 @@ Pixmap2D* PNGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const
png_read_image(png_ptr, row_pointers);
int fileComponents = info_ptr->rowbytes/info_ptr->width;
int picComponents = (ret->getComponents()==-1)?fileComponents:ret->getComponents();
std::cout << "PNG-Components: Pic: " << picComponents << " old: " << (ret->getComponents()) << " File: " << fileComponents << std::endl;
//Copy image
ret->init(width,height,picComponents);
uint8* pixels = ret->getPixels();