From 3f528060e3385558dd16470157784d6cfca91d6d Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 28 Oct 2007 02:56:03 +0000 Subject: [PATCH] Show what's going on with messages to stdout. Fix another problem with transparent frames. git-svn-id: http://svn.voria.com/code@992 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/modules/mod_magickpp/trgt_magickpp.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp b/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp index aca367a..a8b1bc0 100644 --- a/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp +++ b/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp @@ -102,14 +102,21 @@ magickpp_trgt::~magickpp_trgt() // RemoveDuplicateLayers wants a linked list of images, and removes some of them // when it removes an image, it invalidates it using DeleteImageFromList, but we still have it in our container // when we destroy our container, the image is re-freed, failing an assertion + + synfig::info("copying image list"); MagickLib::Image *image_list = copy_image_list(images); + + synfig::info("clearing old image list"); images.clear(); + + synfig::info("removing duplicate frames"); RemoveDuplicateLayers(&image_list, &exceptionInfo); - insertImages(&images, image_list); - linkImages(images.begin(), images.end()); - OptimizeImageTransparency(images.begin()->image(),&exceptionInfo); - unlinkImages(images.begin(), images.end()); + synfig::info("optimizing frames"); + OptimizeImageTransparency(image_list,&exceptionInfo); + + synfig::info("recreating image list"); + insertImages(&images, image_list); #else synfig::info("not optimizing images"); // DeconstructImages is available in ImageMagic 6.2.* but it doesn't take @@ -170,7 +177,8 @@ void magickpp_trgt::end_frame() { Magick::Image image(width, height, "RGBA", Magick::CharPixel, buffer); - if (transparent) image.gifDisposeMethod(Magick::PreviousDispose); + if (transparent && images.begin() != images.end()) + (images.end()-1)->gifDisposeMethod(Magick::BackgroundDispose); images.push_back(image); } -- 2.7.4