Show what's going on with messages to stdout. Fix another problem with transparent...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 28 Oct 2007 02:56:03 +0000 (02:56 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 28 Oct 2007 02:56:03 +0000 (02:56 +0000)
git-svn-id: http://svn.voria.com/code@992 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp

index aca367a..a8b1bc0 100644 (file)
@@ -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);
 }