Commit 8ccaa7f6 authored by Jim Nelson's avatar Jim Nelson

#2475: Now adding Software version to metadata when exporting and writing to master file.

parent cc1031bd
......@@ -89,6 +89,9 @@ public class MetadataWriter : Object {
changed = true;
}
if (changed)
metadata.set_software(Resources.APP_TITLE, Resources.APP_VERSION);
return changed;
}
}
......
......@@ -2564,6 +2564,7 @@ public abstract class Photo : PhotoSource {
metadata.set_title(get_title());
metadata.set_pixel_dimensions(get_dimensions()); // created by sniffing pixbuf not metadata
metadata.set_orientation(get_orientation());
metadata.set_software(Resources.APP_TITLE, Resources.APP_VERSION);
if (get_orientation() != get_original_orientation())
metadata.remove_exif_thumbnail();
......@@ -2613,6 +2614,7 @@ public abstract class Photo : PhotoSource {
metadata.set_title(get_title());
metadata.set_pixel_dimensions(Dimensions.for_pixbuf(pixbuf));
metadata.set_orientation(Orientation.TOP_LEFT);
metadata.set_software(Resources.APP_TITLE, Resources.APP_VERSION);
if (get_exposure_time() != 0)
metadata.set_exposure_date_time(new MetadataDateTime(get_exposure_time()));
......
......@@ -1033,6 +1033,22 @@ public class PhotoMetadata {
return get_string_interpreted("Exif.Image.Software");
}
public void set_software(string software, string version) {
// always set this one, even if EXIF not present
set_string("Exif.Image.Software", "%s %s".printf(software, version));
if (has_iptc()) {
set_string("Iptc.Application2.Program", software);
set_string("Iptc.Application2.ProgramVersion", version);
}
}
public void remove_software() {
remove_tag("Exif.Image.Software");
remove_tag("Iptc.Application2.Program");
remove_tag("Iptc.Application2.ProgramVersion");
}
public string? get_exposure_bias() {
return get_string_interpreted("Exif.Photo.ExposureBiasValue");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment