diff --git a/Userland/Libraries/LibGfx/BMPLoader.cpp b/Userland/Libraries/LibGfx/BMPLoader.cpp index 92e2326185..f244c3aff2 100644 --- a/Userland/Libraries/LibGfx/BMPLoader.cpp +++ b/Userland/Libraries/LibGfx/BMPLoader.cpp @@ -6,8 +6,7 @@ #include #include -#include -#include +#include #include namespace Gfx { @@ -166,14 +165,6 @@ struct BMPLoadingContext { static RefPtr load_bmp_impl(const u8*, size_t); -RefPtr load_bmp(String const& path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_bmp_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path)); -} - RefPtr load_bmp_from_memory(u8 const* data, size_t length, String const& mmap_name) { auto bitmap = load_bmp_impl(data, length); diff --git a/Userland/Libraries/LibGfx/BMPLoader.h b/Userland/Libraries/LibGfx/BMPLoader.h index 1503bc3680..ff6d6f4832 100644 --- a/Userland/Libraries/LibGfx/BMPLoader.h +++ b/Userland/Libraries/LibGfx/BMPLoader.h @@ -12,7 +12,6 @@ namespace Gfx { -RefPtr load_bmp(String const& path); RefPtr load_bmp_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct BMPLoadingContext; diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp index b0621577f0..f8db7fa4b1 100644 --- a/Userland/Libraries/LibGfx/Bitmap.cpp +++ b/Userland/Libraries/LibGfx/Bitmap.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibGfx/DDSLoader.cpp b/Userland/Libraries/LibGfx/DDSLoader.cpp index d94165fd4a..bebd31fde9 100644 --- a/Userland/Libraries/LibGfx/DDSLoader.cpp +++ b/Userland/Libraries/LibGfx/DDSLoader.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include #include @@ -950,14 +948,6 @@ static RefPtr load_dds_impl(const u8* data, size_t length) return context.bitmap; } -RefPtr load_dds(String const& path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_dds_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path)); -} - RefPtr load_dds_from_memory(u8 const* data, size_t length, String const& mmap_name) { auto bitmap = load_dds_impl(data, length); diff --git a/Userland/Libraries/LibGfx/DDSLoader.h b/Userland/Libraries/LibGfx/DDSLoader.h index 852f410473..73116a5b43 100644 --- a/Userland/Libraries/LibGfx/DDSLoader.h +++ b/Userland/Libraries/LibGfx/DDSLoader.h @@ -233,7 +233,6 @@ struct DDSHeaderDXT10 { u32 misc_flag2 {}; }; -RefPtr load_dds(String const& path); RefPtr load_dds_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct DDSLoadingContext; diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp index cfb6d68c98..497421a721 100644 --- a/Userland/Libraries/LibGfx/GIFLoader.cpp +++ b/Userland/Libraries/LibGfx/GIFLoader.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include #include @@ -82,14 +80,6 @@ struct GIFLoadingContext { RefPtr prev_frame_buffer; }; -RefPtr load_gif(String const& path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_gif_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path)); -} - RefPtr load_gif_from_memory(u8 const* data, size_t length, String const& mmap_name) { GIFImageDecoderPlugin gif_decoder(data, length); diff --git a/Userland/Libraries/LibGfx/GIFLoader.h b/Userland/Libraries/LibGfx/GIFLoader.h index 07eb4d6286..1487cd0302 100644 --- a/Userland/Libraries/LibGfx/GIFLoader.h +++ b/Userland/Libraries/LibGfx/GIFLoader.h @@ -12,7 +12,6 @@ namespace Gfx { -RefPtr load_gif(String const& path); RefPtr load_gif_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct GIFLoadingContext; diff --git a/Userland/Libraries/LibGfx/ICOLoader.cpp b/Userland/Libraries/LibGfx/ICOLoader.cpp index dd4890c01c..ef92832344 100644 --- a/Userland/Libraries/LibGfx/ICOLoader.cpp +++ b/Userland/Libraries/LibGfx/ICOLoader.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include #include @@ -91,14 +89,6 @@ struct ICOLoadingContext { size_t largest_index; }; -RefPtr load_ico(StringView path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_ico_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path)); -} - RefPtr load_ico_from_memory(u8 const* data, size_t length, String const& mmap_name) { ICOImageDecoderPlugin decoder(data, length); diff --git a/Userland/Libraries/LibGfx/ICOLoader.h b/Userland/Libraries/LibGfx/ICOLoader.h index eb2b948c70..4487e86917 100644 --- a/Userland/Libraries/LibGfx/ICOLoader.h +++ b/Userland/Libraries/LibGfx/ICOLoader.h @@ -12,7 +12,6 @@ namespace Gfx { -RefPtr load_ico(StringView path); RefPtr load_ico_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct ICOLoadingContext; diff --git a/Userland/Libraries/LibGfx/JPGLoader.cpp b/Userland/Libraries/LibGfx/JPGLoader.cpp index c064908b1d..914e8deaa8 100644 --- a/Userland/Libraries/LibGfx/JPGLoader.cpp +++ b/Userland/Libraries/LibGfx/JPGLoader.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -1235,14 +1234,6 @@ static RefPtr load_jpg_impl(const u8* data, size_t data_size) return context.bitmap; } -RefPtr load_jpg(String const& path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_jpg_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), path); -} - RefPtr load_jpg_from_memory(u8 const* data, size_t length, String const& mmap_name) { auto bitmap = load_jpg_impl(data, length); diff --git a/Userland/Libraries/LibGfx/JPGLoader.h b/Userland/Libraries/LibGfx/JPGLoader.h index 04741fa978..284ae076f0 100644 --- a/Userland/Libraries/LibGfx/JPGLoader.h +++ b/Userland/Libraries/LibGfx/JPGLoader.h @@ -6,16 +6,11 @@ #pragma once -#include #include -#include -#include #include -#include namespace Gfx { -RefPtr load_jpg(String const& path); RefPtr load_jpg_from_memory(u8 const* data, size_t length, String const& mmap_name = ""); struct JPGLoadingContext; diff --git a/Userland/Libraries/LibGfx/PBMLoader.cpp b/Userland/Libraries/LibGfx/PBMLoader.cpp index 8373a076e9..242719abf0 100644 --- a/Userland/Libraries/LibGfx/PBMLoader.cpp +++ b/Userland/Libraries/LibGfx/PBMLoader.cpp @@ -8,9 +8,6 @@ #include "PortableImageLoaderCommon.h" #include "Streamer.h" #include -#include -#include -#include #include namespace Gfx { @@ -97,11 +94,6 @@ static bool read_image_data(PBMLoadingContext& context, Streamer& streamer) return true; } -RefPtr load_pbm(StringView path) -{ - return load(path); -} - RefPtr load_pbm_from_memory(u8 const* data, size_t length, String const& mmap_name) { return load_from_memory(data, length, mmap_name); diff --git a/Userland/Libraries/LibGfx/PBMLoader.h b/Userland/Libraries/LibGfx/PBMLoader.h index 7520823b4d..ea15e46b48 100644 --- a/Userland/Libraries/LibGfx/PBMLoader.h +++ b/Userland/Libraries/LibGfx/PBMLoader.h @@ -7,12 +7,10 @@ #pragma once #include -#include #include namespace Gfx { -RefPtr load_pbm(StringView path); RefPtr load_pbm_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct PBMLoadingContext; diff --git a/Userland/Libraries/LibGfx/PGMLoader.cpp b/Userland/Libraries/LibGfx/PGMLoader.cpp index eb04c31139..928892bbe7 100644 --- a/Userland/Libraries/LibGfx/PGMLoader.cpp +++ b/Userland/Libraries/LibGfx/PGMLoader.cpp @@ -8,8 +8,6 @@ #include "PortableImageLoaderCommon.h" #include "Streamer.h" #include -#include -#include #include namespace Gfx { @@ -99,11 +97,6 @@ static bool read_image_data(PGMLoadingContext& context, Streamer& streamer) return true; } -RefPtr load_pgm(StringView path) -{ - return load(path); -} - RefPtr load_pgm_from_memory(u8 const* data, size_t length, String const& mmap_name) { return load_from_memory(data, length, mmap_name); diff --git a/Userland/Libraries/LibGfx/PGMLoader.h b/Userland/Libraries/LibGfx/PGMLoader.h index a64259a66a..019463fd16 100644 --- a/Userland/Libraries/LibGfx/PGMLoader.h +++ b/Userland/Libraries/LibGfx/PGMLoader.h @@ -12,7 +12,6 @@ namespace Gfx { -RefPtr load_pgm(StringView path); RefPtr load_pgm_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct PGMLoadingContext; diff --git a/Userland/Libraries/LibGfx/PNGLoader.cpp b/Userland/Libraries/LibGfx/PNGLoader.cpp index d92cbaf0a3..990356de78 100644 --- a/Userland/Libraries/LibGfx/PNGLoader.cpp +++ b/Userland/Libraries/LibGfx/PNGLoader.cpp @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include #include @@ -169,14 +167,6 @@ private: static RefPtr load_png_impl(const u8*, size_t); static bool process_chunk(Streamer&, PNGLoadingContext& context); -RefPtr load_png(String const& path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_png_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path)); -} - RefPtr load_png_from_memory(u8 const* data, size_t length, String const& mmap_name) { auto bitmap = load_png_impl(data, length); diff --git a/Userland/Libraries/LibGfx/PNGLoader.h b/Userland/Libraries/LibGfx/PNGLoader.h index 56b0860c3b..21c570c512 100644 --- a/Userland/Libraries/LibGfx/PNGLoader.h +++ b/Userland/Libraries/LibGfx/PNGLoader.h @@ -7,12 +7,10 @@ #pragma once #include -#include #include namespace Gfx { -RefPtr load_png(String const& path); RefPtr load_png_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct PNGLoadingContext; diff --git a/Userland/Libraries/LibGfx/PPMLoader.cpp b/Userland/Libraries/LibGfx/PPMLoader.cpp index dc4c0fbdce..d647160f82 100644 --- a/Userland/Libraries/LibGfx/PPMLoader.cpp +++ b/Userland/Libraries/LibGfx/PPMLoader.cpp @@ -101,11 +101,6 @@ static bool read_image_data(PPMLoadingContext& context, Streamer& streamer) return true; } -RefPtr load_ppm(StringView path) -{ - return load(path); -} - RefPtr load_ppm_from_memory(u8 const* data, size_t length, String const& mmap_name) { return load_from_memory(data, length, mmap_name); diff --git a/Userland/Libraries/LibGfx/PPMLoader.h b/Userland/Libraries/LibGfx/PPMLoader.h index 82824a7d8f..bcbe7e90b8 100644 --- a/Userland/Libraries/LibGfx/PPMLoader.h +++ b/Userland/Libraries/LibGfx/PPMLoader.h @@ -12,7 +12,6 @@ namespace Gfx { -RefPtr load_ppm(StringView path); RefPtr load_ppm_from_memory(u8 const*, size_t, String const& mmap_name = ""); struct PPMLoadingContext; diff --git a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h index fd901be4ac..7c9cfc75f3 100644 --- a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h +++ b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include #include #include @@ -272,13 +270,4 @@ static RefPtr load_from_memory(u8 const* data, size_t length, Strin return bitmap; } -template -static RefPtr load(StringView path) -{ - auto file_or_error = MappedFile::map(path); - if (file_or_error.is_error()) - return nullptr; - return load_from_memory((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path)); -} - }