Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Magick::Draw stroke_width ignored with ImageMagick 6.8.7-0 #56

Open
bf4 opened this Issue · 2 comments

1 participant

@bf4
Owner

Issue by jcrate
Friday Oct 04, 2013 at 16:11 GMT
Originally opened as #91


Mac OS X 10.8.5
ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin12.4.0]
RMagick 2.13.2

From the documentation, the sample stroke width script draws the lines correctly with ImageMagick 6.8.6, but not with 6.8.7. Using the ImageMagick command line utility convert to generate an image with a line works the same with both versions.

convert -size 100x60 xc:skyblue -stroke black -strokewidth 5 -draw "line 5,30 85,30"  lines_rect.gif
require 'RMagick'

imgl = Magick::ImageList.new
imgl.new_image(500,80, Magick::HatchFill.new('white','lightcyan2'))

gc = Magick::Draw.new

# Draw 5-pixel wide line
gc.stroke('LightPink')
gc.stroke_width(5)
gc.line(10,30, 130,30)

# Draw 10-pixel wide line
gc.stroke('LightSkyBlue2')
gc.stroke_width(10)
gc.line(130,30, 230,30)

# Draw 20-pixel wide line
gc.stroke('GreenYellow')
gc.stroke_width(20)
gc.line(230,30,370,30)

# Draw 40-pixel wide line
gc.stroke('MediumOrchid2')
gc.stroke_width(40)
gc.line(370,30,490,30)

# Draw 1-pixel wide line through the center
gc.stroke('black')
gc.stroke_width(1)
gc.line(10,30,490,30)

# Annotate
gc.font_weight(Magick::NormalWeight)
gc.font_style(Magick::NormalStyle)
gc.fill('black')
gc.stroke('transparent')
gc.text(60,70,"'5'")
gc.text(180,70,"'10'")
gc.text(300,70,"'20'")
gc.text(420,70,"'40'")

gc.draw(imgl)
imgl.border!(1,1,"lightcyan2")

imgl.write('lines_stroke_width.gif')

`open lines_stroke_width.gif`
@bf4
Owner

Comment by bijalbhavsar
Thursday May 01, 2014 at 09:36 GMT


Have you found any alternative solution for stroke?

I have also issue with stroke, it is not working.
Thanks

@bf4
Owner

Comment by jcrate
Thursday May 01, 2014 at 18:15 GMT


When I tried again with ImageMagick 6.8.7-7, it worked correctly. So the solution is just to use a version of ImageMagick that works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.