Page 1 of 1

rectangles are rendering as trapezoids

Posted: 2016-04-25T12:52:55-07:00
by cmeworld
I have upgraded our server to PHP 5.3.29 and ImageMagick to 6.7.7.10 on Ubuntu server 14.04. the following command did work on 6.6.9-7 with php version 5.2.17 on ubuntu 12.02.

"convert -size $size xc:'#000' -stroke 'rgba(162,240,238,0.75)' -strokewidth $borderStrokeWidth -draw 'rectangle $x1,$x1 $x2,$y2' {$this->source} -geometry $borderPosition -composite -stroke none $titleCmd $subCmd {$this->target}"

now this draws a trapezoid. The top left and bottom right corners draw with the correct position. the top right and bottom left way out of a alignment.
I have tried to move a version down on the imagemagick however it will not run with the PHP I am running. I have tried to upgrade the PHP to 5.5.9 and ImageMagick 6.7.7.10 with the same issue of rendering a trapezoid.

Re: rectangles are rendering as trapezoids

Posted: 2016-04-25T13:00:22-07:00
by fmw42
IM 6.7.7.10 is ancient (over 150 versions old). It is conceivable that there was a bug. Perhaps you should provide and example with actual numbers and not variables in it and post your results so others might be able to test. We have no idea what you have in your subcommands. So you need to be more specific with a complete test case that others can repeat.

Also can you test this in a terminal window without PHP to see if it is your PHP or Imagemagick at issue.

Also replace your single quotes about the -draw arguments with double quotes. I believe unix needs double quotes to resolve variables.

Re: rectangles are rendering as trapezoids

Posted: 2016-04-26T12:30:01-07:00
by cmeworld
Manual install of ImageMagic 6.9.3-8 fixed the problem. apt-get update would not update over 6.7.7.10.

Re: rectangles are rendering as trapezoids

Posted: 2017-07-19T02:45:11-07:00
by aberkl
Hi,

looks to me like this issue came up again, I am using ImageMagick on Linux Mint 17.2:

Code: Select all

Version: ImageMagick 6.7.7-10 2017-05-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
strokewidth = 2 works fine and produces a proper rectangle

Code: Select all

convert -size 300x200 xc:gray -fill none -stroke blue -strokewidth 2 -draw "rectangle 50,50 250,150" rectStrokeWidth2.png
wheras a strokewidth = 3 results in a "trapezoid"

Code: Select all

convert -size 300x200 xc:gray -fill none -stroke blue -strokewidth 3 -draw "rectangle 50,50 250,150" rectStrokeWidth3.png
Best, Andreas

Re: rectangles are rendering as trapezoids

Posted: 2017-07-19T04:40:04-07:00
by Bonzo
looks to me like this issue came up again
It has not come up again you are using the same version as the OP and it obviously has a bug. You need to use a later version.

Re: rectangles are rendering as trapezoids

Posted: 2017-07-19T06:39:44-07:00
by aberkl
Hi Bonzo,

looking at the version string you are absolutely right. I should have noticed that. Just wondering where the (nearly) up-to-date timestamp comes from. Obviously it fooled me...
  • Version: ImageMagick 6.7.7-10 2017-05-26
Is the timestamp related to the distros build date and not the ImageMagick release date?

Andreas, still learning a lot...

Re: rectangles are rendering as trapezoids

Posted: 2017-07-19T06:59:32-07:00
by Bonzo
I found out this information earlier this year when I had a problem:

Linux distros start with a base Imagemaagick version and from memory one was 6.5 and then the next one was the 6.7.7 version.

Instead of updating the versions in the distro they "patch" it. BUT they often miss out bug fixes etc. This is why you have an old version with a new date - in this case the last patch was added on 2017-05-26.

All you can guarantee is that you have a valid 6.7.7 version but after that it all goes awry.

The best thing you can do is try and update it to a later version - your hosts should do it if you ask them nicely :)

Re: rectangles are rendering as trapezoids

Posted: 2017-07-20T06:46:12-07:00
by glennrp
aberkl wrote: 2017-07-19T06:39:44-07:00 looking at the version string you are absolutely right. I should have noticed that. Just wondering where the (nearly) up-to-date timestamp comes from. Obviously it fooled me...
It fools everyone.
Is the timestamp related to the distros build date and not the ImageMagick release date?
The timestamp is the time ImageMagick was compiled and built on your system.