Remove some top level tags when saving to uncompressed tiff, also simplified generation of 'Software' tag
This commit is contained in:
@@ -1347,9 +1347,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::ustring rtVersion("RawTherapee ");
|
TIFFSetField (out, TIFFTAG_SOFTWARE, "RawTherapee " VERSION);
|
||||||
rtVersion += VERSION;
|
|
||||||
TIFFSetField (out, TIFFTAG_SOFTWARE, rtVersion.c_str());
|
|
||||||
TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
|
TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
|
||||||
TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
|
TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
|
||||||
TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
|
TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
|
||||||
|
|||||||
@@ -2792,8 +2792,6 @@ TagDirectory* ExifManager::parseTIFF (FILE* f, bool skipIgnored)
|
|||||||
|
|
||||||
std::vector<Tag*> ExifManager::getDefaultTIFFTags (TagDirectory* forthis)
|
std::vector<Tag*> ExifManager::getDefaultTIFFTags (TagDirectory* forthis)
|
||||||
{
|
{
|
||||||
Glib::ustring rtVersion("RawTherapee ");
|
|
||||||
rtVersion += VERSION;
|
|
||||||
|
|
||||||
std::vector<Tag*> defTags;
|
std::vector<Tag*> defTags;
|
||||||
|
|
||||||
@@ -2803,7 +2801,7 @@ std::vector<Tag*> ExifManager::getDefaultTIFFTags (TagDirectory* forthis)
|
|||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "XResolution"), 300, RATIONAL));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "XResolution"), 300, RATIONAL));
|
||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "YResolution"), 300, RATIONAL));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "YResolution"), 300, RATIONAL));
|
||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ResolutionUnit"), 2, SHORT));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "ResolutionUnit"), 2, SHORT));
|
||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), rtVersion.c_str()));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Software"), "RawTherapee " VERSION));
|
||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Orientation"), 1, SHORT));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "Orientation"), 1, SHORT));
|
||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "SamplesPerPixel"), 3, SHORT));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "SamplesPerPixel"), 3, SHORT));
|
||||||
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "BitsPerSample"), 8, SHORT));
|
defTags.push_back (new Tag (forthis, lookupAttrib(ifdAttribs, "BitsPerSample"), 8, SHORT));
|
||||||
@@ -2882,6 +2880,13 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro
|
|||||||
|
|
||||||
if (root) {
|
if (root) {
|
||||||
cl = (const_cast<TagDirectory*>(root))->clone (NULL);
|
cl = (const_cast<TagDirectory*>(root))->clone (NULL);
|
||||||
|
// remove some unknown top level tags which produce warnings when opening a tiff
|
||||||
|
Tag *removeTag = cl->getTag(0x9003);
|
||||||
|
if(removeTag)
|
||||||
|
removeTag->setKeep(false);
|
||||||
|
removeTag = cl->getTag(0x9211);
|
||||||
|
if(removeTag)
|
||||||
|
removeTag->setKeep(false);
|
||||||
} else {
|
} else {
|
||||||
cl = new TagDirectory (NULL, ifdAttribs, HOSTORDER);
|
cl = new TagDirectory (NULL, ifdAttribs, HOSTORDER);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user