Occational random line through images

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

Re: Occational random line through images

Post by magick »

If it fails, wouldn't it still report an exception? We pass the exception in the recursive call. We'll add a patch to return NULL if an exception is thrown.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Occational random line through images

Post by fmw42 »

magick wrote:If it fails, wouldn't it still report an exception? We pass the exception in the recursive call. We'll add a patch to return NULL if an exception is thrown.
Just curious if you have tried running his command in a loop over many iterations on his type platform to see if you get any lines to show up?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Occational random line through images

Post by magick »

Yes. Many times. No lines are showing up.
XDAMDaniel
Posts: 14
Joined: 2016-04-18T11:43:02-07:00
Authentication code: 1151

Re: Occational random line through images

Post by XDAMDaniel »

After looking through all the replies I noticed this little note.
magick wrote:Note, 512MB is very different from 512mb.
I also noticed that the sample script is using "MB" and we are using "mb" in our command. So I tried the following 1000 times:

Code: Select all

convert -limit map 512MB -limit memory 512MB -limit thread 1 1000.jpg \
    -scale '2000x2000' -flatten -quality 85 output/testImage1.jpg
No lines, ran it several more iterations of 1,000 times still no lines. It seems that the difference between "mb" and "MB" may be to blame for our problems. I looked through the docs and man page but don't see anything that mentions a difference. Our team was able to come up with some possible differences such as megabit vs megabyte and megabyte vs mebibyte. Could you help us understand the difference between "mb" and "MB".

Regarding duplicating the issue here is my sample script that can be used to replicate the problem:

Code: Select all

#!/bin/csh

convert -limit map 512mb -limit memory 512mb -limit thread 1 1000.jpg \
  -scale '2000x2000' -flatten -quality 85 output/reference.jpg
set i = 0
while ( $i < 1000 )
  echo -n "$i "
  convert -limit map 512mb -limit memory 512mb -limit thread 1 1000.jpg \
    -scale '2000x2000' -flatten -quality 85 output/testImage$i.jpg
  compare -metric rmse output/testImage$i.jpg output/reference.jpg null:
  echo ""
  @ i ++
end

And here is the sample image I used to replicate the problem: https://www.dropbox.com/s/rpg9uja8s56fi7i/1000.jpg?dl=0

If this does not work to replicate the line you can contact me directly. We may be able to get you connected into an environment we have specifically setup to trouble shoot this problem.

Also as a note we always disable OpenMP when we build ImageMagick. Here is our configure command:

Code: Select all

./configure --prefix=/usr --disable-openmp --with-gs-font-dir=/usr/share/fonts/default/Type1 --libdir=/usr/lib64
I did notice we are using a different switch to disable it from the one mentioned. I can try to rebuild it with the alternate switch if that seems like it would be worth trying.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Occational random line through images

Post by magick »

We added two patches to ImageMagick 7.0.1-2 and 6.9.4-0, available by sometime tomorrow, that may address this problem. Give it a try and let us know if you continue to get random lines.
XDAMDaniel
Posts: 14
Joined: 2016-04-18T11:43:02-07:00
Authentication code: 1151

Re: Occational random line through images

Post by XDAMDaniel »

I installed ImageMagick 7.0.1-2 on the server this morning and ran several tests of 1,000 images. I'm still seeing images that are produced with lines in them. I tried building it with our standard configure command:

Code: Select all

./configure --prefix=/usr --disable-openmp --with-gs-font-dir=/usr/share/fonts/default/Type1 --libdir=/usr/lib64
and with --disable-shared:

Code: Select all

./configure --prefix=/usr --disable-openmp --disable-shared --with-gs-font-dir=/usr/share/fonts/default/Type1 --libdir=/usr/lib64
I get the same results either way. Additionally, I continue to observe that the lower case "mb" in the memory limit seems to the cause of the line issue whereas the capital "MB" does not.

This command produces the lines:

Code: Select all

convert -limit map 512mb -limit memory 512mb -limit thread 1 1000.jpg -scale '2000x2000' -flatten -quality 85 output/testImage1.jpg
While this command does not produce any lines:

Code: Select all

convert -limit map 512MB -limit memory 512MB -limit thread 1 1000.jpg    -scale '2000x2000' -flatten -quality 85 output/testImage1.jpg

Here is my sample line producing script:

Code: Select all

#!/bin/csh

convert -limit map 512MB -limit memory 512MB -limit thread 1 1000.jpg \
  -scale '2000x2000' -flatten -quality 85 output/reference.jpg
set i = 0
while ( $i < 1000 )
  echo -n "$i "
  convert -limit map 512MB -limit memory 512MB -limit thread 1 1000.jpg \
    -scale '2000x2000' -flatten -quality 85 output/testImage$i.jpg
  compare -metric rmse output/testImage$i.jpg output/reference.jpg null:
  echo ""
  @ i ++
end
Here are a couple sample images with lines:
https://www.dropbox.com/s/mtrwu8573ikfp ... 0.jpg?dl=0
https://www.dropbox.com/s/4y9ug7df67mpn ... 1.jpg?dl=0

Here is the sample original image:
https://www.dropbox.com/s/rpg9uja8s56fi7i/1000.jpg?dl=0
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Occational random line through images

Post by fmw42 »

Your script has both commands using MB. Should not one of them be using mb?

I suspect that MB means mega Bytes and mb means mega bits. So the latter is using 8 time less resources.
XDAMDaniel
Posts: 14
Joined: 2016-04-18T11:43:02-07:00
Authentication code: 1151

Re: Occational random line through images

Post by XDAMDaniel »

Yes you are correct. I pasted the wrong script in. That was the script that works successfully without producing lines. The problem script should be:

Code: Select all

#!/bin/csh

convert -limit map 512MB -limit memory 512MB -limit thread 1 1000.jpg \
  -scale '2000x2000' -flatten -quality 85 output/reference.jpg
set i = 0
while ( $i < 1000 )
  echo -n "$i "
  convert -limit map 512mb -limit memory 512mb -limit thread 1 1000.jpg \
    -scale '2000x2000' -flatten -quality 85 output/testImage$i.jpg
  compare -metric rmse output/testImage$i.jpg output/reference.jpg null:
  echo ""
  @ i ++
end
Thanks for alerting me to that mistake.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Occational random line through images

Post by magick »

Ran your script. It completed without complaint with a metric of 0 as expected. Until we can reproduce this problem, we are unable to offer additional help.
Post Reply