Fixed dispose weirdness with caption and spin

This commit is contained in:
TheEssem 2021-03-06 11:39:54 -06:00
parent 4a4822851f
commit 165fff0cf2
2 changed files with 4 additions and 0 deletions

View file

@ -41,6 +41,7 @@ class CaptionWorker : public Napi::AsyncWorker {
appended.repage();
appended.magick(type);
appended.animationDelay(delay == 0 ? image.animationDelay() : delay);
appended.gifDisposeMethod(Magick::BackgroundDispose);
captioned.push_back(appended);
}

View file

@ -27,6 +27,7 @@ class SpinWorker : public Napi::AsyncWorker {
int i = 0;
for (Image &image : coalesced) {
image.virtualPixelMethod(Magick::TransparentVirtualPixelMethod);
image.scale(Geometry("256x256"));
image.alphaChannel(Magick::SetAlphaChannel);
double rotation[1] = {360 * i / coalesced.size()};
@ -36,6 +37,8 @@ class SpinWorker : public Napi::AsyncWorker {
i++;
}
for_each(mid.begin(), mid.end(), gifDisposeMethodImage(Magick::BackgroundDispose));
optimizeTransparency(mid.begin(), mid.end());
if (delay != 0) {
for_each(mid.begin(), mid.end(), animationDelayImage(delay));