InitializeMagick.diff 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. Description: Properly initialize GraphicsMagick
  2. Quoting from GraphicsMagick's NEWS file "
  3. 1.3.8 (January 21, 2010)
  4. ========================
  5. [...]
  6. Behavior Changes:
  7. InitializeMagick() MUST be invoked prior to using any Magick API function.
  8. Failure to do so will likely lead to an immediate application crash. This is
  9. due to initialization and runtime changes intended to improve thread safety
  10. and efficiency. Previously it was only strongly recommended to invoke
  11. InitializeMagick().
  12. "
  13. Author: Galland (https://launchpad.net/~victor-lopez)
  14. Bug-Ubuntu: https://bugs.launchpad.net/bugs/636021
  15. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599915
  16. Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=3136111&group_id=118983&atid=682742
  17. Forwarded: yes
  18. --- a/src/main.cc
  19. +++ b/src/main.cc
  20. @@ -97,6 +97,9 @@
  21. double scale = 1;
  22. int flags = 0;
  23. +#ifndef LITE
  24. + InitializeMagick(NULL);
  25. +#endif /* ! LITE */
  26. int k, c;
  27. while ((c = getopt_long (argc, argv, "ac:f:hl:o:p:vVw:x:", opts, &k)) != -1)
  28. switch (c) {