Creates a display image only where FileSet is an image.

 @return [IIIFManifest::DisplayImage] the display image required by the manifest builder.
170242
def display_image
      return nil unless ::FileSet.exists?(id) && solr_document.image? && current_ability.can?(:read, id)
      # @todo this is slow, find a better way (perhaps index iiif url):
      original_file = ::FileSet.find(id).original_file

      url = Hyrax.config.iiif_image_url_builder.call(
        original_file.id,
        request.base_url,
        Hyrax.config.iiif_image_size_default
      )
      # @see https://github.com/samvera-labs/iiif_manifest
      IIIFManifest::DisplayImage.new(url,
                                     width: 640,
                                     height: 480,
                                     iiif_endpoint: iiif_endpoint(original_file.id))
    end
17580
def make_image(opts={})
      opts = {:volume       => '/',
              :size         => 6000,
              :destination  => '/mnt/bundle',
              :exclude      => nil
              }.merge(opts)
      image_file = File.join(opts[:destination], opts[:prefix] )
      cmds = ["mkdir -p #{opts[:destination]}"]
      cmds << "dd if=/dev/zero of=#{image_file} bs=1M count=#{opts[:size]}"
      cmds << "mkfs.ext3 -F -j #{image_file}"
      cmds << "mkdir -p #{opts[:destination]}/loop"
      cmds << "mount -o loop #{image_file} #{opts[:destination]}/loop"
      cmds << "rsync -ax #{rsync_excludes(opts[:exclude])} #{opts[:volume]}/ #{opts[:destination]}/loop/"
      cmds << "if [[ -f /etc/init.d/ec2-ssh-host-key-gen ]]; then chmod u+x /etc/init.d/ec2-ssh-host-key-gen ;fi"
      cmds << "umount #{opts[:destination]}/loop"
      self.ssh cmds
      image_file
    end
934923
def create_image(cloud, **kwargs):
    
    if cloud == 'ec2':
        return create_ami(**kwargs)

    if cloud == 'rackspace':
        return create_rackspace_image(**kwargs)

    if cloud == 'gce':
        return create_gce_image(**kwargs)
531480
def show_image(kwargs, call=None):
    
    if call != 'function':
        raise SaltCloudSystemExit(
            'The show_image action must be called with -f or --function.'
        )

    name = kwargs['image']
    log.info("Showing image %s", name)
    machine = vb_get_machine(name)

    ret = {
        machine["name"]: treat_machine_dict(machine)
    }
    del machine["name"]
    return ret
666222
def _get_image(self):
        
        if self.image is None:
            image_path = '%s/%s' % (current_app.static_folder, os.path.normpath(self.image_path))
            try:
                self.image = Image.open(image_path)
                self._reduce_opacity()
            except Exception as err:
                raise ValueError('Unsupported watermark format: %s' % str(err))

        return self.image
957138
def image_display(element, max_frames, fmt):
    
    if fmt not in Store.display_formats:
        return None
    info = process_object(element)
    if info:
        display(HTML(info))
        return

    backend = Store.current_backend
    if type(element) not in Store.registry[backend]:
        return None
    renderer = Store.renderers[backend]
    plot = renderer.get_plot(element)

    # Current renderer does not support the image format
    if fmt not in renderer.params('fig').objects:
        return None

    data, info = renderer(plot, fmt=fmt)
    return {info['mime_type']: data}, {}
278330
def display(self, image):
        
        assert(image.mode == self.mode)
        assert(image.size == self.size)

        image = self.preprocess(image)

        self.command(
            # Column start/end address
            self._const.COLUMNADDR, self._colstart, self._colend - 1,
            # Page start/end address
            self._const.PAGEADDR, 0x00, self._pages - 1)

        buf = bytearray(self._w * self._pages)
        off = self._offsets
        mask = self._mask

        idx = 0
        for pix in image.getdata():
            if pix > 0:
                buf[off[idx]] |= mask[idx]
            idx += 1

        self.data(list(buf))
1273063
public function show($image, ?string $alt = null, array $extra = [], bool $default = false) : ?string
    {
        return $this->display($image, $alt, $extra, $default);
    }
833010
def display(self, image):
        
        assert(image.size == self.size)
        self._last_image = image

        self._count += 1
        filename = self._file_template.format(self._count)
        image = self.preprocess(image)
        surface = self.to_surface(image, alpha=self._contrast)
        logger.debug("Writing: {0}".format(filename))
        self._pygame.image.save(surface, filename)
