Skip to content

Commit

Permalink
Add documentation inspired by jpeg.Encode to jfif.Encode
Browse files Browse the repository at this point in the history
  • Loading branch information
leotaku committed Sep 4, 2023
1 parent a73a078 commit f2230eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jfif/jfif.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ var naiveJFIFHeader = []byte{
0x00, 0x00, // No Thumbnail
}

func Encode(w io.Writer, img image.Image, o *jpeg.Options) error {
// Encode writes the Image m to w in JFIF 1.02 compatible format with
// the given options. The JFIF header cannot be configured.
func Encode(w io.Writer, m image.Image, o *jpeg.Options) error {
buf := bytes.NewBuffer(nil)
err := jpeg.Encode(buf, img, o)
err := jpeg.Encode(buf, m, o)
if err != nil {
return err
}
Expand Down

0 comments on commit f2230eb

Please sign in to comment.