| 157 | } |
| 158 | |
| 159 | func TestTransform_InvalidFormat(t *testing.T) { |
| 160 | src := newImage(2, 2, red, green, blue, yellow) |
| 161 | buf := new(bytes.Buffer) |
| 162 | if err := png.Encode(buf, src); err != nil { |
| 163 | t.Errorf("error encoding reference image: %v", err) |
| 164 | } |
| 165 | |
| 166 | _, err := Transform(buf.Bytes(), Options{Format: "invalid"}) |
| 167 | if err == nil { |
| 168 | t.Errorf("Transform with invalid format did not return expected error") |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | // Test that each of the eight EXIF orientations is applied to the transformed |
| 173 | // image appropriately. |