#38 Reading images with ImageMagick needs initialization

closed-fixed
nobody
None
5
2011-08-09
2011-07-24
clem
No

Hello,
with gdl 0.9.1 on Ubuntu 11.04 I got following error whenever trying to read an image (e.g. with read_png.pro):

GDL> data=read_png('test.png')
magick/semaphore.c:525: LockSemaphoreInfo: Assertion `semaphore_info != (SemaphoreInfo *) ((void *)0)' failed.

I think this is due to the fact that we're not calling InitializeMagick function (see also http://www.graphicsmagick.org/Magick++/\). By adding the following line:

InitializeMagick(NULL);

as the first line of magick_open (magick_cl.cpp) and rebuilding gdl, I was able to read the png.
Attached the "patched" magick_cl.cpp file (see line 124).

Cheers,
Lorenzo

Discussion

  • clem

    clem - 2011-07-24
     
  • Sylwester Arabas

    It's in the CVS. Thanks!

     
  • Sylwester Arabas

    • status: open --> closed-fixed
     
  • Sylwester Arabas

    I've just updated the fix so it does the initialisation only once, and not on every call to magick_open. Could you please test it on your installation (I was not able to reproduce this problem on any machines that I have quick access to).

    Best,
    Sylwester

     
  • clem

    clem - 2011-08-10

    Hi Sylwester,
    I'll test it as soon as possible and let you know.
    Anyway, the problem arose only after I upgraded to Ubuntu 11.04, so I guess this is related to some changes to the imagemagick library (I did not have this problem with previous installations).

    Cheers,
    Lorenzo

     
  • clem

    clem - 2011-10-06

    Hello,
    sorry for the delay in my answer.
    I can confirm that your change fixed the problem.
    Thanks!
    Lorenzo

     

Log in to post a comment.