mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
PixelPaint: Add exporting to the QOI image format
This commit is contained in:
parent
44a5558525
commit
be4913c1fb
Notes:
sideshowbarker
2024-07-17 11:50:27 +09:00
Author: https://github.com/iCristalrope
Commit: be4913c1fb
Pull-request: https://github.com/SerenityOS/serenity/pull/13558
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/linusg ✅
3 changed files with 26 additions and 0 deletions
|
@ -191,6 +191,19 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
GUI::MessageBox::show_error(&window, String::formatted("Export to PNG failed: {}", result.error()));
|
||||
}));
|
||||
|
||||
m_export_submenu->add_action(
|
||||
GUI::Action::create(
|
||||
"As &QOI", [&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
VERIFY(editor);
|
||||
auto response = FileSystemAccessClient::Client::the().try_save_file(&window, "untitled", "qoi");
|
||||
if (response.is_error())
|
||||
return;
|
||||
auto result = editor->image().export_qoi_to_file(response.value());
|
||||
if (result.is_error())
|
||||
GUI::MessageBox::show_error(&window, String::formatted("Export to QOI failed: {}", result.error()));
|
||||
}));
|
||||
|
||||
m_export_submenu->set_icon(g_icon_bag.file_export);
|
||||
|
||||
file_menu.add_separator();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue