concrete/src/File/Type/Inspector/ImageInspector.php
private function updateSize(Version $fv, ImageInterface $image)
    {
        $result = false;
        try {
            $size = $image->getSize();
        } catch (Exception $x) {
            $size = null;
        } catch (Throwable $x) {
            $size = null;
        }
        if ($size !== null) {
            $attributeCategory = $fv->getObjectAttributeCategory();
            $atWidth = $attributeCategory->getAttributeKeyByHandle('width');
            if ($atWidth !== null) {
                $fv->setAttribute($atWidth, $size->getWidth());
            }
            $atHeight = $attributeCategory->getAttributeKeyByHandle('height');
            if ($atHeight !== null) {
                $fv->setAttribute($atHeight, $size->getHeight());
            }
            $result = true;
        }

        return $result;
    }
private function updateSize(Version $fv, ImageInterface $image)
    {
        $result = false;
        try {
            $size = $image->getSize();
        } catch (Exception $x) {
            $size = null;
        } catch (Throwable $x) {
            $size = null;
        }
        if ($size !== null) {
            $attributeCategory = $fv->getObjectAttributeCategory();
            $atWidth = $attributeCategory->getAttributeKeyByHandle('width');
            if ($atWidth !== null) {
                $fv->setAttribute($atWidth, $size->getWidth());
            }
            $atHeight = $attributeCategory->getAttributeKeyByHandle('height');
            if ($atHeight !== null) {
                $fv->setAttribute($atHeight, $size->getHeight());
            }
            $result = true;
        }

        return $result;
    }
private function updateSize ( Version $ fv , ImageInterface $ image ) { $ result = false ; try { $ size = $ image -> getSize ( ) ; } catch ( Exception $ x ) { $ size = null ; } catch ( Throwable $ x ) { $ size = null ; } if ( $ size !== null ) { $ attributeCategory = $ fv -> getObjectAttributeCategory ( ) ; $ atWidth = $ attributeCategory -> getAttributeKeyByHandle ( 'width' ) ; if ( $ atWidth !== null ) { $ fv -> setAttribute ( $ atWidth , $ size -> getWidth ( ) ) ; } $ atHeight = $ attributeCategory -> getAttributeKeyByHandle ( 'height' ) ; if ( $ atHeight !== null ) { $ fv -> setAttribute ( $ atHeight , $ size -> getHeight ( ) ) ; } $ result = true ; } return $ result ; }
Update the width and height attributes of the file version starting from the image data.

@param Version $fv
@param ImageInterface $image

@return bool true if success, false otherwise
Update the width and height attributes of the file version starting from the image data .