Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7572151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:51:11+00:00 2026-05-30T15:51:11+00:00

I’m creating a collage of thumbnails using Ruby 1.9.3. The thumbnails are being loaded

  • 0

I’m creating a collage of thumbnails using Ruby 1.9.3. The thumbnails are being loaded as follows:

image1 = MiniMagick::Image.open("1.jpg")

image2 = MiniMagick::Image.open("2.jpg")
image2.rotate "-45>"

image3 = MiniMagick::Image.open("3.jpg")
image3.rotate "45>"

I’ve never used ImageMagick or MiniMagick before and I’ve got the code for compositing images from the minimagick GitHub page.

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")

The problem is coming up on the Image.create command. When I run the file using

$ ruby prog.rb

I get the following error

/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 <main>'
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 `<main>'

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:51:13+00:00Added an answer on May 30, 2026 at 3:51 pm

    The error message is a bit strange, but according to the documentation at http://www.imagemagick.org/script/command-line-options.php?#composite composite only takes 3 arguments – the two images you want to combine (the image you create in line 1 and the one called image 1), plus a gray scale ‘mask’ (image2 in this case).

    In other words, it seems like you’ll have to save after every single one of the three compositions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.