Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Forget committed Dec 10, 2023
1 parent 3d9bfbc commit 8f46217
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 12 deletions.
21 changes: 17 additions & 4 deletions Custom Options/andydragon.imagedetailscore_options.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"warnMissingLens": true,
"recursiveFolders": false,
"defaultArtist": "Andrew Forget",
"skipDate": true,
"folderSearchExtensions": [
".jpg",
".jpeg"
".NEF",
".ORF",
".RAF"
],
"cameras": [
{ "source": "OLYMPUS E-500", "display": "OLYMPUS E-500" },
Expand Down Expand Up @@ -42,6 +44,14 @@

{ "source": "NIKKOR Z 85mm f/1.8 S", "display": "NIKKOR Z 85mm f/1.8 S" },

{ "source": "NIKKOR Z 70-200mm f/2.8 VR S", "display": "NIKKOR Z 70-200mm f/2.8 VR S" },
{ "source": "NIKKOR Z 70-200mm f/2.8 VR S Z TC-1.4x", "display": "NIKKOR Z 70-200mm f/2.8 VR S + 1.4x TC" },
{ "source": "NIKKOR Z 70-200mm f/2.8 VR S Z TC-2.0x", "display": "NIKKOR Z 70-200mm f/2.8 VR S + 2.0x TC" },

{ "source": "NIKKOR Z 180-600mm f/5.6-6.3 VR", "display": "NIKKOR Z 180-600mm f/5.6-6.3 VR" },
{ "source": "NIKKOR Z 180-600mm f/5.6-6.3 VR Z TC-1.4x", "display": "NIKKOR Z 180-600mm f/5.6-6.3 VR + 1.4x TC" },
{ "source": "NIKKOR Z 180-600mm f/5.6-6.3 VR Z TC-2.0x", "display": "NIKKOR Z 180-600mm f/5.6-6.3 VR + 2.0x TC" },

{ "source": "70-200mm f/2.8", "display": "TAMRON SP 70-200mm f/2.8 Di VC USD G2 A025N" },
{ "source": "70.0-200.0 mm f/2.8", "display": "TAMRON SP 70-200mm f/2.8 Di VC USD G2 A025N" },
{ "source": "TAMRON SP 70-200mm F_2.8 Di A001N", "display": "TAMRON SP 70-200mm f/2.8 Di VC USD G2 A025N" },
Expand All @@ -54,6 +64,8 @@
{ "source": "TAMRON SP 15-30mm f/2.8 Di VC USD G2 A041N", "display": "TAMRON SP 15-30mm f/2.8 Di VC USD G2 A041N" },

{ "source": "70.0-300.0 mm f/4.0-5.6", "display": "TAMRON AF 70-300mm f/4-5.6 Di LD MACRO A017N" },
{ "source": "70-300mm f/4.0-5.6", "display": "TAMRON AF 70-300mm f/4-5.6 Di LD MACRO A017N" },

{ "source": "TAMRON 70-300mm F4-5.6 Di A17N", "display": "TAMRON AF 70-300mm f/4-5.6 Di LD MACRO A017N" },
{ "source": "TAMRON AF 70-300mm f/4-5.6 Di LD MACRO A17N", "display": "TAMRON AF 70-300mm f/4-5.6 Di LD MACRO A017N" },
{ "source": "Nikon DX 18-200mm f3.5-5.6 G ED IF", "display": "TAMRON AF 70-300mm f/4-5.6 Di LD MACRO A017N" },
Expand All @@ -64,6 +76,7 @@
{ "source": "TAMRON SP 150-600mm f/5-6.3 Di VC USD G2 A022N", "display": "TAMRON SP 150-600mm f/5-6.3 Di VC USD G2 A022N" },

{ "source": "20.0 mm f/1.4", "display": "SIGMA 20mm f/1.4 DG HSM A015" },
{ "source": "20mm f/1.4G", "display": "SIGMA 20mm f/1.4 DG HSM A015" },
{ "source": "SIGMA 20mm F1.4 DG HSM A015", "display": "SIGMA 20mm f/1.4 DG HSM A015" },
{ "source": "SIGMA 20mm f/1.4 DG HSM A015", "display": "SIGMA 20mm f/1.4 DG HSM A015" },

Expand All @@ -89,8 +102,8 @@
{ "source": "Olympus Zuiko Digital 40-150mm f/3.5-4.5", "display": "OLYMPUS Zuiko 40-150mm f/3.5-4.5" },

{ "source": "OLYMPUS M.100-400mm F5.0-6.3", "display": "OLYMPUS Zuiko 100-400mm f/5-6.3" },
{ "source": "M.100-400mm F5.0-6.3 + MC-14", "display": "OLYMPUS Zuiko 100-400mm f/5-6.3 + 1.4 TC" },
{ "source": "M.100-400mm F5.0-6.3 + MC-14", "display": "OLYMPUS Zuiko 100-400mm f/5-6.3 + 1.4x TC" },

{ "source": "GF32-64mmF4 R LM WR", "display": "FUJINON GF 32-64mm f/4 R LM WR" },
{ "source": "GF32-64mmF4 R LM WR", "display": "FUJINON GF 32-64mm f/4 R LM WR" }
]
}
36 changes: 28 additions & 8 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Options
public IList<string> FolderSearchExtensions { get; set; }
public bool UseScaling { get; set; }
public string DefaultArtist { get; set; }
public bool SkipDate { get; set; }
public IList<MapValue> Cameras { get; set; }
public IList<MapValue> Lenses { get; set; }
}
Expand Down Expand Up @@ -126,7 +127,7 @@ class Program
{
BackgroundBrush = new SolidBrush(Color.FromArgb(40, 40, 40)),
ForegroundBrush = new SolidBrush(Color.FromArgb(215, 215, 215)),
CameraForegroundBrush = new SolidBrush(Color.FromArgb(215, 215, 0)),
CameraForegroundBrush = new SolidBrush(Color.FromArgb(226, 226, 0)),
LabelBrush = new SolidBrush(Color.FromArgb(113, 113, 0)),
BorderBrush = new SolidBrush(Color.FromArgb(226, 226, 0)),
ImageLocation = "Resources/Themes/dark",
Expand All @@ -138,7 +139,7 @@ class Program
{
BackgroundBrush = new SolidBrush(Color.FromArgb(40, 40, 40)),
ForegroundBrush = new SolidBrush(Color.FromArgb(215, 215, 215)),

Check warning on line 141 in Program.cs

View workflow job for this annotation

GitHub Actions / build (macOS-latest)

This call site is reachable on all platforms. 'SolidBrush' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
CameraForegroundBrush = new SolidBrush(Color.FromArgb(144, 215, 144)),
CameraForegroundBrush = new SolidBrush(Color.FromArgb(144, 226, 144)),
LabelBrush = new SolidBrush(Color.FromArgb(96, 113, 96)),
BorderBrush = new SolidBrush(Color.FromArgb(144, 226, 144)),

Check warning on line 144 in Program.cs

View workflow job for this annotation

GitHub Actions / build (macOS-latest)

This call site is reachable on all platforms. 'SolidBrush' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
ImageLocation = "Resources/Themes/dark",
Expand Down Expand Up @@ -174,8 +175,8 @@ class Program
{
BackgroundBrush = new SolidBrush(Color.FromArgb(40, 40, 40)),
ForegroundBrush = new SolidBrush(Color.FromArgb(215, 215, 215)),
CameraForegroundBrush = new SolidBrush(Color.FromArgb(48, 96, 215)),
LabelBrush = new SolidBrush(Color.FromArgb(24, 48, 113)),
CameraForegroundBrush = new SolidBrush(Color.FromArgb(72, 144, 226)),
LabelBrush = new SolidBrush(Color.FromArgb(48, 96, 113)),
BorderBrush = new SolidBrush(Color.FromArgb(72, 144, 226)),
ImageLocation = "Resources/Themes/dark",
}
Expand Down Expand Up @@ -311,6 +312,9 @@ private static void OutputBadge(string file, string assemblyLocation, Options op
var exposureProgram = GetStringValue(directories, new[] {
Locator("Exif SubIFD", "Exposure Program"),
}) ?? "n/a";
var exposureMode = GetStringValue(directories, new[] {
Locator("Exif SubIFD", "Exposure Mode"),
}) ?? "n/a";

var whiteBalanceMode = GetStringValue(directories, new[] {
Locator("Exif SubIFD", "White Balance Mode"),
Expand Down Expand Up @@ -422,6 +426,14 @@ private static void OutputBadge(string file, string assemblyLocation, Options op
}

// Fix up exposure prgm
if (exposureProgram == "Unknown (0)")
{
exposureProgram = exposureMode;
}
if (exposureProgram == "n/a")
{
exposureProgram = exposureMode;
}
if (exposureProgram.Length > 24)
{
int position = exposureProgram.Substring(0, 24).LastIndexOf(' ');
Expand Down Expand Up @@ -504,11 +516,19 @@ private static void OutputBadge(string file, string assemblyLocation, Options op
// Draw the exposure program
DrawValue(graphics, theme, drawingScale, 11, 28, 240, 198, Path.Combine(imageLocation, @"exposure.png"), "EXPOSURE PROGRAM", exposureProgram);

// Draw the date
DrawValue(graphics, theme, drawingScale, 11, 28, 28, 238, Path.Combine(imageLocation, @"calendar.png"), "DATE", dateTimeOriginal);
if (options.SkipDate)
{
// Draw the date
DrawValue(graphics, theme, drawingScale, 11, 28, 28, 238, Path.Combine(imageLocation, @"artist.png"), "ARTIST", artist);
}
else
{
// Draw the date
DrawValue(graphics, theme, drawingScale, 11, 28, 28, 238, Path.Combine(imageLocation, @"calendar.png"), "DATE", dateTimeOriginal);

// Draw the time
DrawValue(graphics, theme, drawingScale, 11, 28, 240, 238, Path.Combine(imageLocation, @"artist.png"), "ARTIST", artist);
// Draw the time
DrawValue(graphics, theme, drawingScale, 11, 28, 240, 238, Path.Combine(imageLocation, @"artist.png"), "ARTIST", artist);
}
}
var output = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file) + "_info.png");
if (options.UseScaling)
Expand Down

0 comments on commit 8f46217

Please sign in to comment.