diff --git a/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.cs b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.cs new file mode 100644 index 000000000..6d02a3ebc --- /dev/null +++ b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Immutable; +using System.IO; +using System.Reflection; +using System.Text.Json; +using starsky.foundation.storage.Storage; +using starskytest.FakeMocks; + +namespace starskytest.FakeCreateAn.CreateAnImageLongDescriptionTitle; + +public class CreateAnImageLongDescriptionTitle +{ + public readonly ImmutableArray Bytes = [..Array.Empty()]; + + public CreateAnImageLongDescriptionTitle() + { + var dirName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + if ( string.IsNullOrEmpty(dirName) ) + { + return; + } + + var path = Path.Combine(dirName, "FakeCreateAn", + "CreateAnImageLongDescriptionTitle", "CreateAnImageLongDescriptionTitle.jpg"); + + Bytes = [..StreamToBytes(path)]; + ReadAndSetJson(dirName); + } + + public CreateAnImageLongDescriptionTitleExampleDataModel? JsonExpectData { get; set; } + + private void ReadAndSetJson(string dirName) + { + var jsonPath = Path.Combine(dirName, "FakeCreateAn", + "CreateAnImageLongDescriptionTitle", "CreateAnImageLongDescriptionTitle.json"); + var json = File.ReadAllText(jsonPath); + JsonExpectData = + JsonSerializer.Deserialize(json); + } + + private static byte[] StreamToBytes(string path) + { + var input = new StorageHostFullPathFilesystem(new FakeIWebLogger()).ReadStream(path); + using var ms = new MemoryStream(); + input.CopyTo(ms); + input.Dispose(); + return ms.ToArray(); + } +} diff --git a/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.jpg b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.jpg new file mode 100644 index 000000000..5b4438ff0 Binary files /dev/null and b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.jpg differ diff --git a/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.json b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.json new file mode 100644 index 000000000..77d9f65dd --- /dev/null +++ b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitle.json @@ -0,0 +1,5 @@ +{ + "Tags": "Pieterpad, hiking in the Netherlands, long-distance hiking, Dutch countryside, travel experiences, nature photography, personal growth journey, trail tips, walking holidays, outdoor adventure, trail reviews, backpacking tips, Dutch landscapes, cultural experiences, best hiking trails, Dutch history, scenic trails, nature conservation, eco-friendly travel, regional food and drinks, local wildlife, mindfulness in nature, rural villages, historic landmarks, Netherlands travel blog, fitness and wellness, gear recommendations, hiking with friends, solo hiking, seasonal hiking advice, trail safety tips", + "Title": "Embarking on the Ultimate Adventure Across the Netherlands: A Complete Guide to Hiking the Legendary Pieterpad Trail from the Northern Village of Pieterburen to the Southern Hills of Sint Pietersberg – Including Essential Tips, Scenic Highlights, Personal Stories, Practical Advice on Gear and Accommodations, Dutch Cultural Experiences, Local Food Discoveries, and Inspiring Insights for an Unforgettable Journey Through Diverse Landscapes, Historical Towns, and Hidden Gems Along the Way", + "Description": "Explore the captivating journey along the Pieterpad, a legendary 500-kilometer walking trail that takes you from the quiet, rustic village of Pieterburen in the north to the dramatic, limestone hills near Sint Pietersberg in the south. This extensive path is not only a physical journey across the length of the Netherlands but also a mental and emotional experience that challenges, rejuvenates, and brings hikers closer to nature, culture, and themselves. Along the Pieterpad, you’ll witness a beautiful mosaic of Dutch landscapes: from vibrant green pastures, tranquil forests, and charming cobblestone streets to fields dotted with traditional windmills and quaint, cozy inns offering a warm local welcome.Each stage of the Pieterpad has its own unique appeal, from the wild beauty of Groningen's northern wetlands to the historical heartlands of Drenthe, where ancient dolmens (hunebedden) tell the story of early inhabitants, and finally, to the scenic Limburg hills that offer some of the most breathtaking views in the country. This blog delves into the highlights of each stage, sharing practical tips for beginners and seasoned hikers alike, whether it’s selecting the right footwear for varied terrain, packing the essentials, finding peaceful overnight stays, or capturing the best nature photography spots along the way.Hiking the Pieterpad is also a journey into Dutch culture and history, revealing unique customs, regional delicacies, and local hospitality that enrich every step. Discover traditional Dutch snacks like poffertjes and erwtensoep, savor regional specialties, and learn about each town’s unique heritage, from the peat bogs of Drenthe to the castles of Gelderland. My blog offers insights on how to travel sustainably, practice mindfulness in nature, and respect the environment to help preserve these landscapes for future generations.Whether you're looking for a scenic route to challenge yourself physically, searching for moments of solitude and reflection, or hoping to connect with fellow hikers, my Pieterpad journey blog brings you inspiring stories, gear recommendations, and essential trail tips. Dive into tales of adventure, unexpected encounters, moments of solitude, and personal growth as I guide you through each step of the Pieterpad, encouraging you to embark on your own unforgettable adventure through the Netherlands’ most treasured hiking trail" +} diff --git a/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitleExampleDataModel.cs b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitleExampleDataModel.cs new file mode 100644 index 000000000..4bfc016b2 --- /dev/null +++ b/starsky/starskytest/FakeCreateAn/CreateAnImageLongDescriptionTitle/CreateAnImageLongDescriptionTitleExampleDataModel.cs @@ -0,0 +1,8 @@ +namespace starskytest.FakeCreateAn.CreateAnImageLongDescriptionTitle; + +public class CreateAnImageLongDescriptionTitleExampleDataModel +{ + public string? Title { get; set; } + public string? Description { get; set; } + public string? Tags { get; set; } +} diff --git a/starsky/starskytest/starsky.foundation.readmeta/Services/ReadMeta_ExifReadTest.cs b/starsky/starskytest/starsky.foundation.readmeta/Services/ReadMeta_ExifReadTest.cs index da77ad50d..25f292c6c 100644 --- a/starsky/starskytest/starsky.foundation.readmeta/Services/ReadMeta_ExifReadTest.cs +++ b/starsky/starskytest/starsky.foundation.readmeta/Services/ReadMeta_ExifReadTest.cs @@ -16,6 +16,7 @@ using starskytest.FakeCreateAn; using starskytest.FakeCreateAn.CreateAnImageA330Raw; using starskytest.FakeCreateAn.CreateAnImageA6600Raw; +using starskytest.FakeCreateAn.CreateAnImageLongDescriptionTitle; using starskytest.FakeMocks; using XmpCore; using XmpCore.Impl; @@ -336,6 +337,23 @@ public void ExifRead_ReadExifFromFileTest() Assert.AreEqual(ImageStabilisationType.Unknown, item.ImageStabilisation); } + [TestMethod] + public void ExifRead_ReadExifFromFileTest_LongDescriptionTitle() + { + var newImage = new CreateAnImageLongDescriptionTitle(); + var imageBytes = newImage.Bytes.ToArray(); + var fakeStorage = new FakeIStorage(new List { "/" }, + new List { "/test.jpg" }, new List { imageBytes }); + + var item = + new ReadMetaExif(fakeStorage, null!, new FakeIWebLogger()).ReadExifFromFile( + "/test.jpg"); + + Assert.AreEqual(newImage.JsonExpectData?.Description, item.Description); + Assert.AreEqual(newImage.JsonExpectData?.Tags, item.Tags); + Assert.AreEqual(newImage.JsonExpectData?.Title, item.Title); + } + [TestMethod] public void ExifRead_CreateAnImageA6600Raw_ReadExifFromFileTest() { diff --git a/starsky/starskytest/starskytest.csproj b/starsky/starskytest/starskytest.csproj index c8a0a0c94..326bbfb68 100644 --- a/starsky/starskytest/starskytest.csproj +++ b/starsky/starskytest/starskytest.csproj @@ -131,9 +131,17 @@ PreserveNewest - + - PreserveNewest + PreserveNewest + + + + PreserveNewest + + + + PreserveNewest