Note that there are some explanatory texts on larger screens.

plurals
  1. POMiniMagick Image.create method giving an ArgumentError
    primarykey
    data
    text
    <p>I'm creating a collage of thumbnails using Ruby 1.9.3. The thumbnails are being loaded as follows:</p> <pre><code>image1 = MiniMagick::Image.open("1.jpg") image2 = MiniMagick::Image.open("2.jpg") image2.rotate "-45&gt;" image3 = MiniMagick::Image.open("3.jpg") image3.rotate "45&gt;" </code></pre> <p>I've never used ImageMagick or MiniMagick before and I've got the code for compositing images from the minimagick GitHub page.</p> <pre><code>collage = MiniMagick::Image.create "jpg", false do |c| c.size "1024x768" c.canvas "white" end collage = collage.composite image1 do |c| c.gravity "center" end collage = collage.composite image2 do |c| c.gravity "east" end collage = collage.composite image3 do |c| c.gravity "west" end collage.write("output.jpg") </code></pre> <p>The problem is coming up on the Image.create command. When I run the file using</p> <pre><code>$ ruby prog.rb </code></pre> <p>I get the following error</p> <pre><code>/Users/vinayshenoy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/tempfile.rb:250:in `size': wrong number of arguments (1 for 0) (ArgumentError) from prog.rb:14:in `block in &lt;main&gt;' from /Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/mini_magick-3.4/lib/mini_magick.rb:158:in `call' from /Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/mini_magick-3.4/lib/mini_magick.rb:158:in `create' from prog.rb:13:in `&lt;main&gt;' </code></pre> <p>The script file is the same directory as the images. I tested by writing image1, image2 and image3 to separate files and they all work. Please help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload