Pointless Waymarks Software

Software from the Desert Southwest

Small Photo Page Update, Photo Details in Captions, Aperture Update - 1/6/2025

Created by Charles on 1/6/2025. Updated on 1/7/2025.

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.

2025 January Photo Content Page Details Block - Before Update
Photo Content Page Details Block - Before Update.

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).

2025 January Flickr Photo Details Block
Flickr Photo Details Block.
2025 January 500px Photo Details Block
500px Photo Details Block.
2025 January Smugmug Compact Photo Details
Smugmug Compact Photo Details.
2025 January Photoprism Details Block
Photoprism Details Block.

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:

2025 January Photo Content Page Details Band - After Update
2025 January Photo Content Page Details Band - After Update.

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.

2024 December Rail Feather
2024 December Rail Feather. Charles Miles. 12/3/2024. ƒ/9, 1/160, ISO 800, 70 mm, E 70-300mm F4.5-6.3 A047, SONY ILCE-7RM4, © 2024 Charles Miles.

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...


Tags:
Posts Before/After: