wrong logic here to create blank PNG image in memory

v0.27.3
HumanDynamo 16 years ago
parent b916c89320
commit b625d025c8

@ -31,7 +31,7 @@ EXIV2_RCSID("@(#) $Id$")
// ***************************************************************************** // *****************************************************************************
//#define DEBUG 1 #define DEBUG 1
// ***************************************************************************** // *****************************************************************************
// included header files // included header files
@ -78,10 +78,18 @@ namespace Exiv2 {
{ {
if (create) if (create)
{ {
if (io_->open()) if (io_->open() == 0)
{ {
#ifdef DEBUG
std::cerr << "Exiv2::PngImage:: Creating PNG image to memory\n";
#endif
IoCloser closer(*io_); IoCloser closer(*io_);
io_->write(pngBlank, sizeof(pngBlank)); if (io_->write(pngBlank, sizeof(pngBlank)) != sizeof(pngBlank))
{
#ifdef DEBUG
std::cerr << "Exiv2::PngImage:: Failed to create PNG image on memory\n";
#endif
}
} }
} }
} // PngImage::PngImage } // PngImage::PngImage

@ -78,7 +78,6 @@ namespace Exiv2
method to get a temporary reference. method to get a temporary reference.
@param create Specifies if an existing image should be read (false) @param create Specifies if an existing image should be read (false)
or if a new file should be created (true). or if a new file should be created (true).
This option is not yet implemented.
*/ */
PngImage(BasicIo::AutoPtr io, bool create); PngImage(BasicIo::AutoPtr io, bool create);
//@} //@}

Loading…
Cancel
Save