Returns array of images used in content
19829
def used_images
      result = content.scan(/!\[.*\]\(.*\/image\/(\d.*)\/.*\)/)
      image_ids = result.nil? ? nil : result.map{ |i| i[0].to_i }.uniq
      image_ids
    end
440253
def images(self):
        
        if len(self._plain_images) <= 0:
            self._convert_images()

        return iter(self._plain_images)
1265511
def get_images(params = {})
      @log.trace "Listing images with params = #{params.to_json}..."
      data = JSON.parse(RestClient.get("#{url}/v1/images", :params => params))['images']
      @log.trace "Listing done."
      data
    end
1124097
public function _async_content_images( $content ) {
		if ( ! $this->_is_async_content_images() ) {
			return $content;
		}

		if ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) {
			return $content;
		}

		$selected_images = [];
		foreach ( $matches[0] as $image ) {
			if ( false === strpos( $image, ' decoding=' ) && preg_match( '/wp-image-([0-9]+)/i', $image, $reg ) ) {
				$selected_images[ $reg[1] ][] = $image;
			}
		}

		foreach ( $selected_images as $image_id => $images ) {
			foreach ( $images as $image ) {
				$new_image = $this->_add_decoding_to_content_image( $image );
				$new_image = $this->_add_data_src_to_content_image( $new_image, $image_id );
				$new_image = $this->_add_data_srcset_to_content_image( $new_image, $image_id );

				$content = str_replace( $image, $new_image, $content );
			}
		}

		return $content;
	}
9962
public function getImagesUrls()
    {
        return Collection::make($this->event->get('attachments'))->where('contentType', 'image')->map(function ($item) {
            return new Image($item['contentUrl'], $item);
        })->toArray();
    }
1176191
def extract_imgs_from_page(page)
      return Set[] if page.is_redirect?
      page.doc.search('//img[@src]').reduce(Set[]) do |result, elem|
        u = elem.attributes['src'].content
        result << page.to_absolute(URI.parse(URI.encode(u)))
      end
    end
342340
def images(self):
        
        if self._images is None:
            self._images = list()
            params = {
                "generator": "images",
                "gimlimit": "max",
                "prop": "imageinfo",  # this will be replaced by fileinfo
                "iiprop": "url",
            }
            for page in self._continued_query(params):
                if "imageinfo" in page and "url" in page["imageinfo"][0]:
                    self._images.append(page["imageinfo"][0]["url"])
            self._images = sorted(self._images)
        return self._images
1274526
function getMedia() {
	var results = [];

	if (extensions && extensions.hasOwnProperty('media')) {
		var sourceArray = extensions.media;

		for (index = 0; index < sourceArray.length; ++index) {
		    results.push(sourceArray[index]);
		}
	}

	return results;
}
1013630
def get_img_list(self):
        
        tree = html.fromstring(self.page_html)
        img = tree.xpath('//img/@src')
        links = tree.xpath('//a/@href')
        img_list = self.process_links(img)
        img_links = self.process_links(links)
        img_list.extend(img_links)

        if self.filename_pattern:
            # Compile pattern for efficiency
            pattern = re.compile(self.filename_pattern)

            # Verifies filename in the image URL matches pattern
            def matches_pattern(img_url):
                """ Function to check if pattern is matched. """

                img_filename = urlparse(img_url).path.split('/')[-1]
                return pattern.search(img_filename)

            images = [urljoin(self.url, img_url) for img_url in img_list
                      if matches_pattern(img_url)]
        else:
            images = [urljoin(self.url, img_url) for img_url in img_list]

        images = list(set(images))
        self.images = images
        if self.scrape_reverse:
            self.images.reverse()
        return self.images
912330
def _extract_image_urls(self):
        """"""

        resultsPage = self._chromeDriver.page_source

        resultsPageSoup = BeautifulSoup(resultsPage, 'html.parser')
        images = resultsPageSoup.find_all('div', class_='rg_meta')
        images = [json.loads(image.contents[0]) for image in images]

        [self._imageURLs.append(image['ou']) for image in images]

        self._imageURLsExtractedCount += len(images)
43010
def get_images(self, obj):
        """"""
        return {str(i.tag): i.image.url for i in obj.images.all()}
912313
def avail_images(call=None):
    '''
    

    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])

    image_pool = server.one.imagepool.info(auth, -2, -1, -1)[1]

    images = {}
    for image in _get_xml(image_pool):
        images[image.find('NAME').text] = _xml_to_dict(image)

    return images
581936
public function getImageTitleOptions()
    {
        return [
            self::IMAGE_TITLE_NONE => _t(__CLASS__ . '.NONE', 'None'),
            self::IMAGE_TITLE_MEDIA => _t(__CLASS__ . '.MEDIATITLE', 'Media Title'),
            self::IMAGE_TITLE_COMPONENT => _t(__CLASS__ . '.COMPONENTTITLE', 'Component Title')
        ];
    }
537107
public function enaImageFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $imagExts   = $this->getImageExtensionConstant();
        foreach ($imagExts as $imagExt) {
            if (in_array($imagExt, $extString) === false) {
                $extString[] = $imagExt;
            }
        }
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
278805
def layered(self):
        """"""
        result = []
        for layer in self._layered:
            nxt = []
            for name in layer:
                nxt.append((name, self.all_images[name]))
            result.append(nxt)
        return result
1145465
def images():
    
    if request.method == 'POST':
        file_upload = request.files['file']
        if file_upload:
            image = dict()
            image['filename'] = secure_filename(file_upload.filename)
            full_path = os.path.join(session['img_input_dir'],
                                     image['filename'])
            file_upload.save(full_path)
            image['uid'] = session['image_uid_counter']
            session['image_uid_counter'] += 1
            current_app.logger.debug('File %d is saved as %s',
                                     image['uid'],
                                     image['filename'])
            session['image_list'].append(image)
            return jsonify(ok="true", file=image['filename'], uid=image['uid'])
        return jsonify(ok="false")
    if request.method == 'GET':
        return jsonify(images=session['image_list'])
83985
def images(self):
        
        return [
            MediaImage(item.get('url'), item.get('height'), item.get('width'))
            for item in self.media_metadata.get('images', [])
        ]