Returns an array of croppable size names
@return array
487556
public function getCroppableSizes() {
		return array(
			self::SIZE_LARGE,
			self::SIZE_MEDIUM,
			self::SIZE_SMALL,
			self::SIZE_TINY,
			self::SIZE_TOPBAR,
		);
	}
155862
public function imageSpecs(string $size): array
    {
        $specs = wp_get_additional_image_sizes();

        if ($size === 'thumbnail' && !isset($specs[$size])) {
            $width        = (int) get_option('thumbnail_size_w');
            $height       = (int) get_option('thumbnail_size_h');
            $crop         = (bool) get_option('thumbnail_crop');
            return $specs = compact('width', 'height', 'crop');
        }
        return $specs = $specs[$size] ?? [];
    }
1196772
public function getImageDimensions()
    {
        $dimension = $this->_getSetting('dimension');
        if ($this->getRow()->use_crop) {
            $parentDimension = $this->_getImageEnlargeComponent()->getImageDimensions();
            $dimension['crop'] = $parentDimension['crop'];
        }
        $data = $this->getImageData();
        return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);
    }
1237449
public function toArray()
    {
        $result = [];

        if (!empty($this->value)) {
            if (!empty($this->details)) {
                $parts = explode('.', $this->value);
                $result['value'] = join('.', array_slice($parts, 0, $this->details));
            } else {
                $result['value'] = $this->value;
            }
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->nickname)) {
            $result['nickname'] = $this->nickname;
        }

        if (isset($result['value']) && !isset($result['alias']) && !isset($result['nickname'])) {
            return $result['value'];
        }

        return $result;
    }
470430
def _get_cropped_file_names(self):
        """"""
        files = [ff.name for ff in self.files]
        prefix = commonprefix(files)
        suffix = commonprefix([f[::-1] for f in files])[::-1]
        cropped = [f[len(prefix):-len(suffix)] for f in files]
        return cropped
121461
public static function get_size_choices() {
        $options = array();
        for ($size = self::MIN_SIZE; $size <= self::MAX_SIZE; $size++) {
            $options[$size] = get_string('sitesize_' . $size, 'tool_generator');
        }
        return $options;
    }
4423
public function getDimensions(): array
    {
        if ($this->dimensions === null) {
            $this->dimensions = getimagesize($this->file->getPathname());
        }

        return $this->dimensions;
    }
994037
public function getBorderSize() {
		$t = $this->getBorderTopSize();
		$l = $this->getBorderLeftSize();
		$r = $this->getBorderRightSize();
		$b = $this->getBorderBottomSize();
		
		return array($t, $l, $r, $b);
	}
418674
public function getLogoDimensions()
    {
        // Initialise:
        
        $data = [];
        
        // Obtain Dimensions:
        
        $widths  = $this->dbObject('BrandLogoWidth');
        $heights = $this->dbObject('BrandLogoHeight');
        
        // Iterate Width Viewports:
        
        foreach ($widths->getViewports() as $viewport) {
            
            if ($value = $widths->getField($viewport)) {
                $data[$viewport]['Width'] = $value;
                $data[$viewport]['Breakpoint'] = $widths->getBreakpoint($viewport);
            }
            
        }
        
        // Iterate Height Viewports:
        
        foreach ($heights->getViewports() as $viewport) {
            
            if ($value = $heights->getField($viewport)) {
                $data[$viewport]['Height'] = $value;
                $data[$viewport]['Breakpoint'] = $heights->getBreakpoint($viewport);
            }
            
        }
        
        // Create Items List:
        
        $items = ArrayList::create();
        
        // Create Data Items:
        
        foreach ($data as $item) {
            $items->push(ArrayData::create($item));
        }
        
        // Answer Items List:
        
        return $items;
    }
430273
public function getButtonDimensions()
    {
        // Initialise:
        
        $data = [];
        
        // Obtain Dimensions:
        
        $sizes = $this->dbObject('ButtonSize');
        
        // Iterate Size Viewports:
        
        foreach ($sizes->getViewports() as $viewport) {
            
            if ($value = $sizes->getField($viewport)) {
                $data[$viewport]['Size'] = $value;
                $data[$viewport]['Breakpoint'] = $sizes->getBreakpoint($viewport);
            }
            
        }
        
        // Obtain Icon Dimensions:
        
        $iconSizes = $this->dbObject('IconSize');
        
        // Iterate Icon Size Viewports:
        
        foreach ($iconSizes->getViewports() as $viewport) {
            
            if ($value = $iconSizes->getField($viewport)) {
                $data[$viewport]['IconSize'] = $value;
                $data[$viewport]['Breakpoint'] = $iconSizes->getBreakpoint($viewport);
            }
            
        }
        
        // Create Items List:
        
        $items = ArrayList::create();
        
        // Create Data Items:
        
        foreach ($data as $item) {
            $items->push(ArrayData::create($item));
        }
        
        // Answer Items List:
        
        return $items;
    }
