Skip to content

berry.utils.ImageHelper

Nikos Siatras edited this page Jan 6, 2024 · 5 revisions

ImageHelper.ConvertImageToWebP

Description

public function ConvertImageToWebP(string $source, int $quality = 100, bool $removeOld = false): string

This function converts .jpg, .png and .gif format images into .webp

Parameters

  • $source is the the source image path to convert
  • $quality ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file)
  • $removeOld set to true if you want to delete the original file
Clone this wiki locally