Merge pull request #3167 from michaelbach/main

Fix #3166: zero width/height for svg images
This commit is contained in:
daboe01 authored and GitHub committed 2025-12-27 22:15:15 +01:00
commit ca9b8a78b2
1 file changed
+7
+7
View File
@@ -30,6 +30,13 @@ int getImageSize(const char* utf8Path, BOOL appendLineFeed)
NSImageRep *representation = representations[0];
NSInteger width = [representation pixelsWide];
NSInteger height = [representation pixelsHigh];
NSString *extension = [[path pathExtension] lowercaseString];
if ([extension isEqualToString:@"svg"])
{
width = [image size].width;
height = [image size].height;
}
NSMutableString* result = [NSMutableString stringWithFormat:@"{\"width\":%ld, \"height\":%ld}", (long)width, (long)height];