1315583
def image(out = nil)
      splash_start
      splash_composite
      return img unless out
      FileUtils.mkdir_p File.dirname(out)
      img.write(out)
    rescue Errno::ENOENT
      YAMG.puts_and_exit("Path not found '#{out}'")
    end
606571
def images(args={})
      hashes = con.describe_images('Owner' => 'self').body['imagesSet'].collect do |hash|
        h = {}
        h[:image_id]  = hash['imageId']
        h[:name]  = hash['name']
        h[:rootDeviceType] = hash['rootDeviceType']
        h
      end 
      puts Formatador.display_table(hashes)
    end
737680
def show
      @image = Picturesque::Image.find(params)
      @file = @image.process(params.slice(:size, :quality, :format))

      setup_canonical_link

      expires_in 3.years, public: @file
      send_file @file.path, disposition: Picturesque::Image::DISPOSITION
    end
429634
function Image(src) {
  if (!(this instanceof Image)) {
    return new Image(src)
  }

  if (typeof src !== 'string') {
    throw new Error('param `src` must be a string')
  }

  var ret = reg.exec(src)

  if (!ret) {
    throw new Error('invalid param `src`')
  }

  this.src = src
  this.host = ret[1] || defaultHost
  this.version = ret[2] ? ret[2].slice(0, -1) : ''
  this.hash = ret[3]
  this.ext = ret[4]
}
919357
def image(self):
        
        if self._image is None:
            self._image = Image(self.fname)
        return self._image
1354764
private function createImage() {
		if ( $this->_image != NULL ) imagedestroy( $this->_image );
		$this->_image = imagecreatetruecolor($this->_config['w'], $this->_config['h']);
		switch ( mt_rand() % 4 ) {
		case 0: $_bg = imagecolorallocate($this->_image, 250, 250, 250); break;
		case 1: $_bg = imagecolorallocate($this->_image, 255, 252, 232); break;
		case 2: $_bg = imagecolorallocate($this->_image, 254, 245, 243); break;
		case 3: $_bg = imagecolorallocate($this->_image, 233, 255, 242); break;
		}
		imagefilledrectangle($this->_image, 0, 0, $this->_config['w'], $this->_config['h'], $_bg);
		//imagefilter($this->_image, IMG_FILTER_EMBOSS);
		
		switch ( mt_rand() % 5 ) {
            case 0:	$_color = imagecolorallocate($this->_image, 128, 128, 128);	break;	//gray
            case 1:	$_color = imagecolorallocate($this->_image, 16, 9, 140);	break;	//blue
            case 2: $_color = imagecolorallocate($this->_image, 65, 125, 0);	break;	//green
            case 3: $_color = imagecolorallocate($this->_image, 255, 75, 45);	break;	//read
            case 4: $_color = imagecolorallocate($this->_image, 238, 175, 7);	break;	//orange
		}
		//$_color = imagecolorallocate($this->_image, 238, 175, 7);
		$_font = __DIR__ . '/fonts/ariblk.ttf';
		//$_angle = (mt_rand() & 0x01) == 0 ? mt_rand() % 30 : - mt_rand() % 30;
		
		//draw the code chars
		$_size = count($this->_codes);
		$_xstep = ($this->_config['w'] - 2 * $this->_config['x']) / $_size;
		$_ret = 0;
		for ( $i = 0; $i < $_size; $i++ ) {
			$_ret = mt_rand();
			imagettftext($this->_image, $this->_config['f'],
					($_ret & 0x01) == 0 ? $_ret % 30 : - ($_ret % 30),
						$this->_config['x'] + $i * $_xstep, $this->_config['y'],
							$_color, $_font, $this->_codes[$i]);
		}
	}
989230
def add_image_from_rspec(argument, example, url_path)
      blob = caller.find{|i| i[ example.file_path.gsub(/:\d*|^\./,"") ]}
      file_with_line = blob.split(":")[0,2].join(":")

      filename = [example.description, argument, file_with_line, SecureRandom.hex(6) ].join(" ").gsub(/\W+/,"_") + ".jpg"
      full_name = File.join(Poltergeist::ScreenshotOverview.target_directory, filename )
      FileUtils.mkdir_p Poltergeist::ScreenshotOverview.target_directory
      describe = example.metadata[:example_group][:description_args]
      @files << Screenshot.new({
        :url                 => url_path,
        :argument            => argument,
        :local_image         => filename,
        :full_path           => full_name,
        :group_description   => describe,
        :example_description => example.description,
        :file_with_line      => file_with_line
      })
      full_name
    end
788256
def file_dialog
      @uploaded_files = UploadedFile.all.reject { |file| file.is_image? }
      render layout: false
    end