Hello Felix,
Fantastic. Here's some more information about the `FileuploadFieldValue::resize()` method. It returns a URL (string) to the image sized/cropped to the specified dimension. Width and height of the target size are the the first and second arguments. With the third parameter you can define the quality of the image (deprecated) – set it to null (instead, you can specify the quality of the image with options).
The fourth parameter $type determines the type of function to be used. By default it is 'resize', allowed also 'resizePercent', 'adaptiveResize', 'cropFromCenter', 'crop', 'rotateImage'.
The 5th parameter is an array of GD options:
(2020-08-18, 03:10:33)Felix Wrote: Which works nice.
Fantastic. Here's some more information about the `FileuploadFieldValue::resize()` method. It returns a URL (string) to the image sized/cropped to the specified dimension. Width and height of the target size are the the first and second arguments. With the third parameter you can define the quality of the image (deprecated) – set it to null (instead, you can specify the quality of the image with options).
Code:
$image->resize(100, 200, null, ...
The fourth parameter $type determines the type of function to be used. By default it is 'resize', allowed also 'resizePercent', 'adaptiveResize', 'cropFromCenter', 'crop', 'rotateImage'.
The 5th parameter is an array of GD options:
Code:
$options = [
'resizeUp' => false,
'jpegQuality' => 100,
'pngQuality' => 1,
'correctPermissions' => false,
'preserveAlpha' => true,
'alphaMaskColor' => array (255, 255, 255),
'preserveTransparency' => true,
'transparencyMaskColor' => array (0, 0, 0)
]