Return a picture node from the path.

@param picturePath
path
@return an image
494308
protected ImageView getIcon(final String picturePath) {

		ImageView iv = null;
		if (picturePath == null) {
			iv = new ImageView(new Image(DEFAULT_ICON));
		} else {
			iv = new ImageView(new Image(picturePath));
		}
		iv.setPreserveRatio(true);
		iv.setFitHeight(20);
		return iv;
	}
895207
public T simonTypeImg(SimonType simonType, String rootPath) throws IOException {
		String image = null;
		switch (simonType) {
			case COUNTER:
				image = "TypeCounter.png";
				break;
			case STOPWATCH:
				image = "TypeStopwatch.png";
				break;
			case UNKNOWN:
				image = "TypeUnknown.png";
				break;
		}
		String label = simonType.name().toLowerCase();
		doBegin("img", null, label + " icon");
		attr("src", rootPath + "resource/images/" + image);
		attr("alt", label);
		writer.write(" />");
		return (T) this;
	}
511213
public static Image newInlineImage (String path)
    {
        Image image = new Image(path);
        image.setStyleName("inline");
        return image;
    }
14271
def pic_path
      if picture
        # Get path
        dir = "public/uploads/pictures/"
        full_path = dir+picture.split("/").last.chomp.strip

        # Get file
        `wget -P #{dir} #{picture}` if !File.file?(full_path)
        return full_path
      end
    end
214099
private static LocationPath discardSelfNode(LocationPath path){
        int noOfNulls = 0;
        Step steps[] = path.steps;

        for(int i=steps.length-1; i>=0; --i){
            Step step = steps[i];
            if(step.axis==Axis.SELF && step.constraint.id==Constraint.ID_NODE && !step.predicateSet.hasPosition){
                if(step.predicateSet.getPredicate()==null){
                    steps[i] = null;
                    noOfNulls++;
                }else{
                    if(i!=0){
                        steps[i] = null;
                        steps[i-1].setPredicate(step);
                        noOfNulls++;
                    }
                }
            }
        }
        return noOfNulls>0 ? removeNullSteps(path, noOfNulls) : path;
    }
669840
def get_abs_image_path(self, path):
        

        if not path:
            return ""
        orig_path = path

        server_config = self.config.get_section_config("Server")
        img_directory = self.get_images_directory()

        # Windows path should not be send to a unix server
        if not sys.platform.startswith("win"):
            if re.match(r"^[A-Z]:", path) is not None:
                raise NodeError("{} is not allowed on this remote server. Please use only a filename in {}.".format(path, img_directory))

        if not os.path.isabs(path):
            for directory in images_directories(self._NODE_TYPE):
                path = self._recursive_search_file_in_directory(directory, orig_path)
                if path:
                    return force_unix_path(path)

            # Not found we try the default directory
            s = os.path.split(orig_path)
            path = force_unix_path(os.path.join(img_directory, *s))
            if os.path.exists(path):
                return path
            raise ImageMissingError(orig_path)

        # For non local server we disallow using absolute path outside image directory
        if server_config.getboolean("local", False) is True:
            path = force_unix_path(path)
            if os.path.exists(path):
                return path
            raise ImageMissingError(orig_path)

        path = force_unix_path(path)
        for directory in images_directories(self._NODE_TYPE):
            if os.path.commonprefix([directory, path]) == directory:
                if os.path.exists(path):
                    return path
                raise ImageMissingError(orig_path)
        raise NodeError("{} is not allowed on this remote server. Please use only a filename in {}.".format(path, img_directory))
1143384
public static Observable<Bitmap> getVideoThumbnail(final String filePath) {
    return Observable.fromCallable(new Func0<Bitmap>() {
      @Override
      public Bitmap call() {
        return ThumbnailUtils.createVideoThumbnail(filePath,
            MediaStore.Images.Thumbnails.MINI_KIND);
      }
    });
  }
966341
public String getRealPath(String path) {
        if (context != null) {
            return context.getRealPath(path);
        }
        return path;
    }
118762
public static UnixPath getPath(boolean permitEmptyComponents, String path) {
    if (path.isEmpty()) {
      return EMPTY_PATH;
    } else if (isRootInternal(path)) {
      return ROOT_PATH;
    } else {
      return new UnixPath(permitEmptyComponents, path);
    }
  }
