Skip to content

Commit 92fb03e

Browse files
henry0312julienXX
authored andcommitted
get imageURL with fileURLWithPath if no scheme
This supports spaces and multibyte characters in file path.
1 parent 319b687 commit 92fb03e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Terminal Notifier/AppDelegate.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ - (NSImage*)getImageFromURL:(NSString *) url;
221221
NSURL *imageURL = [NSURL URLWithString:url];
222222
if([[imageURL scheme] length] == 0){
223223
// Prefix 'file://' if no scheme
224-
url = [NSString stringWithFormat:@"%@%@", @"file://", url];
225-
imageURL = [NSURL URLWithString:url];
224+
imageURL = [NSURL fileURLWithPath:url];
226225
}
227226
return [[NSImage alloc] initWithContentsOfURL:imageURL];
228227
}

0 commit comments

Comments
 (0)