Get expected dimensions of processed image
@return array
543191
public function getExpectedSize($round = true)
	{
		if (empty($this->sourceFilename)) {
			throw new ImageProcessorException('Source image is not set');
		}
		if (empty($this->targetWidth) || ($this->targetWidth <= 0)) {
			throw new ImageProcessorException('Target width is not set or is invalid');
		}
		if (empty($this->targetHeight) || ($this->targetHeight <= 0)) {
			throw new ImageProcessorException('Target height is not set or is invalid');
		}

		$imageInfo = $this->getImageInfo($this->sourceFilename);

		$wRatio = max($imageInfo->getWidth() / $this->targetWidth, 1);
		$hRatio = max($imageInfo->getHeight() / $this->targetHeight, 1);

		if ( ! $this->cropMode) {
			$wRatio = $hRatio = max($wRatio, $hRatio);
		}

		$dimensions = array(
			'width' => $imageInfo->getWidth() / $wRatio,
			'height' => $imageInfo->getHeight() / $hRatio,
		);

		if ($round) {
			$dimensions = array_map('round', $dimensions);
		}

		return $dimensions;
	}
1201414
public function getResizedImageInfo()
    {
        $fileInfo = null;
        if ($this->newFile === true) {
            $asset = $this->assetRepo->createAsset(
                "Limesharp_Stockists::images/".$this->entityCode."/placeholder/{$this->getDestinationSubdir()}.jpg"
            );
            $img = $asset->getSourceFile();
            $fileInfo = getimagesize($img);
        } else {
            if ($this->mediaDirectory->isFile($this->mediaDirectory->getAbsolutePath($this->newFile))) {
                $fileInfo = getimagesize($this->mediaDirectory->getAbsolutePath($this->newFile));
            }
        }
        return $fileInfo;
    }
688051
public function getImages()
    {
        $images = array();

        $nodes = $this->html->findTags('img');
        foreach ($nodes as $node) {
            $source = trim($node->getAttribute('src'));

            if (empty($source)) {
                continue;
            }

            $url = $this->getAbsoluteUrl($source);
            $size = $this->getImageSize($url);

            if (is_array($size)) {
                list($width, $height) = $size;
            } else {
                continue;
            }

            if ($this->isImageAccepted($url, $width, $height)) {
                $images[] = array(
                    'url'    => $url,
                    'width'  => $width,
                    'height' => $height,
                    'area'   => ($width * $height)
                );
            }
        }

        return $images;
    }
334581
public function getRootTotalSize() {
        $path = rtrim($this->path_to_files, '/') . '/';
        $result = $this->getDirSummary($path);
        return $result['size'];
    }
5863
public function getImageSize($Image = null) {
		$Image = $this->_getImage($Image);
		$BoxInterface = $Image->getSize($Image);
		return [
			$BoxInterface->getWidth(),
			$BoxInterface->getHeight(),
			'x' => $BoxInterface->getWidth(),
			'y' => $BoxInterface->getHeight()
		];
	}
1172822
public function getImageDimensions()
    {
        $dimension = $this->getData()->chained->getComponent()->_getSetting('dimension');
        if ($this->getData()->chained->getComponent()->getRow()->use_crop) {
            $parentDimensions = $this->_getImageEnlargeComponent()->getImageDimensions();
            $dimension['crop'] = $parentDimensions['crop'];
        }
        $data = $this->getImageData();
        return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);
    }
1001282
public function getDimension() {
        $w = imagefontwidth($this->font) * strlen($this->text);
        $h = imagefontheight($this->font);

        $rotationAngle = $this->getRotationAngle();
        if ($rotationAngle === 90 || $rotationAngle === 270) {
            return array($h, $w);
        } else {
            return array($w, $h);
        }
    }
766773
protected function getSourceImageDimensions($source): array
    {
        if ($source instanceof Asset) {
            return [$source->getWidth(), $source->getHeight()];
        }

        if ($this->profileConfig !== null && $this->profileConfig->getExternalImageDimensions) {
            $sourceModel = new LocalSourceImageModel($source);
            $sourceModel->getLocalCopy();

            $sourceImageInfo = @getimagesize($sourceModel->getFilePath());

            return [$sourceImageInfo[0], $sourceImageInfo[1]];
        }

        return [0, 0];
    }
