Page 1 of 2

Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T06:42:56-07:00
by bram12
hi,

I was using the frame edges examples found on: http://www.imagemagick.org/Usage/thumbnails/#frame_edge and downloaded the script http://www.imagemagick.org/Usage/script ... ges.tar.gz

That was working fine until I switched to a multithreaded environment for image magick. Now some images/borders are distorted.

Try:
- Go to http://www.freeonlinephotoeditor.com
- click on effects
- click on golden frame
- now the left and top border have some distortions.

Any ideas how to solve/fix that? Strange thing is... try adding a second border (same golden one) and then it is ok??

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T07:37:34-07:00
by magick
We need to reproduce the problem in our local environment. What is the command sequence you are using to create the framed effect? Also, which version of ImageMagick are you using?

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T07:49:30-07:00
by bram12
version 6.4.8-9

in php I am using:
exec('/www/www.freeonlinephotoeditor.com/htdocs/sc ... rame_edges gold '.extractname($_REQUEST["imageFileName"]).' > '.$imagesurse.'');

frame edges script and images can be found here: http://www.imagemagick.org/Usage/script ... ges.tar.gz

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T08:43:20-07:00
by magick
We tried the command with ImageMagick 6.4.9-6, the current release, and it works fine. Type
  • identify -version
Does it include OpenMP in the output? We're wondering if its a transient bug in the OpenMP implementation of ImageMagick. Any chance you can download / install ImageMagick 6.4.9-6?

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T09:24:17-07:00
by bram12
Version: ImageMagick 6.4.8-9 2009-01-29 Q16 OpenMP http://www.imagemagick.org

I probably can not get a new version installed.

The environment is exactly the same only now multithreaded enabled and that produces this bug. Everything else seems to work ok.

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T09:32:04-07:00
by magick
Set the MAGICK_THREAD_LIMIT environment variable to 1 and see if that fixes the problem.

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T09:34:14-07:00
by bram12
magick wrote:Set the MAGICK_THREAD_LIMIT environment variable to 1 and see if that fixes the problem.
Can I just edit the XML or do I need to restart something??

It seems I have no rights to change the configure.xml, so I will ask my hoster.

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T09:42:07-07:00
by bram12
I will reply when I can test this. Tomorrow I away the whole day.

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T10:46:22-07:00
by magick
You should be able to set the environment variable in your web script.

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T12:25:27-07:00
by bram12
magick wrote:You should be able to set the environment variable in your web script.
how??

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-23T20:54:03-07:00
by anthony
if calling from php, to run imagemagick from a bash shell use...

Code: Select all

  system("MAGICK_THREAD_LIMIT=1 convert .....");

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-26T04:32:42-07:00
by bram12
I did the test by setting the thread limit to 1 in the configure.xml.

And then I still had some strange artifacts, but a lot less.

I will ask my hoster to upgrade ImageMagick, but they are only able to do that next week.

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-26T04:42:37-07:00
by bram12
anthony wrote:if calling from php, to run imagemagick from a bash shell use...

Code: Select all

  system("MAGICK_THREAD_LIMIT=1 convert .....");
Anthony,

is it also possible to add it in your frame_edge script??

I tried adding: MAGICK_THREAD_LIMIT=1 to the script, but that does not seem to work?

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-26T19:16:15-07:00
by anthony
It only happens on specific versions of IM where threaded use was still getting fixed properly.
You can use it on my script the same way
system("MAGICK_THREAD_LIMIT=1 frame_script ....");

The syntax is BASH shell syntax. for other shells you may need to use

system("env MAGICK_THREAD_LIMIT=1 frame_script ....");

'env' is a command that also modifies the environemnt before running the command given (first item without an '=' in it) the BASH form is just a short cut (and slightly faster)

Re: Bug in frame_edges example while using multithreaded?

Posted: 2009-02-28T02:06:37-07:00
by anthony
Can you post a small example of the noise?

Have you tried modifying the script to output intermediate images so as to track where the noise is being added?