Images are in the master file
542659
public static Report renameImagesAsUnique(Report report) {
        JasperContent reportContent = (JasperContent) report.getContent();
		try {
			String masterContent = new String(reportContent.getMaster().getDataProvider().getBytes(), "UTF-8");
			for (JcrFile imageFile : reportContent.getImageFiles()) {
				String oldName = imageFile.getName();
				int index = oldName.lastIndexOf(ReportUtil.EXTENSION_SEPARATOR);
				String newName = oldName.substring(0, index) + ReportUtil.IMAGE_DELIM + UUID.randomUUID().toString()
						+ oldName.substring(index);
				masterContent = masterContent.replaceAll(oldName, newName);
				imageFile.setName(newName);
			}
			reportContent.getMaster().setDataProvider(new JcrDataProviderImpl(masterContent.getBytes("UTF-8")));
		} catch (UnsupportedEncodingException e) {
			LOG.error("Error inside JasperUtil.renameImagesAsUnique: " + e.getMessage(), e);
			e.printStackTrace();
		}

        return report;
    }
713117
function buildImages(conf, undertaker) {

    const imageMinConfig = {
      progressive: true,
      svgoPlugins: [{
        removeViewBox: false
      }, {
        cleanupIDs: true
      }, {
        cleanupAttrs: true
      }]
    };

    const imageSrc = path.join(conf.themeConfig.root, conf.themeConfig.images.src, '**', '*');
    const imageDest = path.join(conf.themeConfig.root, conf.themeConfig.images.dest);

    return undertaker.src(imageSrc)
      .pipe(imagemin(imageMinConfig))
      .pipe(undertaker.dest(imageDest));

}
1151426
private void insertImage() {
        String initialDir = System.getProperty("user.dir");
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle("Insert image");
        fileChooser.setInitialDirectory(new File(initialDir));
        File selectedFile = fileChooser.showOpenDialog(mainStage);
        if (selectedFile != null) {
            String imagePath = selectedFile.getAbsolutePath();
            imagePath = imagePath.replace('\\',  '/');
            ReadOnlyStyledDocument<ParStyle, Either<String, LinkedImage>, TextStyle> ros =
                    ReadOnlyStyledDocument.fromSegment(Either.right(new RealLinkedImage(imagePath)),
                                                       ParStyle.EMPTY, TextStyle.EMPTY, area.getSegOps());
            area.replaceSelection(ros);
        }
    }
1157078
def move_images(self, image_directory):
        

        image_paths = glob(image_directory + "/**/*.png", recursive=True)
        for image_path in image_paths:
            destination = image_path.replace("\\image\\", "\\")
            shutil.move(image_path, destination)
        image_folders = glob(image_directory + "/**/image", recursive=True)
        for image_folder in image_folders:
            os.removedirs(image_folder)
18278
function(e){
    var property = e.property;
    var ruleIds = this.get('ruleIds');
    var imageIndex = property.indexOf('background');

    if (imageIndex == -1) imageIndex = property.indexOf('background-image');

    ruleIds.push(e.id);
    if (imageIndex > -1) {
      this._collectImages(e, imageIndex);
    }
  }
965127
function() {
            // NOTE: This fixed issue #7
            // https://github.com/vowstar/gitbook-plugin-uml/issues/7
            // HTML will load after this operation
            // Copy images to output folder every time
            var book = this;
            var output = book.output;
            var rootPath = output.root();
            if (fs.existsSync(ASSET_PATH)) {
                fs.mkdirs(path.join(rootPath, ASSET_PATH));
                fs.copySync(ASSET_PATH, path.join(rootPath, ASSET_PATH));
            }
        }
737286
def copy_dependency_images(tile):
    """"""

    env = Environment(tools=[])

    outputbase = os.path.join('build', 'output')
    depbase = os.path.join('build', 'deps')
    for dep in tile.dependencies:
        depdir = os.path.join(depbase, dep['unique_id'])
        outputdir = os.path.join(outputbase)

        deptile = IOTile(depdir)

        for image in deptile.find_products('firmware_image'):
            name = os.path.basename(image)
            input_path = os.path.join(depdir, name)
            output_path = os.path.join(outputdir, name)
            env.Command([output_path], [input_path], Copy("$TARGET", "$SOURCE"))
1217098
public function deleteRemoteImageCaches()
    {
        $path = Craft::$app->getPath()->getRuntimePath().'/imager/';

        try {
            FileHelper::clearDirectory(FileHelper::normalizePath($path));
        } catch (ErrorException $e) {
            Craft::error('Could not clear directory "'.$path.'" ('.$e->getMessage().')', __METHOD__);
        } catch (InvalidParamException $e) {
            Craft::error('Could not clear directory "'.$path.'" ('.$e->getMessage().')', __METHOD__);
        }
    }
1250346
def master_then_spare(data):
    
    master = []
    spare = []
    for sdata in data:
        if sdata.spare:
            spare.append(sdata)
        else:
            master.append(sdata)
    rdata = []
    rdata.extend(master)
    rdata.extend(spare)
    return rdata
1020415
public function getMasterPicturePath($file, $admin = false)
    {
        return $this->getDir($file, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $admin);
    }
