Merge pull request #70 from bevand10/master

Add SaveJPG method
This commit is contained in:
Michael Fogleman 2019-04-16 21:28:22 -04:00 committed by GitHub
commit 5899172fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,11 @@ func (dc *Context) SavePNG(path string) error {
return SavePNG(path, dc.im) 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. // EncodePNG encodes the image as a PNG and writes it to the provided io.Writer.
func (dc *Context) EncodePNG(w io.Writer) error { func (dc *Context) EncodePNG(w io.Writer) error {
return png.Encode(w, dc.im) return png.Encode(w, dc.im)