Returns an array of the width and height of the current instance's image $type and $size

@param $type
@param $size
@return array
492284
protected function getImageDimensions($type, $size)
	{
		$pathToImage = public_path($this->getImageConfig($type, $size, 'dir') . $this->$type);
		if (is_file($pathToImage) && file_exists($pathToImage))
		{
			list($width, $height) = getimagesize($pathToImage);
		}
		else
		{
			$width = $height = false;
		}
		return array($width, $height);
	}
288183
public static function getImageDimensions($width=false, $height=false) {

		$max_width  = config('center.img.max.width');
		$max_height = config('center.img.max.height');
		$max_area   = config('center.img.max.area');

		//too wide?
		if ($width && $width > $max_width) {
			if ($height) $height *= $max_width / $width;
			$width = $max_width;
		}

		//too tall?
		if ($height && $height > $max_height) {
			if ($width) $width *= $max_height / $height;
			$height = $max_height;
		}

		//not specified?
		if (!$width) $width = config('center.img.default.width');
		if (!$height) $height = config('center.img.default.height');

		//too large?
		$area = $width * $height;
		if ($width * $height > $max_area) {
			$width *= $max_area / $area;
			$height *= $max_area / $area;
		}

		return array($width, $height);
	}
830619
public function url($size)
    {

        return $this->img_server . '/' . $this->type . '/' . $this->id .
            '_' . $size . '.' . $this->extension;

    }
1073663
public function imageGetIntermediateSize($data, $post_id, $size) {
	    $result = $this->buildImgixImage($post_id, $size);

	    if (is_array($result) && !empty($result)) {
            $data['url'] = $result[0];
        }

		return $data;
	}
623167
public static function calculate(string $type, string $size, string $payload): string
    {
        $crc = $type ^ $size;

        if (!empty($payload)) {
            foreach (str_split($payload) as $payloadByte) {
                $crc = $crc ^ $payloadByte;
            }
        }

        return $crc;
    }
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;
	}
795022
public function getThumbnailRaw(int $size = 210, string $type = 'default')
    {
        $thumbUrl = $this->safeGet('thumbnail')[0]['_link'];
        $thumbnailParts = explode('/', $thumbUrl);

        return "{$thumbnailParts[0]}//{$thumbnailParts[2]}/thumbnail/b/$size/{$this->getId()}/$type.jpg";
    }
1013021
public static function get_image_width($size)
    {
        // Get the size meta array.
        $size = static::get_image_size($size);

        if ($size === false) {
            return false;
        }

        if (isset($size['width'])) {
            return (int) $size['width'];
        }

        return false;
    }
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 '';
    }
96520
public function getImages($type = null)
    {
        if ($type) {
            if (! isset($this->imagesOfType[$type])) {
                if (count($this->images)) {
                    $this->imagesOfType[$type] = $this->images->where('image_type', $type);
                } else {
                    $this->imagesOfType[$type] = collect([]);
                }
            }

            return $this->imagesOfType[$type];
        }

        return $this->images;
    }
487175
public function getSize()
    {
        if (!$this->size && $this->isAttached() === true) {
            if (!\is_resource($this->stream)) {
                throw new \TypeError();
            }
            $stats = \fstat($this->stream);
            /** @var int|null size */
            $this->size = isset($stats['size']) && !$this->isPipe() ? (int) $stats['size'] : null;
        }

        return $this->size;
    }
1102686
function getsize($size)
    {
        $last = strtolower($size{strlen($size) - 1});
        switch ($last) {
            case 'g':
                $size *= 1024;
            case 'm':
                $size *= 1024;
            case 'k':
                $size *= 1024;
        }

        return $size;
    }
817969
public function get_url( $size ) {
		$url = null;
		if ( isset( $this->struct['return_type'] ) && 'url' === $this->struct['return_type'] ) {
			$url = $this->get_value();
		} else {
			$data = wp_get_attachment_image_src( $this->get_value(), $size );
			if ( ! empty( $data ) ) {
				$url = $data[0];
			}
		}

		return $url;
	}
301651
public static function getSize( $size )
    {
        $dim = [];
        if( is_array( $size ) )
        {
            $dim[ 'w' ] = $size[0];
            $dim[ 'h' ] = isset( $size[1] ) ? $size[1] : $size[0];
        }
        else
        {
            $dim[ 'w' ] = $size;
            $dim[ 'h' ] = null;
        }

        return $dim;
    }
413034
public function resize(
        $imageData,
        $height,
        $width,
        $type = ElcodiMediaImageResizeTypes::FORCE_MEASURES
    ) {
        $originalResource = imagecreatefromstring($imageData);
        $originalWidth = imagesx($originalResource);
        $originalHeight = imagesy($originalResource);
        $dimensions = Dimensions::create(
            $originalWidth,
            $originalHeight,
            $width,
            $height,
            $type
        );

        $newResource = imagecreatetruecolor(
            $dimensions->getDstFrameX(),
            $dimensions->getDstFrameY()
        );

        $backgroundColor = imagecolorallocate($newResource, 255, 255, 255);
        imagefill($newResource, 0, 0, $backgroundColor);

        imagecopyresampled(
            $newResource,
            $originalResource,
            $dimensions->getDstX(),
            $dimensions->getDstY(),
            $dimensions->getSrcX(),
            $dimensions->getSrcY(),
            $dimensions->getDstWidth(),
            $dimensions->getDstHeight(),
            $dimensions->getSrcWidth(),
            $dimensions->getSrcHeight()
        );

        ob_start();
        imagejpeg($newResource);
        $content = ob_get_contents();
        ob_end_clean();

        return $content;
    }
32183
public function size( $size ) {
		$this->width  = (int) $size;
		$this->height = (int) $size;

		return $this;
	}
115688
public function getBoxSize(array $imageSize, array $size)
    {
        list($width, $height) = $size;

        if ((null == $width) && (null == $height)) {
            return $imageSize;
        }

        list($imageWidth, $imageHeight) = $imageSize;

        if ((null !== $width) && (null == $height)) {
            $height = ceil($width * ($imageHeight / $imageWidth));

            if ($height > $imageHeight) {
                $height = $imageHeight;
            }

            return array($width, $height);
        }

        if ((null === $width) && (null != $height)) {
            $width = ceil($height * ($imageWidth / $imageHeight));

            if ($width > $imageWidth) {
                $width = $imageWidth;
            }

            return array($width, $height);
        }

        return $size;
    }