Commit fe82212d authored by Eric Gregory's avatar Eric Gregory

4089 Camera developed RAW images don't keep transformations between sessions

The images were having their developers changed by the menu system. This is a result of the juggling between "camera" and "embedded" RAW developers we do to make this transparent to our users.
parent 17aaa566
......@@ -1063,9 +1063,9 @@ public abstract class MediaPage : CheckerboardPage {
// Make a list of all photos that need their developer changed.
Gee.ArrayList<DataView> to_set = new Gee.ArrayList<DataView>();
foreach (DataView view in get_view().get_selected()) {
Photo? p = view.get_source() as Photo;
if (p != null && p.get_raw_developer() != rd)
to_set.add(view);
Photo? p = view.get_source() as Photo;
if (p != null && (!rd.is_equivalent(p.get_raw_developer())))
to_set.add(view);
}
SetRawDeveloperCommand command = new SetRawDeveloperCommand(to_set, rd);
......
......@@ -2660,7 +2660,7 @@ public class LibraryPhotoPage : EditingHostPage {
return;
Photo? photo = get_view().get_selected().get(0).get_source() as Photo;
if (photo == null || photo.get_raw_developer() == rd)
if (photo == null || rd.is_equivalent(photo.get_raw_developer()))
return;
SetRawDeveloperCommand command = new SetRawDeveloperCommand(get_view().get_selected(), rd);
......
......@@ -304,6 +304,19 @@ public enum RawDeveloper {
}
}
// Determines if two RAW developers are equivalent, treating camera and embedded
// as the same.
public bool is_equivalent(RawDeveloper d) {
if (this == d)
return true;
if ((this == RawDeveloper.CAMERA && d == RawDeveloper.EMBEDDED) ||
(this == RawDeveloper.EMBEDDED && d == RawDeveloper.CAMERA))
return true;
return false;
}
// Creates a backing JPEG.
// raw_filepath is the full path of the imported RAW file.
public BackingPhotoRow create_backing_row_for_development(string raw_filepath) throws Error {
......
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