Closed tinyjin closed 8 months ago
@hermet I found a bug, that after exporting gif, gif exported well but the lottie-player isn't working. Seems not related to viewer, need to fix and update on thorvg/web side.
Since viewer heads latest version of @thorvg/lottie-player
, we can ignore it for this step. Once I fix it from core, it will then work well.
Except the bug, think everything's good.
@tinyjin Hmm... There is no point to update the software if it hurts the functionality. It's not professional.
Yup, actually working on fixing last bug, I meant you can review the code while im doing on it, sorry for confusing, yes it will be definately updated together
Probably, this is a considerable solution
#include "tvgPicture.h"
bool save2Gif() {
//acquire the picture data(lottie) from the current animation
uint32_t size = 0;
//LoadModule/Picture::Impl additionally needs the interface for this.
//uint32_t* data(uint32_t& size);
auto data = P(this->animation->picture())->data(size);
//Copy a new animation to save
auto animation = Animation::gen();
auto picture = animation->picture();
//Use the retained the above lottie data
picture->load(data, size, "lottie");
//Save it as it normal.
auto saver = Saver::gen();
if (!saver) {
errorMsg = "Invalid saver";
return false;
}
//set a white opaque background
auto bg = tvg::Shape::gen();
bg->fill(255, 255, 255, 255);
bg->appendRect(0, 0, width, height);
saver->background(std::move(bg));
if (saver->save(std::move(animation), "output.gif", 100, 30) != tvg::Result::Success) {
errorMsg = "save(), fail";
return false;
}
saver->sync();
}
@hermet fyi.
This patch will use thorvg v0.11.6
again.
This patch will close #21 as initialization logic changed.
@hermet fyi. This patch will use thorvg
v0.11.6
again.
any reason?
@hermet fyi. This patch will use thorvg
v0.11.6
again.any reason?
Sorry for the confusion! I was trying to say it will temporaily head main
branch.
it's not reverting.