Various bugfix (see #4008) :
1. RT could crash in some circumstances with single frame image 2. UNICODE UserComment now done when already existing in raw file 3. When editing UserComment in the ExifPanel, the Value filed is now filled with the current value
This commit is contained in:
@@ -803,11 +803,11 @@ rtexif::TagDirectory* FramesData::getBestExifData (ImageSource *imgSource, procp
|
||||
eSensorType sensorType = imgSource->getSensorType();
|
||||
unsigned int imgNum = 0;
|
||||
if (sensorType == ST_BAYER) {
|
||||
imgNum = rtengine::LIM<unsigned int>(rawParams->bayersensor.imageNum, 1, frames.size());
|
||||
imgNum = rtengine::LIM<unsigned int>(rawParams->bayersensor.imageNum, 0, frames.size() - 1);
|
||||
/*
|
||||
// might exist someday ?
|
||||
} else if (sensorType == ST_FUJI_XTRANS) {
|
||||
imgNum = rtengine::LIM(rawParams->xtranssensor.imageNum, 1, frames.size());
|
||||
imgNum = rtengine::LIM<unsigned int>(rawParams->xtranssensor.imageNum, 0, frames.size() - 1);
|
||||
} else if (sensorType == ST_NONE && !imgSource->isRAW()) {
|
||||
// standard image multiframe support should come here (when implemented in GUI)
|
||||
*/
|
||||
|
@@ -730,7 +730,12 @@ void TagDirectory::applyChange (std::string name, Glib::ustring value)
|
||||
} else if (value == "#delete" && t) {
|
||||
t->setKeep (false);
|
||||
} else if (t && !t->isDirectory()) {
|
||||
t->valueFromString (value);
|
||||
if (name == "UserComment") {
|
||||
// UserComment can be Unicode
|
||||
t->userCommentFromString (value);
|
||||
} else {
|
||||
t->valueFromString (value);
|
||||
}
|
||||
} else {
|
||||
const TagAttrib* attrib = nullptr;
|
||||
|
||||
@@ -1752,6 +1757,19 @@ void Tag::valueFromString (const std::string& value)
|
||||
}
|
||||
}
|
||||
|
||||
void Tag::userCommentFromString (const Glib::ustring& text)
|
||||
{
|
||||
|
||||
if (!allocOwnMemory) {
|
||||
return;
|
||||
}
|
||||
if (value) {
|
||||
delete [] value;
|
||||
value = nullptr;
|
||||
}
|
||||
initUserComment(text);
|
||||
}
|
||||
|
||||
int Tag::calculateSize ()
|
||||
{
|
||||
int size = 0;
|
||||
|
@@ -290,9 +290,10 @@ public:
|
||||
|
||||
|
||||
// additional getter/setter for more comfortable use
|
||||
std::string valueToString ();
|
||||
std::string nameToString (int i = 0);
|
||||
void valueFromString (const std::string& value);
|
||||
std::string valueToString ();
|
||||
std::string nameToString (int i = 0);
|
||||
void valueFromString (const std::string& value);
|
||||
void userCommentFromString (const Glib::ustring& text);
|
||||
|
||||
// functions for writing
|
||||
int calculateSize ();
|
||||
|
@@ -284,11 +284,12 @@ void ExifPanel::addDirectory (const TagDirectory* dir, Gtk::TreeModel::Children
|
||||
continue;
|
||||
}
|
||||
|
||||
if (t->isDirectory())
|
||||
if (t->isDirectory()) {
|
||||
for (int j = 0; t->getDirectory (j); j++) {
|
||||
Gtk::TreeModel::Children ch = addTag (root, t->nameToString (j), M ("EXIFPANEL_SUBDIRECTORY"), currAttrib ? currAttrib->action : AC_DONTWRITE, currAttrib && currAttrib->editable);
|
||||
addDirectory (t->getDirectory (j), ch);
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
addTag (root, t->nameToString (), t->valueToString (), currAttrib ? (t->getOwnMemory() ? currAttrib->action : AC_SYSTEM) : AC_DONTWRITE, currAttrib && currAttrib->editable);
|
||||
}
|
||||
}
|
||||
@@ -631,11 +632,11 @@ Glib::ustring ExifPanel::getSelection (bool onlyeditable)
|
||||
while (iter) {
|
||||
if (first) {
|
||||
ret = iter->get_value (exifColumns.field_nopango);
|
||||
editable = iter->get_value (exifColumns.editable);
|
||||
} else {
|
||||
ret = iter->get_value (exifColumns.field_nopango) + "." + ret;
|
||||
}
|
||||
|
||||
editable = iter->get_value (exifColumns.editable);
|
||||
iter = iter->parent ();
|
||||
first = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user