add PGF creation from scratch in memory
This commit is contained in:
parent
67dfeaf3bd
commit
8a3e708fd6
@ -57,13 +57,38 @@ EXIV2_RCSID("@(#) $Id: pgfimage.cpp 1750 2009-02-16 14:30:51Z ahuggel $")
|
||||
// Signature from front of PGF file
|
||||
const unsigned char pgfSignature[3] = { 0x50, 0x47, 0x46 };
|
||||
|
||||
const unsigned char pgfBlank[] = { 0x50,0x47,0x46,0x36,0x10,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x18,0x03,0x03,0x00,0x00,0x00,0x14,0x00,0x67,0x08,0x20,0x00,0xc0,0x01,
|
||||
0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,
|
||||
0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,
|
||||
0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,
|
||||
0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
// *****************************************************************************
|
||||
// class member definitions
|
||||
namespace Exiv2 {
|
||||
|
||||
PgfImage::PgfImage(BasicIo::AutoPtr io, bool /*create*/)
|
||||
: Image(ImageType::pgf, mdExif | mdIptc | mdComment, io)
|
||||
PgfImage::PgfImage(BasicIo::AutoPtr io, bool create)
|
||||
: Image(ImageType::pgf, mdExif | mdIptc| mdXmp | mdComment, io)
|
||||
{
|
||||
if (create)
|
||||
{
|
||||
if (io_->open() == 0)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
std::cerr << "Exiv2::PgfImage:: Creating PGF image to memory\n";
|
||||
#endif
|
||||
IoCloser closer(*io_);
|
||||
if (io_->write(pgfBlank, sizeof(pgfBlank)) != sizeof(pgfBlank))
|
||||
{
|
||||
#ifdef DEBUG
|
||||
std::cerr << "Exiv2::PgfImage:: Failed to create PGF image on memory\n";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
} // PgfImage::PgfImage
|
||||
|
||||
void PgfImage::readMetadata()
|
||||
|
||||
@ -77,7 +77,6 @@ namespace Exiv2
|
||||
method to get a temporary reference.
|
||||
@param create Specifies if an existing image should be read (false)
|
||||
or if a new file should be created (true).
|
||||
This option is not yet implemented.
|
||||
*/
|
||||
PgfImage(BasicIo::AutoPtr io, bool create);
|
||||
//@}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user