Like {@link #getImage(String)} but the image is loaded from the specified resource set
rathern than the default resource set.
491408
public BufferedImage getImage (String rset, String path)
    {
        return getImage(rset, path, null);
    }
212530
public Image getImage(int index) {
		Frame frame = (Frame) frames.get(index);
		return frame.image;
	}
395764
public ImageDownloadResult getImageDownloadResultWait() throws Exception {
		try {
			ImageDownloadResult imdr = pool.take().get();
			return imdr;
		} catch (Exception e) {
			throw e;
		} finally {
			// in any case (Exception or not) the numPendingTask should be reduced
			numPendingTasks--;
		}
	}
123838
@Override
	public Response setImage(
			final String name,
			final String qualifier,
			final InputStream image,
			final FormDataContentDisposition fileDetail) {

		// Do set the image, and wrap exceptions in a HTTP response.
		Response response;
		String id = name + " (qualifier = " + qualifier + ")";
		try {
			doSetImage(name, qualifier, image, fileDetail);
			response = Response.noContent().build();

		} catch( IllegalArgumentException e ) {
			response = handleError(
					Status.BAD_REQUEST,
					new RestError( REST_MNGMT_INVALID_IMAGE, e ),
					lang( this.manager )).build();

		} catch( NoSuchElementException e ) {
			response = handleError(
					Status.BAD_REQUEST,
					new RestError( REST_INEXISTING, e, name( id )),
					lang( this.manager )).build();

		} catch( IOException e ) {
			response = handleError(
					Status.INTERNAL_SERVER_ERROR,
					new RestError( REST_IO_ERROR, e ),
					lang( this.manager )).build();
		}

		return response;
	}
59063
protected ImageDataProvider getDataProvider (final String rset)
    {
        if (rset == null) {
            return _defaultProvider;
        }

        ImageDataProvider dprov = _providers.get(rset);
        if (dprov == null) {
            dprov = new ImageDataProvider() {
                public BufferedImage loadImage (String path)
                    throws IOException {
                    // first attempt to load the image from the specified resource set
                    try {
                        return _rmgr.getImageResource(rset, path);
                    } catch (FileNotFoundException fnfe) {
                        // fall back to trying the classpath
                        return _rmgr.getImageResource(path);
                    }
                }

                public String getIdent () {
                    return "rmgr:" + rset;
                }
            };
            _providers.put(rset, dprov);
        }

        return dprov;
    }
43873
public BufferedImage getImage() throws IOException {
        if (image == null) {
            // No content, no image
            if (bufferedOut == null) {
                return null;
            }

            // Read from the byte buffer
            InputStream byteStream = bufferedOut.createInputStream();
            ImageInputStream input = null;
            try {
                input = ImageIO.createImageInputStream(byteStream);
                Iterator readers = ImageIO.getImageReaders(input);
                if (readers.hasNext()) {
                    // Get the correct reader
                    ImageReader reader = (ImageReader) readers.next();
                    try {
                        reader.setInput(input);

                        ImageReadParam param = reader.getDefaultReadParam();

                        // Get default size
                        int originalWidth = reader.getWidth(0);
                        int originalHeight = reader.getHeight(0);
//////////////////
// PRE-PROCESS (prepare): param, size, format?, request, response?
                        // TODO: AOI strategy?
                        // Extract AOI from request
                        Rectangle aoi = extractAOIFromRequest(originalWidth, originalHeight, originalRequest);

                        if (aoi != null) {
                            param.setSourceRegion(aoi);
                            originalWidth = aoi.width;
                            originalHeight = aoi.height;
                        }

                        // TODO: Size and subsampling strategy?
                        // If possible, extract size from request
                        Dimension size = extractSizeFromRequest(originalWidth, originalHeight, originalRequest);
                        double readSubSamplingFactor = getReadSubsampleFactorFromRequest(originalRequest);

                        if (size != null) {
                            //System.out.println("Size: " + size);
                            if (param.canSetSourceRenderSize()) {
                                param.setSourceRenderSize(size);
                            }
                            else {
                                int subX = (int) Math.max(originalWidth / (size.width * readSubSamplingFactor), 1.0);
                                int subY = (int) Math.max(originalHeight / (size.height * readSubSamplingFactor), 1.0);

                                if (subX > 1 || subY > 1) {
                                    param.setSourceSubsampling(subX, subY, subX > 1 ? subX / 2 : 0, subY > 1 ? subY / 2 : 0);
                                }
                            }
                        }

                        // Need base URI for SVG with links/stylesheets etc
                        maybeSetBaseURIFromRequest(param);

/////////////////////

                        // Finally, read the image using the supplied parameter
                        BufferedImage image = reader.read(0, param);

                        // TODO: If we sub-sampled, it would be a good idea to blur before resampling,
                        // to avoid jagged lines artifacts

                        // If reader doesn't support dynamic sizing, scale now
                        image = resampleImage(image, size);

                        // Fill bgcolor behind image, if transparent
                        extractAndSetBackgroundColor(image); // TODO: Move to flush/POST-PROCESS

                        // Set image
                        this.image = image;
                    }
                    finally {
                        reader.dispose();
                    }
                }
                else {
                    context.log("ERROR: No suitable image reader found (content-type: " + originalContentType + ").");
                    context.log("ERROR: Available formats: " + getFormatsString());

                    throw new IIOException("Unable to transcode image: No suitable image reader found (content-type: " + originalContentType + ").");
                }

                // Free resources, as the image is now either read, or unreadable
                bufferedOut = null;
            }
            finally {
                if (input != null) {
                    input.close();
                }
            }
        }

        // Image is usually a BufferedImage, but may also be a RenderedImage
        return image != null ? ImageUtil.toBuffered(image) : null;
    }
1281294
public BufferedImage getImage(String urlStr) throws FlickrException {
        InputStream in = null;
        try {
            URL url = new URL(urlStr);
            HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
            if (transport instanceof REST) {
                if (((REST) transport).isProxyAuth()) {
                    conn.setRequestProperty("Proxy-Authorization", "Basic " + ((REST) transport).getProxyCredentials());
                }
            }
            conn.connect();
            in = conn.getInputStream();
            return ImageIO.read(in);
        } catch (IOException e) {
            throw new FlickrException(e.getMessage(), e.getCause());
        } finally {
            IOUtilities.close(in);
        }
    }
1316087
public Map<String, String> getImageDnd() {

        if (m_imageDnd == null) {
            m_imageDnd = CmsCollectionsGenericWrapper.createLazyMap(new CmsImageDndTransformer());
        }
        return m_imageDnd;
    }
574778
private BufferedImage downloadImage() throws Exception {
        BufferedImage image = null;
        InputStream in = null;
        try { // first try reading with the default class
            URL url = new URL(imageUrl);

            HttpURLConnection conn = null;

            boolean success = false;
            try {
                conn = (HttpURLConnection) url.openConnection();
                conn.setInstanceFollowRedirects(followRedirects);
                conn.setConnectTimeout(connectionTimeout); // TO DO: add retries when connections times out
                conn.setReadTimeout(readTimeout);
                conn.connect();
                success = true;
            } catch (Exception e) {
                //System.out.println("Connection related exception at url: " + imageUrl);
                //throw e;
            } finally {
                if (!success) {
                    conn.disconnect();
                }
            }

            success = false;
            try {
                in = conn.getInputStream();
                success = true;
            } catch (Exception e) {
                /*System.out.println("Exception when getting the input stream from the connection at url: "
                        + imageUrl);
                throw e;*/
            } finally {
                if (!success) {
                    in.close();
                }
            }
            image = ImageIO.read(in);
        } catch (IllegalArgumentException e) {
            // this exception is probably thrown because of a greyscale jpeg image
            System.out.println("Exception: " + e.getMessage() + " | Image: " + imageUrl);
            image = ImageIOGreyScale.read(in); // retry with the modified class
        } catch (MalformedURLException e) {
            System.out.println("Malformed url exception. Url: " + imageUrl);
            //throw e;
        }
        return image;
    }
946739
@Override
    public String getImageOf(String size) {
        if (owner == null) {
            return BallColor.GREY.getImageOf(size);
        }

        return calculateBallColor().getImageOf(size);
    }
1231853
public function getImage() : ?string 
    {
        if ( ! $this->hasImage()) {
            $this->setImage($this->getDefaultImage());
        }
        return $this->image;
    }
129873
protected <T extends ImageBase> ImageType<T> getImageType( int which ) {
		synchronized ( inputStreams ) {
			return inputStreams.get(which).imageType;
		}
	}
77727
public BufferedImage downloadImage() throws Exception {
		BufferedImage image = null;
		// try to recognize the type of the image from the url so that the correct format and file extension
		// are used when saving the thumbnail image or the original image.
		// In case that the url does not contain a known image extension, the jpg extension is used.
		String[] splitted = imageUrl.split("\\.");
		String fileExtension = (splitted[splitted.length - 1]).toLowerCase();
		if (!fileExtension.equals("jpg") && !fileExtension.equals("jpeg") && !fileExtension.equals("png")
				&& !fileExtension.equals("bmp") && !fileExtension.equals("gif")) {
			fileExtension = "jpg";
		}
		// this name filename will be used for the saved image file
		String imageFilename = downloadFolder + imageId + "." + fileExtension;

		// initialize the url, checking that it is valid
		URL url = null;
		try {
			url = new URL(imageUrl);
		} catch (MalformedURLException e) {
			System.out.println("Malformed url exception. Url: " + imageUrl);
			throw e;
		}

		HttpURLConnection conn = null;
		FileOutputStream fos = null;
		ReadableByteChannel rbc = null;
		InputStream in = null;
		boolean success = false;
		try {
			conn = (HttpURLConnection) url.openConnection();
			conn.setInstanceFollowRedirects(followRedirects);
			conn.setConnectTimeout(connectionTimeout); // TO DO: add retries when connections times out
			conn.setReadTimeout(readTimeout);
			conn.connect();
			success = true;
		} catch (Exception e) {
			System.out.println("Connection related exception at url: " + imageUrl);
			throw e;
		} finally {
			if (!success) {
				conn.disconnect();
			}
		}

		success = false;
		try {
			in = conn.getInputStream();
			success = true;
		} catch (Exception e) {
			System.out.println("Exception when getting the input stream from the connection at url: "
					+ imageUrl);
			throw e;
		} finally {
			if (!success) {
				in.close();
			}
		}

		rbc = Channels.newChannel(in);

		// if an Exception is thrown in the following code, the file that was created must be deleted
		try {
			// just copy the file
			fos = new FileOutputStream(imageFilename);
			fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
			fos.close();
			in.close();
			rbc.close();
			conn.disconnect();
			try { // first try reading with the default class
				image = ImageIO.read(new File(imageFilename));
			} catch (IllegalArgumentException e) {
				// this exception is probably thrown because of a greyscale jpeg image
				System.out.println("Exception: " + e.getMessage() + " | Image: " + imageFilename + " URL: "
						+ imageUrl);
				image = ImageIOGreyScale.read(new File(imageFilename)); // retry with the modified class
			}
		} catch (Exception e) { // in case of any other exception delete the image and re-throw the exception
			System.out.println("Exception: " + e.toString() + " | Image: " + imageFilename + " URL: "
					+ imageUrl);
			throw (e);
		} finally {
			if (image == null) { // if the image could not be read into a BufferedImage object then delete it
				File imageFile = new File(imageFilename);
				imageFile.delete();
				System.out.println("Deleting image with id " + imageId + ", url: " + imageUrl);
				throw new Exception("Could not read into BufferedImage");
			} else {
				if (saveThumb) { // save a thumbnail of the original image
					ImageScaling scale = new ImageScaling(thumbnailSizeInPixels);
					BufferedImage scaledImage = scale.maxPixelsScaling(image);
					FileOutputStream out = new FileOutputStream(new File(imageFilename.replace("."
							+ fileExtension, "-thumb." + fileExtension)));
					ImageIO.write(scaledImage, fileExtension, out);
					out.close();
				}
				if (!saveOriginal) {// delete the original image if needed
					File imageFile = new File(imageFilename);
					imageFile.delete();
				}
			}
			// close the open streams
			fos.close();
			in.close();
			rbc.close();
			conn.disconnect();
		}
		return image;
	}
846138
def get(cls, rkey):
        

        if rkey in cls._cached:
            logger.info('Resource %s is in cache.' % rkey)
            return cls._cached[rkey]
        if rkey in cls._stock:
            img = cls._load_image(rkey)
            return img
        else:
            raise StockImageException('StockImage: %s not registered.' % rkey)
506142
public static String getImage(Priority priority) {
        String image = getLabel("icon", priority);
        return image == null ? null : IconUtil.getIconPath(image);
    }
1327519
public static <IMAGE extends ImageView> void doLoadImageUrl(@NonNull IMAGE view, @Nullable String url) {
        Preconditions.checkState(sImageSetter != null, "ImageSetter must be initialized before calling image load");
        sImageSetter.doLoadImageUrl(view, url);
    }
1078257
private JSONObject getImageKeyword(final JSONArray imageKeywords, final int index) {
    JSONObject object = new JSONObject();
    try {
      object = (JSONObject) imageKeywords.get(index);
    }
    catch(JSONException e) {
      e.printStackTrace();
    }
    return object;
  }