summaryrefslogtreecommitdiff
path: root/src/cgg.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2015-08-29 18:32:11 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2015-08-29 18:32:11 +0200
commit415fa18ad93493b7073a69cda3af27863537185b (patch)
treee6b1d00bc42efc0f2268bdbe13e4bd9b566c6e57 /src/cgg.c
parentb57363dbf58c275a7684281022db376ed412601b (diff)
downloadcataract-415fa18ad93493b7073a69cda3af27863537185b.tar.xz
jpeg-utils: Unify media libraries initialization
Both MagickWand and exiv2 needs some initialization and cleanup, move it to jpeg-utils for clean includes in cgg.c. Also add explicit exiv2 XMP initialization as stated on http://dev.exiv2.org/projects/exiv2/wiki/Thread_safety: "The XMP SDK initialization function is not mutex protected, thus Exiv2::XmpParser::initialize is not thread-safe. Therefore, multi-threaded applications need to ensure that this XMP function is serialized, e.g., by calling them from an initialization section which is run before any threads are started." See also https://bugs.kde.org/show_bug.cgi?id=166424
Diffstat (limited to 'src/cgg.c')
-rw-r--r--src/cgg.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cgg.c b/src/cgg.c
index be882b1..e13ffbb 100644
--- a/src/cgg.c
+++ b/src/cgg.c
@@ -26,8 +26,6 @@
#include <libxml/xmlmemory.h>
-#include <wand/magick-wand.h>
-
#include <config.h>
#include "setup.h"
@@ -35,6 +33,7 @@
#include "stats.h"
#include "atom-writer.h"
#include "gallery-utils.h"
+#include "jpeg-utils.h"
@@ -129,8 +128,8 @@ main (int argc, char* argv[])
g_thread_init (NULL);
#endif
- /* Initialize ImageMagick at this point, for multithreading safety */
- MagickWandGenesis();
+ /* Initialize imaging libraries */
+ init_jpeg_utils ();
/* Parse commandline */
if (! parse_cmd (argc, argv))
@@ -261,8 +260,7 @@ main (int argc, char* argv[])
printf ("%d errors occured.\n", stats_errors);
}
-
- MagickWandTerminus();
+ destroy_jpeg_utils ();
/* Cleanup function for the XML library. */
xmlCleanupParser();