summaryrefslogtreecommitdiff
path: root/academic/drawtiming/InitializeMagick.diff
blob: d610544a762b8c19085e27a0f0fd2da925d2133b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: Properly initialize GraphicsMagick
 Quoting from GraphicsMagick's NEWS file "
 1.3.8 (January 21, 2010)
 ========================
 [...]
 Behavior Changes:
 InitializeMagick() MUST be invoked prior to using any Magick API function.
  Failure to do so will likely lead to an immediate application crash. This is
  due to initialization and runtime changes intended to improve thread safety
  and efficiency. Previously it was only strongly recommended to invoke
  InitializeMagick().
 "
Author: Galland (https://launchpad.net/~victor-lopez)
Bug-Ubuntu: https://bugs.launchpad.net/bugs/636021
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599915
Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=3136111&group_id=118983&atid=682742
Forwarded: yes

--- a/src/main.cc
+++ b/src/main.cc
@@ -97,6 +97,9 @@
   double scale = 1;
   int flags = 0;
 
+#ifndef LITE
+  InitializeMagick(NULL);
+#endif /* ! LITE */
   int k, c;
   while ((c = getopt_long (argc, argv, "ac:f:hl:o:p:vVw:x:", opts, &k)) != -1)
     switch (c) {