#!/usr/local/bin/ruby # # ./image_size.rb > /dev/null require "GD" # create a new image im = GD::Image.new(200, 300) # allocate some colors white = im.colorAllocate(255,255,255) black = im.colorAllocate(0,0,0) red = im.colorAllocate(255,0,0) green = im.colorAllocate(0,255,0) blue = im.colorAllocate(0,0,255) yellow = im.colorAllocate(255,250,205) w, h = im.bounds STDERR.print "width: ", w, " height: ", im.height, "\n" STDERR.print "width: ", im.width, "\n" STDERR.print "height: ", im.height, "\n" im.gif STDOUT