Closed kduma closed 11 months ago
Another problem is that with watermarkWidth
or watermarkHeight
we could pass a percentage for Example: 20%
which translates to having a watermark with a width equal to 20%
of the base image.
That is super useful but I didn't find any solution like it in the V11
We'll handle this further in #218
Hello,
Due to removal of
watermarkOpacity
,watermarkPadding
,watermarkHeight
andwatermarkWidth
methods inspatie/image:v3.0.0
, there is an inability to easily upgrade conversion such as following one:While
watermarkPosition(Manipulations::POSITION_BOTTOM_RIGHT)
method translates toposition: AlignPosition::BottomRight
,watermarkPadding(10)
translates tox: 10, y: 10
, there is no easy way to translatewatermarkHeight(110)
into something else. According tospatie/image
docs on watermark, the correct way to apply additional modifications (like resizing) to watermark, is to load and modify the watermark file usingImage
class, like that:Besides that it is not working (as it throws an error
Typed property Spatie\Image\Drivers\Imagick\ImagickDriver::$image must not be accessed before initialization
), it is bad from the optimisation standpoint as theregisterMediaConversions
method is called every time a conversion is loaded.The best solution I could get is to prepare a logo file for each watermark size, and use prepared files. Is there another way to do that?