From 907450a63d9ac8e655242e0052256c357f22922a Mon Sep 17 00:00:00 2001 From: Michael Bach Date: Sat, 27 Dec 2025 21:38:14 +0100 Subject: [PATCH 1/2] Fix zero width/height for svg images --- Tools/imagesize/imagesize.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tools/imagesize/imagesize.m b/Tools/imagesize/imagesize.m index 3d427ec65..87d35e4f0 100644 --- a/Tools/imagesize/imagesize.m +++ b/Tools/imagesize/imagesize.m @@ -30,6 +30,12 @@ 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]; From c05b900fe613f402c7fd0539b5826d6d59c88c47 Mon Sep 17 00:00:00 2001 From: Michael Bach Date: Sat, 27 Dec 2025 21:58:00 +0100 Subject: [PATCH 2/2] improve formatting of fox --- Tools/imagesize/imagesize.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/imagesize/imagesize.m b/Tools/imagesize/imagesize.m index 87d35e4f0..6ca2eeeb4 100644 --- a/Tools/imagesize/imagesize.m +++ b/Tools/imagesize/imagesize.m @@ -31,6 +31,7 @@ int getImageSize(const char* utf8Path, BOOL appendLineFeed) NSInteger width = [representation pixelsWide]; NSInteger height = [representation pixelsHigh]; NSString *extension = [[path pathExtension] lowercaseString]; + if ([extension isEqualToString:@"svg"]) { width = [image size].width;