webp: fix tests for webp/nycbcra deprecation.

The previous commit (00fe24ef "webp/nycbcra: deprecate package") was
incomplete.

Change-Id: I6af5e1633b9c291e72b02877b308eae6e5624ef5
Reviewed-on: https://go-review.googlesource.com/21441
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
Nigel Tao 2016-04-02 12:00:09 +11:00
parent 00fe24ef7b
commit 0ebebfd658
2 changed files with 4 additions and 7 deletions

View File

@ -26,7 +26,6 @@ import (
"strings"
"golang.org/x/image/webp"
"golang.org/x/image/webp/nycbcra"
)
var (
@ -161,12 +160,12 @@ func encodePAM(gotImage image.Image) ([]byte, error) {
func encodePGM(gotImage image.Image) ([]byte, error) {
var (
m *image.YCbCr
ma *nycbcra.Image
ma *image.NYCbCrA
)
switch g := gotImage.(type) {
case *image.YCbCr:
m = g
case *nycbcra.Image:
case *image.NYCbCrA:
m = &g.YCbCr
ma = g
default:

View File

@ -13,8 +13,6 @@ import (
"os"
"strings"
"testing"
"golang.org/x/image/webp/nycbcra"
)
// hex is like fmt.Sprintf("% x", x) but also inserts dots every 16 bytes, to
@ -54,11 +52,11 @@ func testDecodeLossy(t *testing.T, tc string, withAlpha bool) {
var (
m0 *image.YCbCr
a0 *nycbcra.Image
a0 *image.NYCbCrA
ok bool
)
if withAlpha {
a0, ok = img0.(*nycbcra.Image)
a0, ok = img0.(*image.NYCbCrA)
if ok {
m0 = &a0.YCbCr
}