Returns a thumbnail's large size.
499579
def large_size(self, as_string=True):
        """"""
        size = getattr(settings, 'USER_MEDIA_THUMB_SIZE_LARGE', (150, 150))
        if as_string:
            return u'{}x{}'.format(size[0], size[1])
        return size
515394
function getImageSize(element) {
            var imageObj = url.parse(element.attribs.src),
                requestOptions,
                timeout = 3000;

            if (!validator.isURL(imageObj.href)) {
                // revert this element, do not show
                element.name = 'img';

                return enter();
            }

            // We need the user-agent, otherwise some https request may fail (e. g. cloudfare)
            requestOptions = {
                headers: {
                    'User-Agent': 'Mozilla/5.0 Safari/537.36'
                },
                timeout: timeout,
                encoding: null
            };

            return got(
                imageObj.href,
                requestOptions
            ).then(function (response) {
                try {
                    // Using the Buffer rather than an URL requires to use sizeOf synchronously.
                    // See https://github.com/image-size/image-size#asynchronous
                    var dimensions = sizeOf(response.body);

                    // CASE: `.ico` files might have multiple images and therefore multiple sizes.
                    // We return the largest size found (image-size default is the first size found)
                    if (dimensions.images) {
                        dimensions.width = _.maxBy(dimensions.images, function (w) {return w.width;}).width;
                        dimensions.height = _.maxBy(dimensions.images, function (h) {return h.height;}).height;
                    }

                    element.attribs.width = dimensions.width;
                    element.attribs.height = dimensions.height;

                    return getLayoutAttribute(element);
                } catch (err) {
                    // revert this element, do not show
                    element.name = 'img';
                    return enter();
                }
            }).catch(function () {
                // revert this element, do not show
                element.name = 'img';
                return enter();
            });
        }
285141
def get_image(self, size=SIZE_EXTRA_LARGE):
        

        doc = self._request(self.ws_prefix + ".getInfo", True)

        return _extract_all(doc, "image")[size]
597034
def filesize(num_bytes):
    """"""
    for prefix in '-KMGTEPZY':
        if num_bytes < 999.9:
            break
        num_bytes /= 1000.0
    if prefix == '-':
        return '{} B'.format(num_bytes)
    return '{:.3n} {}B'.format(num_bytes, prefix)
857881
def THUMBNAIL_OPTIONS(self):
        
        from django.core.exceptions import ImproperlyConfigured

        size = self._setting('DJNG_THUMBNAIL_SIZE', (200, 200))
        if not (isinstance(size, (list, tuple)) and len(size) == 2 and isinstance(size[0], int) and isinstance(size[1], int)):
            raise ImproperlyConfigured("'DJNG_THUMBNAIL_SIZE' must be a 2-tuple of integers.")
        return {'crop': True, 'size': size}
1356680
public long getRelocatedImageBase() {
		long imageBase = get(WindowsEntryKey.IMAGE_BASE);
		long sizeOfImage = get(WindowsEntryKey.SIZE_OF_IMAGE);
		if (imageBase + sizeOfImage >= 0x80000000L || imageBase == 0L) {
			return 0x10000L;
		}
		return imageBase;
	}
1023665
def get_fullsize(self, kwargs):
        
        fullsize_args = {}

        if 'absolute' in kwargs:
            fullsize_args['absolute'] = kwargs['absolute']

        for key in ('width', 'height', 'quality', 'format', 'background', 'crop'):
            fsk = 'fullsize_' + key
            if fsk in kwargs:
                fullsize_args[key] = kwargs[fsk]

        img_fullsize, _ = self.get_rendition(1, **fullsize_args)
        return img_fullsize
522986
def get(self, maxheight=None, maxwidth=None, sensor=False):
        """"""
        if not maxheight and not maxwidth:
            raise GooglePlacesError('You must specify maxheight or maxwidth!')

        result = _get_place_photo(self.photo_reference,
                                  self._query_instance.api_key,
                                  maxheight=maxheight, maxwidth=maxwidth,
                                  sensor=sensor)

        self.mimetype, self.filename, self.data, self.url = result
21776
def _image_of_size(image_size):
  """"""
  return np.random.uniform(0, 256, [image_size, image_size, 3]).astype(np.uint8)
120112
def get_thumbnail_image(self, page=1):
        
        url = self.get_thumbnail_image_url(page=page)
        return self._get_url(url)
