TODO: this is being loaded into memory.  We could make this a stream.
 @return [String] all the image data
167269
def execute(command)
      out = nil
      benchmark("Riiif executed #{command}") do
        stdin, stdout, stderr, wait_thr = popen3(command)
        stdin.close
        stdout.binmode
        out = stdout.read
        stdout.close
        err = stderr.read
        stderr.close
        raise ConversionError, "Unable to execute command \"#{command}\"\n#{err}" unless wait_thr.value.success?
      end
      out
    end
12238
function() {
            var data = {
                src: this._image.src,
                width: this._image.w,
                height: this._image.h,
                crops: []
            };

            for(var n = 0; n < this._image.crops.length; n++) {
                data.crops.push({
                    id: this._image.crops[n].id,
                    x: Math.round(this._image.crops[n].x),
                    y: Math.round(this._image.crops[n].y),
                    width: Math.round(this._image.crops[n].w),
                    height: Math.round(this._image.crops[n].h),
                    usable: this._image.crops[n].usable
                });
            }

            return data;
        }
1191172
def store_images   #:nodoc:
    # Skip this if there aren't any images.
    return if @images.array.empty?

    spid = @object_ids.spid

    @images.array.each_index do |i|
      @images.array[i].store_image_record(i, @images.array.size, charts_size, @filter_area.count, comments_size, spid)
      store_obj_image(i + 1)
    end

    @object_ids.spid = spid
  end
799343
def alternative_sizes image, sizes
      data_sizes = {}
      sizes[:sizes].each do |size, value|
        if value.present?
          data_sizes["data-#{size}-src"] = (value == :default ? image.url : image.send(value))
        else
          false
        end
      end
      data_sizes
    end
776175
def images
      @images = doc.css('img').map { |img| img['src'].to_s }.uniq.delete_if { |src| src.empty? }.map { |url| absolutify(url.strip) }
    end
944705
def stream
      if top_parent.is_a?(DObject)
        return top_parent.stream
      else
        return Stream.new(nil, file_endian=false)
      end
    end
363478
function() {
		this.width = 256;
		this.height = 224;
		this.data = new Uint8Array( this.width * this.height * 4 );

		for ( var i = 0; i < this.data.length; i++  ) {
			this.data[ i ] = 0xff;
		}

		this.context = getContext( this.el );
		this.image = this.context.getImageData( 0, 0, this.width, this.height );

		this.index = 0;
	}
1281578
def inspect
      img = []
      @images.each { |image| img << image.inspect }
      img = '[' + img.join(",\n") + "]\nscene=#{@scene}"
    end
93806
def flush
      return @transport.flush unless @write

      out = [@wbuf.length].pack('N')
      # Array#pack should return a BINARY encoded String, so it shouldn't be necessary to force encoding
      out << @wbuf
      @transport.write(out)
      @transport.flush
      @wbuf = Bytes.empty_byte_buffer
    end
728782
def create
      ImageScratch.where(ownable: current_user).destroy_all

      # The persistence code that follows is suboptimal.  I'm a bit tired
      # right now.  Don't see it. Needs to be fixed.  Issue should be raised.
      # TODO Raise issue here.
      ActiveRecord::Base.transaction do
        @scratch = ImageScratch.new(ownable: current_user);
        authorize! :create, @scratch
        @scratch.save!
        @scratch.image_version = ImageVersion.new(image: image_scratch_params[:image], ownable: @scratch);
        @scratch.save!
      end

    end
1368409
def images(self):
        
        uri = "/%s/images" % self.uri_base
        resp, resp_body = self.api.method_get(uri)
        return resp_body
1230518
def read_all
      content = String.new
      while bytes = read and !bytes.empty?
        content << bytes
      end
      content
    end
984453
private int imageDataSize()
    {
		int size = 0;
    	for(int k = 0; k < imageData.length; k++) {
    		size += imageData[k].length;
    	}   
    	return size;
    }
721425
def data
      @data ||= begin
        list = @xml.find('/e:epp/e:response/e:resData/node()').reject { |n| n.empty? }
        list.size > 1 ? list : list[0]
      end
    end
564074
def process_image(image_path, options = {})
      RestClient.post("#{url}/processImage", options.merge(:upload => { :file => File.new(image_path, 'r') }))
    end
48430
def to_png
      return @png_data if !@png_data.nil?
      image = minimagick_image
      image.resize '16x16!'
      image.format 'png'
      image.strip
      @png_data = image.to_blob
      raise FaviconParty::InvalidData.new("Empty png") if @png_data.empty?
      @png_data
    end
1366325
def stream(key)
        blob = blob_for(key)

        chunk_size = 5.megabytes
        offset = 0

        raise ActiveStorage::FileNotFoundError unless blob.present?

        while offset < blob.properties[:content_length]
          _, chunk = blobs.get_blob(container, key, start_range: offset, end_range: offset + chunk_size - 1)
          yield chunk.force_encoding(Encoding::BINARY)
          offset += chunk_size
        end
      end