Browse Source

clean up null checks on CameraModel/LensModel

main
Colin McMillen 10 months ago
parent
commit
d52e8fce79
  1. 9
      Program.cs

9
Program.cs

@ -144,8 +144,8 @@ void main() {
public class Photo {
public string File;
public bool Loaded = false;
public string? CameraModel;
public string? LensModel;
public string CameraModel = "";
public string LensModel = "";
public string FocalLength = "<unk>";
public string FNumber = "<unk>";
public string ExposureTime = "<unk>";
@ -166,15 +166,16 @@ public class Photo {
ExifProfile? exifs = image.Metadata.ExifProfile;
if (exifs != null) {
// FIXME: handle Orientation
// FIXME: handle date shot / edited (and sort by shot date?)
IExifValue<string>? model;
if (exifs.TryGetValue(ExifTag.Model, out model)) {
CameraModel = model.Value;
CameraModel = model.Value ?? "";
}
IExifValue<string>? lensModel;
if (exifs.TryGetValue(ExifTag.LensModel, out lensModel)) {
LensModel = lensModel.Value;
LensModel = lensModel.Value ?? "";
}
IExifValue<Rational>? focalLength;

Loading…
Cancel
Save