577891
def build_master_ufos(
        self,
        glyphs_path,
        designspace_path=None,
        master_dir=None,
        instance_dir=None,
        family_name=None,
        mti_source=None,
    ):
        """"""
        import glyphsLib

        if master_dir is None:
            master_dir = self._output_dir("ufo")
        if not os.path.isdir(master_dir):
            os.mkdir(master_dir)
        if instance_dir is None:
            instance_dir = self._output_dir("ufo", is_instance=True)
        if not os.path.isdir(instance_dir):
            os.mkdir(instance_dir)

        font = glyphsLib.GSFont(glyphs_path)

        if designspace_path is not None:
            designspace_dir = os.path.dirname(designspace_path)
        else:
            designspace_dir = master_dir
        # glyphsLib.to_designspace expects instance_dir to be relative
        instance_dir = os.path.relpath(instance_dir, designspace_dir)

        designspace = glyphsLib.to_designspace(
            font, family_name=family_name, instance_dir=instance_dir
        )

        masters = {}
        # multiple sources can have the same font/filename (but different layer),
        # we want to save a font only once
        for source in designspace.sources:
            if source.filename in masters:
                assert source.font is masters[source.filename]
                continue
            ufo_path = os.path.join(master_dir, source.filename)
            # no need to also set the relative 'filename' attribute as that
            # will be auto-updated on writing the designspace document
            source.path = ufo_path
            source.font.save(ufo_path)
            masters[source.filename] = source.font

        if designspace_path is None:
            designspace_path = os.path.join(master_dir, designspace.filename)
        designspace.write(designspace_path)
        if mti_source:
            self.add_mti_features_to_master_ufos(mti_source, masters.values())
        return designspace_path
1017824
def set_custom_image(user_context, app_id, image_path):
  """"""
  if image_path is None:
    return False

  if not os.path.exists(image_path):
    return False

  (root, ext) = os.path.splitext(image_path)
  if not is_valid_extension(ext):
    # TODO: Maybe log that this happened?
    return False
  # If we don't remove the old image then theres no guarantee that Steam will
  # show our new image when it launches.
  if has_custom_image(user_context, app_id):
    img = get_custom_image(user_context, app_id)
    assert(img is not None)
    os.remove(img)
  
  # Set the new image
  parent_dir = paths.custom_images_directory(user_context)
  new_path = os.path.join(parent_dir, app_id + ext)
  shutil.copyfile(image_path, new_path)
  return True
774255
def post_process_symbolizer_image_file(file_href, dirs):
    
    # support latest mapnik features of auto-detection
    # of image sizes and jpeg reading support...
    # http://trac.mapnik.org/ticket/508

    mapnik_auto_image_support = (MAPNIK_VERSION >= 701)
    mapnik_requires_absolute_paths = (MAPNIK_VERSION < 601)
    file_href = urljoin(dirs.source.rstrip('/')+'/', file_href)
    scheme, n, path, p, q, f = urlparse(file_href)
    if scheme in ('http','https'):
        scheme, path = '', locally_cache_remote_file(file_href, dirs.cache)
    
    if scheme not in ('file', '') or not systempath.exists(un_posix(path)):
        raise Exception("Image file needs to be a working, fetchable resource, not %s" % file_href)
        
    if not mapnik_auto_image_support and not Image:
        raise SystemExit('PIL (Python Imaging Library) is required for handling image data unless you are using PNG inputs and running Mapnik >=0.7.0')

    img = Image.open(un_posix(path))
    
    if mapnik_requires_absolute_paths:
        path = posixpath.realpath(path)
    
    else:
        path = dirs.output_path(path)

    msg('reading symbol: %s' % path)

    image_name, ext = posixpath.splitext(path)
    
    if ext in ('.png', '.tif', '.tiff'):
        output_ext = ext
    else:
        output_ext = '.png'
    
    # new local file name
    dest_file = un_posix('%s%s' % (image_name, output_ext))
    
    if not posixpath.exists(dest_file):
        img.save(dest_file,'PNG')

    msg('Destination file: %s' % dest_file)

    return dest_file, output_ext[1:], img.size[0], img.size[1]
366363
def check_partial_imagemagick_versions
      prefix = config_string('prefix') || ''
      matches = [
        prefix + '/lib/lib?agick*',
        prefix + '/include/ImageMagick',
        prefix + '/bin/Magick-config'
      ].map do |file_glob|
        Dir.glob(file_glob)
      end
      matches.delete_if(&:empty?)
      return unless !matches.empty? && matches.length < 3

      msg = "\nWarning: Found a partial ImageMagick installation. Your operating system likely has some built-in ImageMagick libraries but not all of ImageMagick. This will most likely cause problems at both compile and runtime.\nFound partial installation at: " + prefix + "\n"
      Logging.message msg
      message msg
    end
1051833
def _update_images(self):
        
        wd_images = self.data['claims'].get('P18')  # image

        if wd_images:
            if not isinstance(wd_images, list):
                wd_images = [wd_images]

            if 'image' not in self.data:
                self.data['image'] = []

            for img_file in wd_images:
                self.data['image'].append({'file': img_file,
                                           'kind': 'wikidata-image'})
384888
def join_images(img_files, out_file):
    """"""
    images = [PIL.Image.open(f) for f in img_files]
    joined = PIL.Image.new(
        'RGB',
        (sum(i.size[0] for i in images), max(i.size[1] for i in images))
    )
    left = 0
    for img in images:
        joined.paste(im=img, box=(left, 0))
        left = left + img.size[0]
    joined.save(out_file)
246510
void inspectStorageDirs(FSImageStorageInspector inspector)
      throws IOException {

    // Process each of the storage directories to find the pair of
    // newest image file and edit file
    for (Iterator<StorageDirectory> it = dirIterator(); it.hasNext();) {
      StorageDirectory sd = it.next();
      inspector.inspectDirectory(sd);
    }
  }