When exporting JSON using exportStateHistory, there is an issue with images included #308
-
When using exportStateHistory to export JSON, if a sticker is included, the Uint8List image will be stored in the JSON, which will cause the stored JSON to become larger and affect performance. Is there any good solution? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
I have released version Please note that when you import the history, you will need to manually re-add the stickers. However, you can retrieve the sticker state, including their positions, from the history JSON file. |
Beta Was this translation helpful? Give feedback.
-
Dear author, hello. As I did not receive your reply on GitHub, but I am very eager to know the answer, I have to take the liberty of disturbing you via email.
I am currently using pro_image_editor version 7.3.0, and when exporting State History to export JSON, I selected serializeStick: false。 Now I want to open the editor and load everything, including stickers, when importing State History. Unfortunately, due to export settings, stickers cannot be displayed like in the attachment. Is there any way to load stickers when importing history. Or in other words, when I export history, stickers can choose to store image links, and when importing, images can be loaded based on the links. Alternatively, I can edit the JSON file before importing, insert the images required by stickers into the JSON, and then import the history to display all information including images.
Pro_image_editor is the best plugin I have found after comprehensive comparison, and I really want to continue using it.
I really hope to receive your reply. Thank you again.
…------------------ 原始邮件 ------------------
发件人: "hm21/pro_image_editor" ***@***.***>;
发送时间: 2025年1月2日(星期四) 下午5:42
***@***.***>;
***@***.******@***.***>;
主题: Re: [hm21/pro_image_editor] When exporting JSON using exportStateHistory, there is an issue with images included (Discussion #308)
I have released version 7.2.0, which introduces a new feature included in Pull Request #306 created from @saif-ellafi. This update allows you to set the serializeSticker parameter within the ExportEditorConfigs to false. When this parameter is set to false, stickers will no longer be converted to Uint8List.
Please note that when you import the history, you will need to manually re-add the stickers. However, you can retrieve the sticker state, including their positions, from the history JSON file.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much, your changes have made everything very convenient and smooth.
…------------------ 原始邮件 ------------------
发件人: "Alex ***@***.***>;
发送时间: 2025年1月9日(星期四) 晚上8:31
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [hm21/pro_image_editor] When exporting JSON using exportStateHistory, there is an issue with images included (Discussion #308)
@zgdaaa I’ve just released version 7.5.0, which allows you to set up a import widget loader directly. For more details, please refer to pull request #315.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
At the moment, I think, this loading process has to be done manually (me for example, I store layer indices and then restore the image based on its index in the history). Eventually, I suppose we will be able to store other content instead of the stickers themselves (i.e. unique id, path, URL, etc.) and on top be able to set a loader function that loads these stickers back, or something similar. This way we could decide whether to serialize stickers (default), or store some StickerData and a function to restore them later through API.
my two cents