Two recent posts on PointlessWaymarks.com - Camera and Lens Going into 2025 and 2024 Photographs - caused me to look a little more closely at the at the 'Details' presentation generated by the Pointless Waymarks CMS for photographs.
Before considering any changes I took a quick look at the details blocks of some well known photo sites: Flickr, 500px, SmugMug, PhotoPrism (you will have to find example pages to see the position and interaction associated with these).
There are nice details in all of the examples above but ultimately for the purposes and currently style of a Pointless Waymarks CMS site I think the basic setup of the current block holds up reasonably well.
But it is certainly not perfect and I did find some improvements to make:
- Move the focal length to a more useful/logical position
- Correct the Aperture from f to ƒ
- Remove the 'Details:' text/header. In the big picture this below the fold block of data is obscure information for curious photographers. There could be some utility in links or other help for someone who is curious but doesn't understand - however the text 'Details:' was not helping anyone.
The most interesting programing detail in this update was cleaning up the Aperture presentation. I don't want to limit what can be entered as Aperture and instead just cleanup well known formats to get a consistent string as possible. A simple example might be turning f9.0 into ƒ/9. The code I came up with:
public static string ApertureCleanup(string? aperture)
{
if (string.IsNullOrWhiteSpace(aperture))
return string.Empty;
// Remove f, ƒ, f/ or ƒ/ at the start of the aperture string
var apertureForCleaning = aperture.Trim();
if (apertureForCleaning.StartsWith("f/", StringComparison.OrdinalIgnoreCase) || apertureForCleaning.StartsWith("ƒ/", StringComparison.OrdinalIgnoreCase))
apertureForCleaning = apertureForCleaning.Substring(2);
else if (apertureForCleaning.StartsWith("f", StringComparison.OrdinalIgnoreCase) || apertureForCleaning.StartsWith("ƒ", StringComparison.OrdinalIgnoreCase))
apertureForCleaning = apertureForCleaning.Substring(1);
if (decimal.TryParse(apertureForCleaning, out var apertureValue))
{
var cultureSeparator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
var apertureStringDecimal = apertureValue.ToString(CultureInfo.CurrentCulture);
apertureStringDecimal = apertureStringDecimal.Contains(cultureSeparator) ? apertureStringDecimal.TrimEnd('0').TrimEnd(cultureSeparator.ToCharArray()) : apertureStringDecimal;
return $"ƒ/{apertureStringDecimal}";
}
// Return the original string if it is not a recognizable format and value
return aperture.TrimNullToEmpty();
}
The detail that 'got me' was turning the decimal to a no trailing zeros string. I thought the solution was a 'G0' format - but ".00009" would become 9E-05. As far as I know it is incredibly unlikely a valid Aperture value would ever hit that, but I ended up on Stack Overflow looking at c# - Remove trailing zeros. With all the format options available I was a bit surprised that the solution ultimately involved string manipulation...
The recent Gear Post post on PointlessWaymarks.com is the first time I wanted to present the Photo Details outside of a Photo Page/Post. Pushing the full Photo Details Block into a post would be too much of a distraction, so I added a photo variation that includes the Photo Details in the caption.
The detail variation is made available by referring to the photo with {{photowdetails ....}} instead of the normal {{photo ...}} bracket code - example below.
These changes are barely large enough to write about but photography and photographs are important to me. The Pointless Waymarks CMS does not create dedicated photography sites - it does support all the pieces that you might need to tell stories with photography: files and images to reference, posts to bring things together, maps and geographic information...