John Joyce wrote: > Cool, Dan, that looks pretty slick. I certainly couldn't have done > that so quickly, but I knew what basically was needed. That looks like > about what I was thinking of conceptually. Very nice and clean code! > Nice touch with downcasing file extensions too! I hate that cameras > all like to upcase filenames... (> <)! > That will probably run a lot lighter than RMagick methods, I'll try it > out later. I've been fiddling with the RMagick API all afternoon. > There's a lot of documentation but some of it is lacking in clear > examples. > At this point I know how to scale images and keep the aspect ratio > within a maximum new size, but I'd like to have the final output be > square with matting on the sides for portrait orientation, matting on > the top and bottom for landscape orientation, either one with the > scaled image centered. > Will this require subsequent compositing after scaling? Or did I miss > a method somewhere in the docs that does all of this at once? > > John Joyce > Yes, you'll need to composite the scaled image on top of the background of your desired size. See my article "Alpha Compositing - Part 1" [http://rmagick.rubyforge.org/src_over.html]. If you're making a lot of thumbnails you might also be interested in "Making Thumbnails with RMagick" [http://rmagick.rubyforge.org/resizing-methods.html], which compares the performance of all the RMagick resizing methods. Also if you'll tell me which parts of the documentation are lacking in clear examples I'll see what I can do to fix it. You can always open a documentation bug in the RMagick bug tracker on RubyForge. -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]