feat: add format setting for completion

This commit is contained in:
Antoine Aflalo
2024-08-27 08:51:35 -04:00
parent eec6fe91dd
commit 01e5c78369
6 changed files with 65 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ type Converter struct {
}
func (converter *Converter) Format() (format constant.ConversionFormat) {
return constant.ImageFormatWebP
return constant.WebP
}
func New() *Converter {
@@ -203,8 +203,8 @@ func (converter *Converter) convertPage(container *packer2.PageContainer, qualit
return container, nil
}
// convert converts an image to the ImageFormatWebP format. It decodes the image from the input buffer,
// encodes it as a ImageFormatWebP file using the webp.Encode() function, and returns the resulting ImageFormatWebP
// convert converts an image to the WebP format. It decodes the image from the input buffer,
// encodes it as a WebP file using the webp.Encode() function, and returns the resulting WebP
// file as a bytes.Buffer.
func (converter *Converter) convert(image image.Image, quality uint) (*bytes.Buffer, error) {
var buf bytes.Buffer