1007113
public function getBannerImageSizes()
    {
        $sizes = array();
        $imageSize = $this->Database
                            ->prepare("SELECT id, name, width, height FROM tl_image_size ORDER BY pid, name")
                            ->execute(\Input::get('id'));
        while ($imageSize->next())
        {
            $sizes[$imageSize->id] = $imageSize->name;
            $sizes[$imageSize->id] .= ' (' . $imageSize->width . 'x' . $imageSize->height . ')';
        }
        return array_merge(array('image_sizes'=>$sizes), $GLOBALS['TL_CROP']);
    }
268220
def dimensions(self):
        
        return ImageDimensions(self._info.file.width, self._info.file.height)
384884
public function getAcceptImageMimeTypes()
    {
        $imageAllowFiles = $this->getSetting('imageAllowFiles');
        $extensions = explode(',', $imageAllowFiles);
        array_walk($extensions, function (&$value) {
            $value = 'image/' . $value;
        });
        return $extensions;
    }
248877
public function getInfo() : array
    {
        if ($this->processed === true) {
            return [
                'canvas' => [
                    'width' => $this->canvas['width'],
                    'height' => $this->canvas['height'],
                    'color' => $this->canvas['color']
                ],
                'resized-image' => [
                    'width' => $this->intermediate['width'],
                    'height' => $this->intermediate['height']
                ],
                'canvas-placement' => [
                    'x' => $this->canvas['spacing']['x'],
                    'y' => $this->canvas['spacing']['y']
                ],
                'resizer' => [
                    'maintain-aspect-ratio' => $this->intermediate['maintain_aspect'],
                    'quality' => $this->canvas['quality']
                ]
            ];
        } else {
            throw new \Exception(Helper::ERROR_CALL_GETINFO);
        }
    }
1216536
def get_image_sizes(image):
    """"""

    # It is possible to have the same width appear more than once, if
    # THUMBNAIL_UPSCALE is set to False and the image's width is less than the
    # largest value in FLEXIBLE_IMAGE_SIZES. So keep track of widths and
    # don't output more than one image with the same width (which would result
    # in an invalid `srcset` attribute).
    sizes = []
    seen_widths = []

    for size in settings_sizes():
        img = get_thumbnail_shim(image, size)

        if img.width in seen_widths:
            continue

        seen_widths.append(img.width)

        sizes.append({
            "url": img.url,
            "width": img.width,
            "height": img.height,
        })
    return sizes
60827
private Dimension getImageDimension() {
    Dimension dimension = null;

    // check for cropping dimension
    if (this.media.getCropDimension() != null) {
      dimension = this.media.getCropDimension();
    }
    else {
      // if binary is image try to calculcate dimensions by loading it into a layer
      Layer layer = this.resource.adaptTo(Layer.class);
      if (layer != null) {
        dimension = new Dimension(layer.getWidth(), layer.getHeight());
      }
    }

    return dimension;
  }
680027
protected function getDimensionsForUnixLike(): ?array
	{
		// Attempt to get dimensions from environment

		if(($width = getenv('COLUMNS')) !== false && ($height = getenv('LINES')) !== false)
		{
			return ['width' => (int) $width, 'height' => (int) $height];
		}

		// Attempt to get dimensions from stty

		exec('stty size', $output, $status);

		if($status === 0 && preg_match('/^([0-9]+) ([0-9]+)$/', current($output), $matches))
		{
			return ['width' => (int) $matches[2], 'height' => (int) $matches[1]];
		}

		// All attempts failed so we'll just return null

		return null;
	}
998847
private function getThemeImageSizes()
    {
        $dataProvider = new DefaultDataProvider();
        $dataProvider->setBaseConfig(['source' => 'tl_image_size']);

        $config = $dataProvider->getEmptyConfig();
        $config->setFields(['id', 'name', 'width', 'height']);
        $config->setSorting(['pid', 'name']);

        $collection = $dataProvider->fetchAll($config);
        if (!$collection->count()) {
            return [];
        }

        $sizes = [];
        foreach ($collection as $model) {
            $sizes[$model->getProperty('id')] = sprintf(
                '%s (%sx%s)',
                $model->getProperty('name'),
                $model->getProperty('width'),
                $model->getProperty('height')
            );
        }

        return $sizes;
    }
434327
protected function getImageSizeList()
	{
		$arrSizes = \System::getContainer()->get('contao.image.image_sizes')->getAllOptions();

		if (is_array($arrList = \StringUtil::deserialize($this->sizeList)))
		{
			$arrSizes['image_sizes'] = array_intersect_key($arrSizes['image_sizes'], array_flip($arrList));
		}
		else
		{
			$arrSizes['image_sizes'] = array();
		}

		if ($this->canEnterSize)
		{
			return $arrSizes;
		}
		
		return $arrSizes['image_sizes'];
	}