Get width and height for an image size.

@param array $img_size Image size configuration array.
@return array Width and height.
517086
public static function get_dimensions_for_size( $img_size ) {
		$width  = absint( $img_size['resize'][0] );
		$height = isset( $img_size['resize'][1] ) ? absint( $img_size['resize'][1] ) : 0;

		return array( $width, $height );
	}
118168
public static function getImageSize( string $size = 'thumbnail') {
		$sizes = self::getImageSizes();
		$size  = key_exists( $size, $sizes ) ? $size : 'thumbnail';

		return $sizes[ $size ];
	}
242335
public function getImage($type, $size, array $attributes = array())
	{
		if (empty($this->$type))
		{
			return null;
		}
		$html = '<img src="' . $this->getImageSrc($type, $size) . '"';
		$html .= ' alt="' . $this->{$type.'_alt'} . '"';
		$html .= ' width="' . $this->getImageWidth($type, $size) . '"';
		$html .= ' height="' . $this->getImageHeight($type, $size) . '"';
		
		$html_attributes = '';
		if (!empty($attributes)) {
			$html_attributes = join(' ', array_map(function($key) use ($attributes) {
				if(is_bool($attributes[$key]))
				{
					return $attributes[$key] ? $key : '';
				}
				return "{$key}=\"{$attributes[$key]}\"";
			}, array_keys($attributes)));
		}
		
		return $html;
	}
895159
protected function getImageSize($width, $height)
    {
        $min = min($width, $height);

        // if one value is zero, we have to calculate the right
        // value using the image aspect raion
        if (0 === $min) {

            // if both hight and widh are zero we assume
            // that the image is not resized at all
            if (0 === max($width, $height)) {
                extract($this->getInfo());
            } else {
                $ratio = $this->getInfo('ratio');
            }

            $width  = $width  === 0 ? (int) floor($height * $ratio) : $width;
            $height = $height === 0 ? (int) floor($width  / $ratio) : $height;
        }

        return compact('width', 'height');
    }
195208
def extract_image_size(self):
        '''
        
        '''
        width, _ = self._extract_alternative_fields(
            ['Image ImageWidth', 'EXIF ExifImageWidth'], -1, int)
        height, _ = self._extract_alternative_fields(
            ['Image ImageLength', 'EXIF ExifImageLength'], -1, int)
        return width, height
65666
public function sizeUrl($size)
    {
        if (($this->base['return_format'] === 'array') && isset($this->base['value']['sizes'][$size])) {
            return $this->base['value']['sizes'][$size];
        } elseif ($this->base['return_format'] === 'id') {
            if ($src = wp_get_attachment_image_src($this->id(), $size)) {
                return $src[0];
            }
        }

        return '';
    }
1017838
public static function get_image_size( $size ) {
		// Check for a directly passed image configuration array.
		if ( is_array( $size ) ) {
			return $size;
		}

		$sizes = self::get_image_sizes();

		// Return found image size.
		if ( isset( $sizes[ $size ] ) ) {
			return $sizes[ $size ];
		}

		self::notice( "Image size \"{$size}\" does not exist in your image configuration." );

		return false;
	}
795007
private static int getTrimmedWidth(BufferedImage img) {
    int height = img.getHeight();
    int width = img.getWidth();
    int trimmedWidth = 0;

    for (int i = 0; i < height; i++) {
      for (int j = width - 1; j >= 0; j--) {
        if (img.getRGB(j, i) != Color.WHITE.getRGB() && j > trimmedWidth) {
          trimmedWidth = j;
          break;
        }
      }
    }

    return trimmedWidth;
  }
1135004
public function getImageWidth($image): ?string
    {
        if (null === ($file = $this->container->get('huh.utils.file')->getFileFromUuid($image))) {
            return null;
        }

        return $file->width;
    }
492888
public function getMetaImageResizeHeight($height = null)
    {
        if ($height) {
            return $height;
        }
        
        if ($height = $this->owner->ImageMetaResizeHeight) {
            return $height;
        }
        
        return $this->owner->getFieldFromParent('DefaultImageResizeHeight');
    }
4246
public static function getInfo(/*mixed*/ $image) {
    if(
      is_string($image) &&
      false !== ($info = getimagesizefromstring($image)) &&
      !!($width = $info[0]) && !!($height = $info[1])
    ) {
      $result = imagecreatefromstring($image);
    } else if(
      is_resource($image) &&
      !!($width = imagesx($image)) && !!($height = imagesy($image))
    ) {
      $result = $image;
    } else {
      return false;
    }
    return [
      'image' => $result,
      'width' => $width,
      'height' => $height
    ];
  }
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
1092219
private function getImageWidth(Image $image, int $height): int
    {
        return (int)($height * ($image->getWidth() / $image->getHeight()));
    }
291445
private function getAdjustedImageCropDimensions(
        Image $image,
        int $width,
        int $height,
        bool $relative = false
    ): array {
        $w = $image->getWidth() / $width;
        $h = $image->getHeight() / $height;

        if ($w < 1 || $h < 1) {
            if ($w < $h) {
                return [
                    'width' => $width * $w,
                    'height' => $height * $w,
                ];
            } else {
                return [
                    'width' => $width * $h,
                    'height' => $height * $h,
                ];
            }
        } else {
            if ($w < $h) {
                return [
                    'width' => $width * (true === $relative ? $w : 1),
                    'height' => $height * (true === $relative ? $w : 1),
                ];
            } else {
                return [
                    'width' => $width * (true === $relative ? $h : 1),
                    'height' => $height * (true === $relative ? $h : 1),
                ];
            }
        }
    }
172180
def image_shape(img):
    ''''''
    if hasattr(img, 'shape'):
        return (img.shape[1], img.shape[0])
    return (img.width, img.height)
47213
public function &GetImageSizeObject()
    {
        if (is_null($this->oImageSize)) {
            $this->oImageSize = TdbShopArticleImageSize::GetNewInstance();
            if (!$this->oImageSize->Load($this->sqlData['shop_article_image_size_id'])) {
                $this->oImageSize = null;
            }
        }

        return $this->oImageSize;
    }
388898
public function get_image_width()
	{
		if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width'))
		{
			return round($return[0]['data']);
		}
		elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
		{
			return 88.0;
		}

		return null;
	}