def set_data(format, data, width=nil, height=nil)
      ZBar.zbar_image_set_format(@img, format)
      
      # Note the @buffer jog: it's to keep Ruby GC from losing the last
      # reference to the old @buffer before calling image_set_data.
      new_buffer = FFI::MemoryPointer.from_string(data)
      ZBar.zbar_image_set_data(@img, new_buffer, data.size, nil)
      @buffer = new_buffer
      
      if width && height
        ZBar.zbar_image_set_size(@img, width.to_i, height.to_i)
      end
    end
def set_data(format, data, width=nil, height=nil)
      ZBar.zbar_image_set_format(@img, format)
      
      # Note the @buffer jog: it's to keep Ruby GC from losing the last
      # reference to the old @buffer before calling image_set_data.
      new_buffer = FFI::MemoryPointer.from_string(data)
      ZBar.zbar_image_set_data(@img, new_buffer, data.size, nil)
      @buffer = new_buffer
      
      if width && height
        ZBar.zbar_image_set_size(@img, width.to_i, height.to_i)
      end
    end
Load arbitrary data from a string into the Image object.

 Format must be a ZBar::Format constant. See the ZBar documentation
 for what formats are supported, and how the data should be formatted.

 Most everyone should use one of the <tt>Image.from_*</tt> methods instead.