861683
public ScanDestination getDestinationWithSubpath(String path) {
        if (isDiscarding()) {
            return discard();
        }
        if (path == null) {
            return new ScanDestination(_uri);
        }
        return new ScanDestination(UriBuilder.fromUri(_uri).path(path).build());
    }
1051529
static boolean deleteImageFile(String imagePath) {
        // Get the file
        File imageFile = new File(imagePath);

        boolean deleted = false;
        // Delete the image
        if (imageFile.exists()) {
            deleted = imageFile.delete();
        }

        return deleted;
    }
1011007
@Nullable
  protected String getParentPath(String path) {
    // Root does not have a parent.
    if (isRoot(path)) {
      return null;
    }
    int separatorIndex = path.lastIndexOf(PATH_SEPARATOR);
    if (separatorIndex < 0) {
      return null;
    }
    return path.substring(0, separatorIndex);
  }
1137911
public static DocumentPath from(String path) {
    if (path.equals(ROOT_PATH)) {
      return ROOT;
    }
    return new DocumentPath(Arrays.asList(path.split(PATH_SEPARATOR)));
  }
286979
public INode getNode(final INode node, String path) {
		final List<String> split = Strings.split(path, '/');
		INode result = node;
		for (String string : split) {
			String trimmed = string.trim();
			if (trimmed.length() > 0) {
				if ("..".equals(trimmed)) {
					if (result.getParent() == null)
						throw new IllegalStateException("node has no parent");
					result = result.getParent();
				} else {
					int index = Integer.parseInt(string);
					if (index >= 0) {
						INode child = ((ICompositeNode) result).getFirstChild();
						while(index > 0) {
							child = child.getNextSibling();
							index--;
						}
						result = child;
					}
				}
			}
		}
		return result;
	}
1209510
@Override
    public Image getIcon(int iconType) {
        Pair<String, Image> pair = iconInformation.get(iconType);
        String imagePath = pair.first;
        Image imageOrNull = pair.second;
        if ((imageOrNull == null) && (imagePath != null)) {
            imageOrNull = loadImage(imagePath);
        }
        return imageOrNull;
    }
1146996
public BufferedImage buildBufferedImageOfIconInOS(Path path) {
		path = JMOptional
				.getNullableAndFilteredOptional(path, JMPath.NotExistFilter)
				.flatMap(JMPathOperation::createTempFilePathAsOpt).orElse(path);
		Icon iconInOS = os.getIcon(path.toFile());
		BufferedImage bufferedImage = new BufferedImage(iconInOS.getIconWidth(),
				iconInOS.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
		iconInOS.paintIcon(null, bufferedImage.getGraphics(), 0, 0);
		return bufferedImage;
	}
1222725
private Bitmap loadImage(final String path, final Object into, final Transformation transformation) {
        if (into == null || mImagesCache == null || path == null || path.trim().isEmpty())
            return null;

        Log.d(TAG, "load(" + path + ")");

        Bitmap bitmap = null;

        if (transformation == null) {
            bitmap = loadFromLruCache(path, true);
        } else {
            final String pathTransformed = generatePathFromTransformation(path, transformation);
            bitmap = loadFromLruCache(pathTransformed, true);

            if (bitmap == null) { //if bitmap transformed not found in cache
                bitmap = loadFromLruCache(path, true); //try to get the bitmap without transformation
                if (bitmap != null) {
                    new AsyncTask<Void, Void, Bitmap>() {
                        @Override
                        protected Bitmap doInBackground(Void... params) {
                            return transformAndSaveBitmap(path, transformation);
                        }

                        @Override
                        protected void onPostExecute(Bitmap bitmap) {
                            super.onPostExecute(bitmap);
                            if (bitmap != null) {
                                //now its available on cache, can call again loadImage with same parameters
                                loadImage(path, into, transformation);
                            }
                        }
                    }.execute();
                    return null;
                }
            }
        }

        Log.d(TAG, "bitmap from cache " + bitmap + " for " + path);

        if (bitmap != null) { //load directly from cache
            returnBitmapInto(bitmap, path, into);
            Log.d(TAG, "image " + path + " available in the cache");
        } else {
            Log.d(TAG, "image " + path + " not available in the cache, trying to download it");

            if (isUrlPath(path)) {
                Log.d(TAG, "loadImage " + path + " send request to smartphone " + path.hashCode());
                addIntoWaiting(path, into, transformation);
            } else {
                downloadBitmap(path, into, transformation);
            }
        }
        return bitmap;
    }