mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
PixelPaint: Remove unused Image::write_to_file() method
This seems to be a remnant from before FileSystemAccessClient was used.
This commit is contained in:
parent
a203e714ec
commit
aee52a458b
2 changed files with 0 additions and 15 deletions
|
@ -14,7 +14,6 @@
|
|||
#include <AK/JsonObjectSerializer.h>
|
||||
#include <AK/JsonValue.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/BMPWriter.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
@ -149,19 +148,6 @@ void Image::serialize_as_json(JsonObjectSerializer<StringBuilder>& json) const
|
|||
}
|
||||
}
|
||||
|
||||
ErrorOr<void> Image::write_to_file(String const& file_path) const
|
||||
{
|
||||
StringBuilder builder;
|
||||
auto json = MUST(JsonObjectSerializer<>::try_create(builder));
|
||||
serialize_as_json(json);
|
||||
MUST(json.finish());
|
||||
|
||||
auto file = TRY(Core::File::open(file_path, (Core::OpenMode)(Core::OpenMode::WriteOnly | Core::OpenMode::Truncate)));
|
||||
if (!file->write(builder.string_view()))
|
||||
return Error::from_errno(file->error());
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Gfx::Bitmap>> Image::try_compose_bitmap(Gfx::BitmapFormat format) const
|
||||
{
|
||||
auto bitmap = TRY(Gfx::Bitmap::try_create(format, m_size));
|
||||
|
|
|
@ -73,7 +73,6 @@ public:
|
|||
void paint_into(GUI::Painter&, Gfx::IntRect const& dest_rect) const;
|
||||
|
||||
void serialize_as_json(JsonObjectSerializer<StringBuilder>& json) const;
|
||||
ErrorOr<void> write_to_file(String const& file_path) const;
|
||||
ErrorOr<void> export_bmp_to_file(Core::File&, bool preserve_alpha_channel);
|
||||
ErrorOr<void> export_png_to_file(Core::File&, bool preserve_alpha_channel);
|
||||
ErrorOr<void> export_qoi_to_file(Core::File&) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue