func TestNetpbmDecodePlainPBMPPMOpts(t *testing.T) {
	r := flate.NewReader(bytes.NewBufferString(pbmPlain))
	defer r.Close()
	img, err := Decode(r, &DecodeOptions{
		Target: PPM,
		Exact:  false,
	})
	if err != nil {
		t.Fatal(err)
	}
	if img.Format() != PPM {
		t.Fatalf("Expected PPM but received %s", img.Format())
	}
}
TestNetpbmDecodePlainPBMPPMOpts determines if netpbm.Decode can decode a
plain PBM file with PPM options.
package netpbm
import (
	"bytes"
	"compress/flate"
	"testing"
)
func TestNetpbmDecodePGMPPMOpts(t *testing.T) {
	r := flate.NewReader(bytes.NewBufferString(pgmRaw))
	defer r.Close()
	img, err := Decode(r, &DecodeOptions{
		Target: PPM,
		Exact:  false,
	})
	if err != nil {
		t.Fatal(err)
	}
	if img.Format() != PPM {
		t.Fatalf("Expected PPM but received %s", img.Format())
	}
}
func TestDecodePBMEncodePPM(t *testing.T) {
	var w bytes.Buffer
	img := imageFromString(t, pbmRaw, PBM)
	opts := &EncodeOptions{Format: PPM}
	err := Encode(&w, img, opts)
	if err != nil {
		t.Fatal(err)
	}
}
func TestDecodePGMEncodePPM(t *testing.T) {
	var w bytes.Buffer
	img := imageFromString(t, pgmRaw, PGM)
	opts := &EncodeOptions{Format: PPM}
	err := Encode(&w, img, opts)
	if err != nil {
		t.Fatal(err)
	}
}