Load the current image
514039
public void load() {
		int resp = loadChooser.showOpenDialog(this);
		if (resp == JFileChooser.APPROVE_OPTION) {
			lastSelected = loadChooser.getSelectedFile();
			saveChooser.setCurrentDirectory(loadChooser.getCurrentDirectory());
			try {
				BufferedImage image = ImageIO.read(lastSelected);
				imagePanel.setImage(image);
			} catch (Exception e) {
				e.printStackTrace();
				JOptionPane.showMessageDialog(this, "Unable to load image "+lastSelected.getName()+" ");
			}
		}
	}
210540
function loadImage(attrs, fn){
  fn = fn || function(){};
  var img = new Image();
  img.onerror = error(fn, 'failed to load pixel', img);
  img.onload = function(){ fn(); };
  img.src = attrs.src;
  img.width = 1;
  img.height = 1;
  return img;
}
866195
def open(self, fn):
        ""
        return open_image(fn, convert_mode=self.convert_mode, after_open=self.after_open)
545724
def load_and_save_image(url, destination):
    """"""
    from urllib2 import Request, urlopen, URLError, HTTPError
    # create the url and the request
    req = Request(url)

    # Open the url
    try:
        f = urlopen(req)
        print "downloading " + url

        # Open our local file for writing

        local_file = open(destination, "wb")
        # Write to our local file
        local_file.write(f.read())
        local_file.close()

        file_type = imghdr.what(destination)
        local_file = open(destination, "rb")
        data = local_file.read()
        local_file.close()

        final_file = open(destination + '.' + file_type, "wb")
        final_file.write(data)
        final_file.close()
        print('save image preview {0}'.format(destination + '.' + file_type))
        os.remove(destination)

    # handle errors
    except HTTPError, e:
        print "HTTP Error:", e.code, url
    except URLError, e:
        print "URL Error:", e.reason, url
785808
def go_previous_thumbnail(self):
        """"""
        if self.current_thumbnail is not None:
            index = self._thumbnails.index(self.current_thumbnail) - 1
            index = index if index >= 0 else len(self._thumbnails) - 1
            self.set_current_index(index)
            self.scroll_to_item(index)
806638
def _load_new(self, img_data: str):
        
        self._image = tk.PhotoImage(data=img_data)
        self._image = self._image.subsample(int(200 / self._size),
                                            int(200 / self._size))
        self._canvas.delete('all')
        self._canvas.create_image(0, 0, image=self._image, anchor='nw')

        if self._user_click_callback is not None:
            self._user_click_callback(self._on)
739712
function loadImage ($imageElement, newSource, callback) {
        $imageElement.fadeOut(function () {
            $imageElement.attr("src", newSource);
            imgLoad($imageElement, function () {
                $imageElement.removeClass("loading");
                $imageElement.fadeIn();
                if (typeof callback === "function") {
                    callback();
                }
            });
        });
    }
1352554
def load_from(self, image):
        
        if not isinstance(image, self.__class__):
            raise ConuException("Invalid source image type", type(image))
        image.save_to(self)
1122066
function () {
            this.preload();

            $loadImgPromise.done(function loadImgSuccess(img) {
                if (!imageLoaded) {
                    imageLoaded = true;
                    $img = $(img).appendTo($el);
                }
            });

            $loadImgPromise.fail(function loadImgFail(error) {
                imageLoaded = false;
                if (error) {
                    scope.broadcast('asseterror', error);
                }
            });

            return $loadImgPromise;
        }
354944
function loadHandler (event) {
    const target = event.target;

    // change the link to the new file
    link.setAttribute('href', target.result);

    // make sure checkbox is no longer checked
    checkbox.checked = false;

    // make link not hidden
    link.style.display = '';

    // make delete checkbox not hidden
    deleter.style.display = '';

    // image uploaded
    if (file.type.match('image.*')) {
      // create image
      const image = new Image();
      image.title = file.name;
      image.src = target.result;

      // replace file--link contents
      link = clear(link);
      link.appendChild(image);
    }
    else {
      // non-image file
      link.textContent = file.name;
    }
  }
1320461
def load_image(name, n, m=None, gpu=None, square=None):
    """"""
    if m is None:
        m = n
    if gpu is None:
        gpu = 0
    if square is None:
        square = 0
    command = ('Shearlab.load_image("{}", {}, {}, {}, {})'.format(name,
               n, m, gpu, square))
    return j.eval(command)
560715
function(){
			var image = document.createElement("img");
			image.id = this._prefix+this._id;
			image.src = Commands.NO_IMAGE;
			image.className = "progressPane_running";
			this._anchor.appendChild(image);
		}
239755
public ImageHelper load(ImageView v, Request request) {
        loadInternal(v, request, listener, null);

        return this;
    }
1324385
def set_current_thumbnail(self, thumbnail):
        """"""
        self.current_thumbnail = thumbnail
        self.figure_viewer.load_figure(
                thumbnail.canvas.fig, thumbnail.canvas.fmt)
        for thumbnail in self._thumbnails:
            thumbnail.highlight_canvas(thumbnail == self.current_thumbnail)
708648
def load_image(self, loc, title, group):
        '''
        
        '''
        self.images.setdefault(group, {})
        self.images[group][title] = pygame.image.load(loc).convert_alpha()
403139
def load(self, draw_bbox = False, **kwargs):
        '''  '''
        im = Image.new('RGBA', self.img_size)
        draw = None
        if draw_bbox:
            draw = ImageDraw.Draw(im)

        for sprite in self.images:
            data = sprite.load()
            sprite_im = Image.open(BytesIO(data))

            size = sprite.imgrect
            im.paste(sprite_im, (size[0], size[2]))
            if draw_bbox:
                draw.rectangle((size[0], size[2], size[1], size[3]), outline='red')

        del draw
        b = BytesIO()
        im.save(b, format = 'PNG')
        return b.getvalue()
172763
function onImagesLoaded(images, callback) {
    var self = this,
        unloaded = images.length;

    if (unloaded === 0) {
      callback();
    }

    images.each(function () {
      // Check if image is loaded
      if (this.complete || this.readyState === 4 || this.readyState === 'complete') {
        singleImageLoaded();
      }
      // Force load the image
      else {
          // fix for IE. See https://css-tricks.com/snippets/jquery/fixing-load-in-ie-for-cached-images/
          var src = $(this).attr('src');
          $(this).attr('src', src + (src.indexOf('?') >= 0 ? '&' : '?') + new Date().getTime());
          $(this).one('load', function () {
            singleImageLoaded();
          });
        }
    });

    function singleImageLoaded() {
      unloaded--;
      if (unloaded === 0) {
        callback();
      }
    }
  }