From: dooglus Date: Sun, 3 Feb 2008 10:08:37 +0000 (+0000) Subject: Don't number image files if we're creating a single image. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cea04b40799da317f672e7c9c54710b2efdb3515;p=synfig.git 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 --- 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