Devise\Pages\Fields\Handlers\ImageFieldUpdated::resizedImagePath PHP Method

resizedImagePath() protected method

Create a version of this thumbnail, crops too when $crop is set to true
protected resizedImagePath ( Field $field, $width, $height ) : string
$field Field
return string
    protected function resizedImagePath($field, $width, $height)
    {
        // get the parts for this file string
        $info = $this->MediaPaths->fileVersionInfo($field->values->image);
        // create resizedImagePath
        $resizedImagePath = "{$info->versiondir}/{$info->filename}_{$width}_{$height}.{$info->ext}";
        // resize the versioned image
        $image = $this->Images->resizeImage($info->filepath, $width, $height);
        // save this resized image
        $this->Images->saveImage($image, $resizedImagePath);
        // remove temporary image file if there is one
        if ($info->tempfile) {
            unlink($info->tempfile);
        }
        // finally return this image path as a string so we can store it
        return $this->MediaPaths->makeRelativePath($resizedImagePath);
    }