66839
def _getImageSize(filename):
    """"""
    result = None
    file = open(filename, 'rb')
    if file.read(8) == b'\x89PNG\r\n\x1a\n': # PNG
        while 1:
            length, = _struct.unpack('>i', file.read(4))
            chunkID = file.read(4)
            if chunkID == '': # EOF
                break
            if chunkID == b'IHDR':
                # return width, height
                result = _struct.unpack('>ii', file.read(8))
                break
            file.seek(4 + length, 1)
        file.close()
        return result
    file.seek(0)
    if file.read(8) == b'BM': # Bitmap
        file.seek(18, 0) # skip to size data
        result = _struct.unpack('<ii', file.read(8))
    file.close()
    return result
372201
def resize_by_area(img, size):
  """"""
  return tf.to_int64(
      tf.image.resize_images(img, [size, size], tf.image.ResizeMethod.AREA))
152813
def _thumbnail_local(self, original_filename, thumb_filename,
                         thumb_size, thumb_url, crop=None, bg=None,
                         quality=85):
        """"""

        # create folders
        self._get_path(thumb_filename)

        thumb_url_full = url_for('static', filename=thumb_url)

        # Return the thumbnail URL now if it already exists locally
        if os.path.exists(thumb_filename):
            return thumb_url_full

        try:
            image = Image.open(original_filename)
        except IOError:
            return ''

        img = self._thumbnail_resize(image, thumb_size, crop=crop, bg=bg)

        img.save(thumb_filename, image.format, quality=quality)

        return thumb_url_full
1121700
static function thumbnail($pic, $dst_pic, $max_width, $max_height = null, $qulitity = 100, $copy = true)
    {
        $im = self::readfile($pic);
        if ($im === false)
        {
            return false;
        }

        $old_w = imagesx($im);
        $old_h = imagesy($im);

        if ($max_height == null)
        {
            $max_height = $max_width;
        }

        if ($old_w > $max_width or $old_h > $max_height)
        {

            $w_h = $old_w / $old_h;
            $h_w = $old_h / $old_w;
            if ($w_h > $h_w)
            {
                $width = $max_width;
                $height = $width * $h_w;
            }
            else
            {
                $height = $max_height;
                $width = $height * $w_h;
            }
            $newim = imagecreatetruecolor($width, $height);
            imagecopyresampled($newim, $im, 0, 0, 0, 0, $width, $height, $old_w, $old_h);
            imagejpeg($newim, $dst_pic, $qulitity);
            imagedestroy($im);
            return true;
        }
        elseif ($pic != $dst_pic and $copy)
        {
            return copy($pic, $dst_pic);
        }
        else
        {
            return false;
        }
    }
29012
private function getThumbnail($fileName = null, $width = null, $height = null, $scale = null)
    {
        $thumb = new Thumbnail($this->config->get('general/thumbnails'));
        $thumb
            ->setFileName($fileName)
            ->setWidth($width)
            ->setHeight($height)
            ->setScale($scale)
        ;

        return $thumb;
    }
1308597
def large_image_url(self):
        """"""
        if self.application_id is None:
            return None

        try:
            large_image = self.assets['large_image']
        except KeyError:
            return None
        else:
            return 'https://cdn.discordapp.com/app-assets/{0}/{1}.png'.format(self.application_id, large_image)
1110176
def get_existing_thumbnail(self, thumbnail_options, high_resolution=False):
        
        thumbnail_options = self.get_options(thumbnail_options)
        names = [
            self.get_thumbnail_name(
                thumbnail_options, transparent=False,
                high_resolution=high_resolution)]
        transparent_name = self.get_thumbnail_name(
            thumbnail_options, transparent=True,
            high_resolution=high_resolution)
        if transparent_name not in names:
            names.append(transparent_name)

        for filename in names:
            exists = self.thumbnail_exists(filename)
            if exists:
                thumbnail_file = ThumbnailFile(
                    name=filename, storage=self.thumbnail_storage,
                    thumbnail_options=thumbnail_options)
                if settings.THUMBNAIL_CACHE_DIMENSIONS:
                    # If this wasn't local storage, exists will be a thumbnail
                    # instance so we can store the image dimensions now to save
                    # a future potential query.
                    thumbnail_file.set_image_dimensions(exists)
                return thumbnail_file