From cea04b40799da317f672e7c9c54710b2efdb3515 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 3 Feb 2008 10:08:37 +0000 Subject: [PATCH] Don't number image files if we're creating a single image. git-svn-id: http://svn.voria.com/code@1559 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../src/modules/mod_magickpp/trgt_magickpp.cpp | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 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 0d8cc35..7532291 100644 --- a/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp +++ b/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp @@ -93,20 +93,27 @@ magickpp_trgt::~magickpp_trgt() try { - // check whether this file format supports multiple-image files - Magick::Image image(*(images.begin())); - image.fileName(filename); - try + bool multiple_images = images.size() != 1; + bool can_adjoin = false; + + if (multiple_images) { - SetImageInfo(image.imageInfo(),Magick::MagickTrue,&exceptionInfo); - } - catch(Magick::Warning warning) { - synfig::warning("exception '%s'", warning.what()); + // check whether this file format supports multiple-image files + Magick::Image image(*(images.begin())); + image.fileName(filename); + try + { + SetImageInfo(image.imageInfo(),Magick::MagickTrue,&exceptionInfo); + can_adjoin = image.adjoin(); + } + catch(Magick::Warning warning) { + synfig::warning("exception '%s'", warning.what()); + } } // the file type is now in image.imageInfo()->magick and // image.adjoin() tells us whether we can write to a single file - if (image.adjoin()) + if (can_adjoin) { synfig::info("joining images"); unsigned int delay = round_to_int(100.0 / desc.get_frame_rate()); @@ -177,7 +184,7 @@ magickpp_trgt::~magickpp_trgt() // insertImages(&images, new_images); #endif } - else + else if (multiple_images) { // if we can't write multiple images to a file of this type, // include '%04d' in the filename, so the files will be numbered -- 2.7.4