absolute_path -> normalize_path
This commit is contained in:
parent
0dba0b9cad
commit
022c2c0d8c
1 changed files with 5 additions and 5 deletions
|
@ -269,19 +269,19 @@ mate::Handle<NativeImage> NativeImage::CreateFromJPEG(
|
||||||
mate::Handle<NativeImage> NativeImage::CreateFromPath(
|
mate::Handle<NativeImage> NativeImage::CreateFromPath(
|
||||||
v8::Isolate* isolate, const base::FilePath& path) {
|
v8::Isolate* isolate, const base::FilePath& path) {
|
||||||
gfx::ImageSkia image_skia;
|
gfx::ImageSkia image_skia;
|
||||||
base::FilePath absolute_path = NormalizePath(path);
|
base::FilePath image_path = NormalizePath(path);
|
||||||
|
|
||||||
if (absolute_path.MatchesExtension(FILE_PATH_LITERAL(".ico"))) {
|
if (image_path.MatchesExtension(FILE_PATH_LITERAL(".ico"))) {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
ReadImageSkiaFromICO(&image_skia, absolute_path);
|
ReadImageSkiaFromICO(&image_skia, image_path);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
PopulateImageSkiaRepsFromPath(&image_skia, absolute_path);
|
PopulateImageSkiaRepsFromPath(&image_skia, image_path);
|
||||||
}
|
}
|
||||||
gfx::Image image(image_skia);
|
gfx::Image image(image_skia);
|
||||||
mate::Handle<NativeImage> handle = Create(isolate, image);
|
mate::Handle<NativeImage> handle = Create(isolate, image);
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
if (IsTemplateFilename(absolute_path))
|
if (IsTemplateFilename(image_path))
|
||||||
handle->SetTemplateImage(true);
|
handle->SetTemplateImage(true);
|
||||||
#endif
|
#endif
|
||||||
return handle;
|
return handle;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue