mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 00:52:58 +00:00
Merge pull request #3167 from michaelbach/main
Fix #3166: zero width/height for svg images
This commit is contained in:
1 file changed
+7
@@ -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];
|
||||
|
||||
|
||||
Reference in new issue
Block a user