From 9f31b1f67a9092b4e7ccf788c8b8e4913d5ea0e1 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 17 Feb 2025 18:36:18 +0100 Subject: [PATCH] Fix image aspect ratio --- CHDataManagement/Generator/ImageSet.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHDataManagement/Generator/ImageSet.swift b/CHDataManagement/Generator/ImageSet.swift index e635f85..f0b5c65 100644 --- a/CHDataManagement/Generator/ImageSet.swift +++ b/CHDataManagement/Generator/ImageSet.swift @@ -52,13 +52,13 @@ struct ImageSet: HtmlProducer { let prefix1x = "/\(image.outputImageFolder)/\(maxWidth)x\(maxHeight)" let prefix2x = "/\(image.outputImageFolder)/\(maxWidth*2)x\(maxHeight*2)" - let imageSize = (image.getImageDimensions()?.scaledToFit(in: .init(width: maxWidth, height: maxHeight))) - .map { " width='\(Int($0.width))' height='\(Int($0.height))'" } + let aspectRatio = (image.getImageDimensions()?.scaledToFit(in: .init(width: maxWidth, height: maxHeight))) + .map { " aspect-ratio='\(Int($0.width)) / \(Int($0.height))'" } result += "" result += "" result += "" - result += "" + result += "" result += "" } }