summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/ICOLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGfx/ICOLoader.cpp')
-rw-r--r--Userland/Libraries/LibGfx/ICOLoader.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/Userland/Libraries/LibGfx/ICOLoader.cpp b/Userland/Libraries/LibGfx/ICOLoader.cpp
index cc0ee6dc05..6102ea5898 100644
--- a/Userland/Libraries/LibGfx/ICOLoader.cpp
+++ b/Userland/Libraries/LibGfx/ICOLoader.cpp
@@ -96,19 +96,15 @@ RefPtr<Gfx::Bitmap> load_ico(const StringView& path)
auto file_or_error = MappedFile::map(path);
if (file_or_error.is_error())
return nullptr;
- ICOImageDecoderPlugin decoder((const u8*)file_or_error.value()->data(), file_or_error.value()->size());
- auto bitmap = decoder.bitmap();
- if (bitmap)
- bitmap->set_mmap_name(String::formatted("Gfx::Bitmap [{}] - Decoded ICO: {}", bitmap->size(), LexicalPath::canonicalized_path(path)));
- return bitmap;
+ return load_ico_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path));
}
-RefPtr<Gfx::Bitmap> load_ico_from_memory(const u8* data, size_t length)
+RefPtr<Gfx::Bitmap> load_ico_from_memory(u8 const* data, size_t length, String const& mmap_name)
{
ICOImageDecoderPlugin decoder(data, length);
auto bitmap = decoder.bitmap();
if (bitmap)
- bitmap->set_mmap_name(String::formatted("Gfx::Bitmap [{}] - Decoded ICO: <memory>", bitmap->size()));
+ bitmap->set_mmap_name(String::formatted("Gfx::Bitmap [{}] - Decoded ICO: {}", bitmap->size(), mmap_name));
return bitmap;
}