Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

RMagick

Name: Anonymous 2010-05-14 2:46

I have stumbled upon an odd bug, and it is confirmed on both my local [Windows] dev box and my remote shared host.

I have a tileset, for all intents and purposes it contains:
upper left, upper * n, upper right
west, middle * n, east
lower left, lower * n, lower right

This allows me to create grid (n+2)*(n+2)

I append them together as row1, row2, and row3
Then I make an ImageList of row1, 20 row2's, and row3
I go to do a vertical append (append(true) in Ruby) - and my CPU jumps to full load.

I let the task run for about 45 minutes before I decided that shit wasn't finishing.

If I put row1, 2, and 3 to disk, and append those vertically - it works just fine.

If I do this with far smaller numbers (row1 being 3 units wide, instead of 23) - it seems to work OK.

I'm stumped, /prog/ - does anyone have experience with ImageMagick that could explain this shit?

Name: Anonymous 2010-05-14 4:49

[Windows] dev box
near complete lack of context
description of what you think it should do rather than actual code
These are but three of your problems.

Name: Anonymous 2010-05-14 9:12

Next time use documented software

Name: Anonymous 2010-05-14 11:48

>>3
http://www.imagemagick.org/RMagick/doc/

>>2
>combining a tileset
How is that a lack of context?


require 'rubygems'
require 'RMagick'
include Magick

row1 = ImageList.new("200nw.png")
row2 = ImageList.new("200w.png")
row3 = ImageList.new("200sw.png")

24.times do
  row1 << Image.read("200n.png")[0]
  row2 << Image.read("200a.png")[0]
  row3 << Image.read("200s.png")[0]
end

row1 << Image.read("200ne.png")[0]
row2 << Image.read("200e.png")[0]
row3 << Image.read("200se.png")[0]

row1 = row1.append(false)
row2 = row2.append(false)
row3 = row3.append(false)

row1.write("row1_test.png")
row2.write("row2_test.png")
row3.write("row3_test.png")

final = ImageList.new
final << row1
24.times do
  final << row2
end
final << row3

final = final.append(true)
final.write("superfinal.png")

Name: Anonymous 2010-05-14 13:04

Too bad Ruby is slow as fuck.

Name: ​​​​​​​​​​ 2010-10-26 7:44

Name: Anonymous 2010-12-08 22:19

Name: Anonymous 2010-12-23 2:28

Don't change these.
Name: Email:
Entire Thread Thread List