public function calculateWatermarkResolution($width, $height, $watermark, $handle)
    {
        $width = (int) str_replace('%', '', $width) / 100;
        $height = (int) str_replace('%', '', $height) / 100;

        $width_px = (int) round($handle->width() * $width);
        $height_px = (int) round($handle->height() * $height);

        return (object) [
            'width'  => $width_px,
            'height' => $height_px,
        ];
    }
public function calculateWatermarkResolution($width, $height, $watermark, $handle)
    {
        $width = (int) str_replace('%', '', $width) / 100;
        $height = (int) str_replace('%', '', $height) / 100;

        $width_px = (int) round($handle->width() * $width);
        $height_px = (int) round($handle->height() * $height);

        return (object) [
            'width'  => $width_px,
            'height' => $height_px,
        ];
    }
public function calculateWatermarkResolution ( $ width , $ height , $ watermark , $ handle ) { $ width = ( int ) str_replace ( '%' , '' , $ width ) / 100 ; $ height = ( int ) str_replace ( '%' , '' , $ height ) / 100 ; $ width_px = ( int ) round ( $ handle -> width ( ) * $ width ) ; $ height_px = ( int ) round ( $ handle -> height ( ) * $ height ) ; return ( object ) [ 'width' => $ width_px , 'height' => $ height_px , ] ; }
This function calculate what should be the thumbnail size.

@param string                            $width     Width in %
@param string                            $height    Height in %
@param \Intervention\Image\Facades\Image $watermark Handle to watermark
@param \Intervention\Image\Facades\Image $handle    Handle to image

@return object Object with width and height
This function calculate what should be the thumbnail size .