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:
parent
00fe24ef7b
commit
0ebebfd658
|
@ -26,7 +26,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"golang.org/x/image/webp"
|
"golang.org/x/image/webp"
|
||||||
"golang.org/x/image/webp/nycbcra"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -161,12 +160,12 @@ func encodePAM(gotImage image.Image) ([]byte, error) {
|
||||||
func encodePGM(gotImage image.Image) ([]byte, error) {
|
func encodePGM(gotImage image.Image) ([]byte, error) {
|
||||||
var (
|
var (
|
||||||
m *image.YCbCr
|
m *image.YCbCr
|
||||||
ma *nycbcra.Image
|
ma *image.NYCbCrA
|
||||||
)
|
)
|
||||||
switch g := gotImage.(type) {
|
switch g := gotImage.(type) {
|
||||||
case *image.YCbCr:
|
case *image.YCbCr:
|
||||||
m = g
|
m = g
|
||||||
case *nycbcra.Image:
|
case *image.NYCbCrA:
|
||||||
m = &g.YCbCr
|
m = &g.YCbCr
|
||||||
ma = g
|
ma = g
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -13,8 +13,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"golang.org/x/image/webp/nycbcra"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// hex is like fmt.Sprintf("% x", x) but also inserts dots every 16 bytes, to
|
// 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 (
|
var (
|
||||||
m0 *image.YCbCr
|
m0 *image.YCbCr
|
||||||
a0 *nycbcra.Image
|
a0 *image.NYCbCrA
|
||||||
ok bool
|
ok bool
|
||||||
)
|
)
|
||||||
if withAlpha {
|
if withAlpha {
|
||||||
a0, ok = img0.(*nycbcra.Image)
|
a0, ok = img0.(*image.NYCbCrA)
|
||||||
if ok {
|
if ok {
|
||||||
m0 = &a0.YCbCr
|
m0 = &a0.YCbCr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user