# File lib/rabbit/image-data-loader.rb, line 22 def initialize(data) @width = 0 @height = 0 @pixbuf = nil @data = data end
# File lib/rabbit/image-data-loader.rb, line 29 def load loader = Gdk::PixbufLoader.new id = loader.signal_connect("size_prepared") do |l, width, height| @width = width @height = height end begin loader.last_write(@data) rescue Gdk::PixbufError => error loader.close rescue Gdk::PixbufError raise ImageLoadError.new(error.message) end loader.signal_handler_disconnect(id) @pixbuf = loader.pixbuf @pixbuf end