CommonTransformationTrait
trait CommonTransformationTrait
Trait TransformationTrait
Methods
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
Custom resize builder.
Applies delivery action.
Deliver the image in the specified device pixel ratio.
Delivers the image as an attachment.
Adds ICC color space metadata to the image, even when the original image doesn't contain any ICC data.
Instructs Cloudinary to clear all image meta-data (IPTC, Exif and XMP) while applying an incoming transformation.
Returns metadata of the input asset and of the transformed output asset in JSON instead of the transformed image.
Sets the cache-control to immutable for the asset.
Keeps the copyright related fields when stripping meta-data.
Keeps all meta-data.
Instructs Cloudinary to clear all ICC color profile data included with the image.
Inject a custom function into the image transformation pipeline.
Applies a filter or an effect on an asset.
Applies adjustment effect on an asset.
Applies a pre-defined named transformation of the given name.
Adds a generic qualifier as a separate action.
Adds action defined as an array of qualifiers.
Adds a flag as a separate action.
Rotates the asset by the given angle.
Specifies a conditional transformation whose condition should be met before applying a transformation.
Details
TransformationResizeTrait
resize(BaseResizeAction $resize)
Resize the asset using provided resize action
TransformationResizeTrait
scale(int|float|string|null $width = null, int|float|null $height = null, int|float|array $aspectRatio = null)
Change the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
TransformationResizeTrait
crop(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null, int|float|X $x = null, int|float|Y $y = null)
Extracts a region of the given width and height out of the original image.
TransformationResizeTrait
fill(int|float|string|null $width = null, int|float|null $height = null, Gravity $gravity = null)
Creates an image with the exact given width and height without distorting the image.
This option first scales up or down as much as needed to at least fill both of the given dimensions. If the requested aspect ratio is different than the original, cropping will occur on the dimension that exceeds the requested size after scaling.
TransformationResizeTrait
genericResize(string $name, int|float|string|null $width = null, int|float|null $height = null)
Custom resize builder.
TransformationDeliveryTrait
delivery(mixed $delivery)
Applies delivery action.
TransformationDeliveryTrait
format(Format|string $format)
Forces format conversion to the given format.
(Formerly known as fetch format)
TransformationDeliveryTrait
quality(int|string|Quality $quality)
Controls compression quality. 1 is the lowest quality and 100 is the highest.
Reducing the quality is a trade-off between visual quality and file size.
TransformationDeliveryTrait
dpr(float|string $dpr)
Deliver the image in the specified device pixel ratio.
CommonTransformationFlagTrait
attachment(string $filename = null)
Delivers the image as an attachment.
CommonTransformationFlagTrait
forceIcc()
Adds ICC color space metadata to the image, even when the original image doesn't contain any ICC data.
CommonTransformationFlagTrait
forceStrip()
Instructs Cloudinary to clear all image meta-data (IPTC, Exif and XMP) while applying an incoming transformation.
CommonTransformationFlagTrait
getInfo()
Returns metadata of the input asset and of the transformed output asset in JSON instead of the transformed image.
CommonTransformationFlagTrait
immutableCache()
Sets the cache-control to immutable for the asset.
CommonTransformationFlagTrait
keepAttribution()
Keeps the copyright related fields when stripping meta-data.
CommonTransformationFlagTrait
keepIptc()
Keeps all meta-data.
CommonTransformationFlagTrait
stripProfile()
Instructs Cloudinary to clear all ICC color profile data included with the image.
TransformationCustomFunctionTrait
customFunction(CustomFunction $customFunction)
Inject a custom function into the image transformation pipeline.
CommonTransformationTrait
effect(EffectQualifier|EffectAction $effect)
Applies a filter or an effect on an asset.
CommonTransformationTrait
adjust(EffectQualifier|EffectAction|AdjustmentInterface $adjustment)
Applies adjustment effect on an asset.
CommonTransformationTrait
namedTransformation(string|NamedTransformation $transformationName)
Applies a pre-defined named transformation of the given name.
CommonTransformationTrait
addGenericQualifier(string $shortName, array|mixed ...$value)
Adds a generic qualifier as a separate action.
CommonTransformationTrait
addActionFromQualifiers(array $qualifiers)
Adds action defined as an array of qualifiers.
CommonTransformationTrait
addFlag(FlagQualifier|string $flag)
Adds a flag as a separate action.
CommonTransformationTrait
addVariable(string|Variable $name, mixed $value = null)
Defines an new user variable.
CommonTransformationTrait
rotate(string|int $angle)
Rotates the asset by the given angle.
CommonTransformationTrait
conditional(Conditional $conditionalTransformation)
Specifies a conditional transformation whose condition should be met before applying a transformation.