Skip to content

Commit 955881f

Browse files
committed
get imageURL with fileURLWithPath if no scheme
This supports spaces and multibyte characters in file path.
1 parent b2a6877 commit 955881f

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
@@ -208,8 +208,7 @@ - (NSImage*)getImageFromURL:(NSString *) url;
208208
NSURL *imageURL = [NSURL URLWithString:url];
209209
if([[imageURL scheme] length] == 0){
210210
// Prefix 'file://' if no scheme
211-
url = [NSString stringWithFormat:@"%@%@", @"file://", url];
212-
imageURL = [NSURL URLWithString:url];
211+
imageURL = [NSURL fileURLWithPath:url];
213212
}
214213
return [[NSImage alloc] initWithContentsOfURL:imageURL];
215214
}

0 commit comments

Comments
 (0)