mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Gif exporting now works in HTML5
This commit is contained in:
parent
f3bce3857a
commit
205e72f356
|
@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
This update has been brought to you by the contributions of:
|
This update has been brought to you by the contributions of:
|
||||||
Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo
|
Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo, Michael Alexsander (YeldhamDev), Martin Novák (novhack)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- The Web (HTML5) is now a supported platform of Pixelorama! It is now possible to save .png and .pxo files, as well as load image and palette files in the Web version. Only limitation so far is that the users cannot load .pxo files. Also, this may not work on mobile.
|
- The Web (HTML5) is now a supported platform of Pixelorama! It is now possible to save .png and .pxo files, as well as load image and palette files in the Web version. Only limitation so far is that the users cannot load .pxo files. Also, this may not work on mobile.
|
||||||
|
@ -31,6 +31,7 @@ Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo
|
||||||
- Added color previews next to the themes in Preferences.
|
- Added color previews next to the themes in Preferences.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- The GDNative gif exporter addon has been replaced with a GDScript equivalent. This makes gif exporting possible in all currently supported platforms, and it also adds support for transparency. ([#295](https://github.com/Orama-Interactive/Pixelorama/pull/295))
|
||||||
- Drawing is no longer limited by the canvas boundaries. This means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
|
- Drawing is no longer limited by the canvas boundaries. This means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
|
||||||
- The guides are now the same for all frames.
|
- The guides are now the same for all frames.
|
||||||
- The "Import" option from the file menu has been removed, users can now import image files from "Open".
|
- The "Import" option from the file menu has been removed, users can now import image files from "Open".
|
||||||
|
@ -62,6 +63,7 @@ Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo
|
||||||
- Importing corrupted image files and non-palette json files no longer crash the app.
|
- Importing corrupted image files and non-palette json files no longer crash the app.
|
||||||
- Drawing brushes no longer have clipping issues. ([#281](https://github.com/Orama-Interactive/Pixelorama/pull/281))
|
- Drawing brushes no longer have clipping issues. ([#281](https://github.com/Orama-Interactive/Pixelorama/pull/281))
|
||||||
- When undoing a removal of a brush, the brush index is no longer incorrect. ([#281](https://github.com/Orama-Interactive/Pixelorama/pull/281))
|
- When undoing a removal of a brush, the brush index is no longer incorrect. ([#281](https://github.com/Orama-Interactive/Pixelorama/pull/281))
|
||||||
|
- Fix out-of-bounds error when color picking outside the image. ([#291](https://github.com/Orama-Interactive/Pixelorama/pull/291))
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
## [v0.7] - 2020-05-16
|
## [v0.7] - 2020-05-16
|
||||||
|
|
|
@ -229,6 +229,9 @@ msgstr ""
|
||||||
msgid "Directory path or file name is not valid!"
|
msgid "Directory path or file name is not valid!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Exporting in progress..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Can't load file '%s'.\n"
|
msgid "Can't load file '%s'.\n"
|
||||||
"Error code: %s"
|
"Error code: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -179,9 +179,12 @@ func export_processed_images(ignore_overwrites: bool, export_dialog: AcceptDialo
|
||||||
scale_processed_images()
|
scale_processed_images()
|
||||||
|
|
||||||
if current_tab == ExportTab.ANIMATION and animation_type == AnimationType.ANIMATED:
|
if current_tab == ExportTab.ANIMATION and animation_type == AnimationType.ANIMATED:
|
||||||
if gif_export_thread.is_active():
|
if OS.get_name() == "HTML5":
|
||||||
gif_export_thread.wait_to_finish()
|
export_gif({"export_dialog": export_dialog, "export_paths": export_paths})
|
||||||
gif_export_thread.start(self, "export_gif", {"export_dialog": export_dialog, "export_paths": export_paths})
|
else:
|
||||||
|
if gif_export_thread.is_active():
|
||||||
|
gif_export_thread.wait_to_finish()
|
||||||
|
gif_export_thread.start(self, "export_gif", {"export_dialog": export_dialog, "export_paths": export_paths})
|
||||||
else:
|
else:
|
||||||
for i in range(processed_images.size()):
|
for i in range(processed_images.size()):
|
||||||
if OS.get_name() == "HTML5":
|
if OS.get_name() == "HTML5":
|
||||||
|
@ -224,11 +227,15 @@ func export_gif(args: Dictionary) -> void:
|
||||||
write_frame_to_gif(processed_images[i], Global.animation_timer.wait_time, exporter, args["export_dialog"])
|
write_frame_to_gif(processed_images[i], Global.animation_timer.wait_time, exporter, args["export_dialog"])
|
||||||
for i in range(processed_images.size() - 2, 0, -1):
|
for i in range(processed_images.size() - 2, 0, -1):
|
||||||
write_frame_to_gif(processed_images[i], Global.animation_timer.wait_time, exporter, args["export_dialog"])
|
write_frame_to_gif(processed_images[i], Global.animation_timer.wait_time, exporter, args["export_dialog"])
|
||||||
var file: File = File.new()
|
|
||||||
|
|
||||||
file.open(args["export_paths"][0], File.WRITE)
|
if OS.get_name() == "HTML5":
|
||||||
file.store_buffer(exporter.export_file_data())
|
Html5FileExchange.save_gif(exporter.export_file_data(), args["export_paths"][0])
|
||||||
file.close()
|
|
||||||
|
else:
|
||||||
|
var file: File = File.new()
|
||||||
|
file.open(args["export_paths"][0], File.WRITE)
|
||||||
|
file.store_buffer(exporter.export_file_data())
|
||||||
|
file.close()
|
||||||
args["export_dialog"].toggle_export_progress_popup(false)
|
args["export_dialog"].toggle_export_progress_popup(false)
|
||||||
Global.notification_label("File(s) exported")
|
Global.notification_label("File(s) exported")
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,13 @@ func save_image(image : Image, file_name : String = "export") -> void:
|
||||||
JavaScript.eval("download('%s', %s, 'image/png');" % [file_name, str(png_data)], true)
|
JavaScript.eval("download('%s', %s, 'image/png');" % [file_name, str(png_data)], true)
|
||||||
|
|
||||||
|
|
||||||
|
func save_gif(data, file_name : String = "export") -> void:
|
||||||
|
if OS.get_name() != "HTML5" or !OS.has_feature('JavaScript'):
|
||||||
|
return
|
||||||
|
|
||||||
|
JavaScript.eval("download('%s', %s, 'image/gif');" % [file_name, str(Array(data))], true)
|
||||||
|
|
||||||
|
|
||||||
func load_shader() -> void:
|
func load_shader() -> void:
|
||||||
if OS.get_name() != "HTML5" or !OS.has_feature('JavaScript'):
|
if OS.get_name() != "HTML5" or !OS.has_feature('JavaScript'):
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue