Bug in frame_edges example while using multithreaded?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Bug in frame_edges example while using multithreaded?

Post 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??
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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?
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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?
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by magick »

Set the MAGICK_THREAD_LIMIT environment variable to 1 and see if that fixes the problem.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by bram12 »

I will reply when I can test this. Tomorrow I away the whole day.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by magick »

You should be able to set the environment variable in your web script.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by bram12 »

magick wrote:You should be able to set the environment variable in your web script.
how??
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

if calling from php, to run imagemagick from a bash shell use...

Code: Select all

  system("MAGICK_THREAD_LIMIT=1 convert .....");
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post 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)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post 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?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply