From 1236b6346f1a5333783f29be78739bd63d195aca Mon Sep 17 00:00:00 2001 From: Dave Bevan Date: Fri, 12 Apr 2019 18:25:28 +0100 Subject: [PATCH] Add SaveJPG method --- context.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/context.go b/context.go index 427406e..2ca48a8 100644 --- a/context.go +++ b/context.go @@ -140,6 +140,11 @@ func (dc *Context) SavePNG(path string) error { return SavePNG(path, dc.im) } +// SaveJPG encodes the image as a JPG and writes it to disk. +func (dc *Context) SaveJPG(path string, quality int) error { + return SaveJPG(path, dc.im, quality) +} + // EncodePNG encodes the image as a PNG and writes it to the provided io.Writer. func (dc *Context) EncodePNG(w io.Writer) error { return png.Encode(w, dc.im)