minor cleanups

This commit is contained in:
Colin McMillen 2023-07-25 17:10:51 -04:00
parent 060565b44a
commit 4f1adef895

View File

@ -176,9 +176,9 @@ public class Photo {
// We don't assign to this.image until Load() is done, because we might
// edit the image due to rotation (etc) and don't want to try generating
// a texture for it until that's already happened.
Image<Rgba32> tmpImage = await Image.LoadAsync<Rgba32>(File);
Util.RotateImageFromExif(tmpImage, Orientation);
image = tmpImage;
Image<Rgba32> tmp = await Image.LoadAsync<Rgba32>(File);
Util.RotateImageFromExif(tmp, Orientation);
image = tmp;
}
private bool TryParseRating(XmpProfile? xmp, out int rating) {
@ -211,7 +211,6 @@ public class Photo {
// FIXME: when we write out images, we'll want to correct the Exif Orientation to 1.
// FIXME: handle date shot / edited (and sort by shot date?)
// FIXME: PixelXDimension & PixelYDimension hold the image geometry in Exif.
IExifValue<ushort>? orientation;
if (exifs.TryGetValue(ExifTag.Orientation, out orientation)) {
@ -296,12 +295,8 @@ public class Photo {
}
public string Description() {
if (Loaded) {
string shootingInfo = $"{FocalLength}, {FNumber} at {ExposureTime}, {IsoSpeed}";
return String.Format("{0,-40} {1,-50} {2}", shootingInfo, $"{CameraModel} {LensModel}", File);
} else {
return String.Format("{0,-90} {1}", "", File);
}
string shootingInfo = $"{FocalLength}, {FNumber} at {ExposureTime}, {IsoSpeed}";
return String.Format("{0,-40} {1,-50} {2}", shootingInfo, $"{CameraModel} {LensModel}", File);
}
}