我在Ruby上使用FastImage来调整一些图像的大小: https://github.com/sdsykes/fastimage_resize/blob/master/test/test.rb
这是我的代码,所以我从昨天开始就遇到了这个错误:
class IconExport
def initialize(img_url,target_directory,tab)
@img_url=img_url
@target = target_directory
@tab = tab
end
def export
@tab.each do |fn, info|
puts"#{fn} ,#{info}"
outfile = File.join(@target, "fixtures", "resized_" + fn)
puts "#{outfile}"
puts "#{info[1][0] / 3}"
FastImage.resize(@img_url + fn, info[1][0] / 3, info[1][1] / 2, :outfile=>outfile)
assert_equal [info[1][0] / 3, info[1][1] / 2], FastImage.size(outfile)
File.unlink outfile
end
end
end
错误:
icon2.rb:59:in `block in export': uninitialized constant IconExport::FastImage (NameError)
from icon2.rb:54:in `each'
from icon2.rb:54:in `export'
from icon2.rb:82:in `<main>'
请帮帮我!