1203478
public function toArray()
    {
        $commands = array();

        $maybeAppend = function ($command) use (&$commands) {
            if ($command) $commands []= (string) $command;
        };

        if ($this->metadataOnly) {
            $commands []= 'meta';
        }

        $maybeAppend($this->trim);
        $maybeAppend($this->crop);
        $maybeAppend($this->resize);
        $maybeAppend($this->halign);
        $maybeAppend($this->valign);

        if ($this->smartCrop) {
            $commands []= 'smart';
        }

        if (count($this->filters)) {
            $filters = 'filters:' . implode(':', $this->filters);
            $commands []= $filters;
        }

        return $commands;
    }
398731
public static function get_image_sizes()
    {
        global $_wp_additional_image_sizes;

        $sizes = [];

        $dynamic_sizes = Size_Manager::get_dynamic_sizes();

        foreach (\get_intermediate_image_sizes() as $size) {
            if (\in_array($size, ['thumbnail', 'medium', 'medium_large', 'large'])) {
                $sizes[ $size ] = [
                    'width' => \get_option("{$size}_size_w"),
                    'height' => \get_option("{$size}_size_h"),
                    'crop' => (bool) \get_option("{$size}_crop"),
                    'generated_on_upload' => ! \in_array($size, $dynamic_sizes),
                ];
            }

            if (isset($_wp_additional_image_sizes[ $size ])) {
                $sizes[ $size ] = [
                    'width'  => $_wp_additional_image_sizes[ $size ]['width'],
                    'height' => $_wp_additional_image_sizes[ $size ]['height'],
                    'crop'   => $_wp_additional_image_sizes[ $size ]['crop'],
                    'generated_on_upload' => ! \in_array($size, $dynamic_sizes),
                ];
            }
        }

        return $sizes;
    }
681651
public function getSize()
    {
        $command = $this->driver->factoryCommand(
            'window/' . $this->windowHandle . '/size',
            WebDriver_Command::METHOD_GET
        );
        $value = $this->driver->curl($command)['value'];
        return ['height' => $value['height'], 'width' => $value['width']];
    }
237367
public function getWidths(): array
    {
        $columns = $this->getColumns();
        $values  = ['equal', 'variable', 'null'];
        $values  = array_merge($values, range(1, $columns));

        return array_combine($values, $values);
    }
84347
public function toArray()
    {
        return array(
            'filter' => $this->getFilter(),
            'width' => $this->getWidth(),
            'height' => $this->getHeight(),
            'percent' => $this->getPercent(),
            'dummy' => $this->getDummy(),
            'border' => $this->getBorder(),
            'layer' => $this->getLayer(),
            'quality' => $this->getQuality(), 
            'crop' => $this->getCrop(),
            'x' => $this->getX(),
            'y' => $this->getY(),
            'rotate' => $this->getRotate(),
            'gravity' => $this->getGravity(), 
            'extension' => $this->getExtension(),
            'filename' => $this->getFilename(),
        );
    }
902424
public function getPermittedDimensions(): array
    {
        $aDimensions = array_map(function ($sDimension) {
            return (object) array_combine(
                ['width', 'height'],
                array_map('intval', explode('x', $sDimension))
            );
        }, $this->aPermittedDimensions);

        arraySortMulti($aDimensions, 'width');

        return array_values($aDimensions);
    }
217742
public function getCropDimensions() {
		$x = $this->getCropX();
		$y = $this->getCropY();
		$cropWidth = $this->getCropWidth();
		$cropHeight = $this->getCropHeight();
		$width = $cropWidth;
		$height = $cropHeight;

		// Normalise the width/height with respect to the aspect ratio
		$maxWidth = $this->getMaxWidth();
		$maxHeight = $this->getMaxHeight();

		$aspectRatio = $this->getAspectRatio();


		if($width < 1 || $height < 1) {
			throw new \InvalidArgumentException('Values must be over 1');
		}

		// Fix the aspect ratio if the crop is wrong
		// This must happen first so invalid values can be compensated for
		if($width / $height != $aspectRatio) {
			$height = $width / $aspectRatio;
		}

		if($width > $maxWidth) {
			$scaleDownRatio = $cropWidth / $maxWidth;
			$height = $height / $scaleDownRatio;
			$width = $maxWidth;
		}

		if($height > $maxHeight) {
			$scaleDownRatio = $cropHeight / $maxHeight;
			$width = $width / $scaleDownRatio;
			$height = $maxHeight;
		}

		return array(
			// src_x, src_y
			'x' => $x,
			'y' => $y,
			// dst_w, dst_h
			'width' => ceil($width),
			'height' => ceil($height),
			// src_w, src_h
			'crop_width' => $cropWidth,
			'crop_height' => $cropHeight,
		);
	}