Skip to content

Commit

Permalink
using only free images in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 11, 2023
1 parent 6cb6c02 commit 3f0350d
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 23 deletions.
32 changes: 10 additions & 22 deletions service/imaging/processor_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,38 +87,26 @@ func TestProcessorDefault_FitAnimationGIF(t *testing.T) {
},
{
name: "invalid (invalid gif)",
reader: io.LimitReader(testutils.MustOpenGif("cube.gif"), 10),
reader: io.LimitReader(testutils.MustOpenGif("tooth.gif"), 10),
want: nil,
err: ErrInvalidImageSrc,
},
{
name: "success (cube 正方形、透明ピクセルあり)",
file: "cube.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("cube_resized.gif")),
name: "success (tooth 正方形)",
file: "tooth.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("tooth_resized.gif")),
err: nil,
},
{
name: "success (miku 横長、差分最適化)",
file: "miku.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("miku_resized.gif")),
err: nil,
},
{
name: "success (parapara 正方形、差分最適化)",
file: "parapara.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("parapara_resized.gif")),
name: "success (frog 横長、Disposal設定アリ)",
file: "frog.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("frog_resized.gif")),
err: nil,
},
{
name: "success (miku2 縦長、差分最適化)",
file: "miku2.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("miku2_resized.gif")),
err: nil,
},
{
name: "success (rabbit 小サイズ)",
file: "rabbit.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("rabbit_resized.gif")),
name: "success (miku 縦長、差分最適化)",
file: "miku.gif",
want: utils.MustIoReaderToBytes(testutils.MustOpenGif("miku_resized.gif")),
err: nil,
},
}
Expand Down
Binary file removed testdata/gif/cube.gif
Binary file not shown.
Binary file removed testdata/gif/cube_resized.gif
Binary file not shown.
9 changes: 9 additions & 0 deletions testdata/gif/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@ import "embed"
//
//go:embed *.gif
var FS embed.FS

// GIF画像 出典

// miku.gif https://piapro.jp/t/FB3J
// marucaさんの作品

// tooth.gif https://patirabi.com/2021/10/10/061gif/

// frog.gif https://sozai-good.com/illust/gifanimation/29065
Binary file added testdata/gif/frog.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added testdata/gif/frog_resized.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified testdata/gif/miku.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed testdata/gif/miku2.gif
Binary file not shown.
Binary file removed testdata/gif/miku2_resized.gif
Binary file not shown.
Binary file modified testdata/gif/miku_resized.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed testdata/gif/parapara.gif
Binary file not shown.
Binary file removed testdata/gif/parapara_resized.gif
Binary file not shown.
Binary file removed testdata/gif/rabbit.gif
Binary file not shown.
Binary file removed testdata/gif/rabbit_resized.gif
Binary file not shown.
Binary file added testdata/gif/tooth.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added testdata/gif/tooth_resized.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion utils/imaging/gif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func TestGifToBytesReader(t *testing.T) {
t.Parallel()

tests := []string{"cube.gif", "miku.gif", "parapara.gif", "miku2.gif", "rabbit.gif"}
tests := []string{"frog.gif", "miku.gif", "tooth.gif"}

for _, tt := range tests {
tt := tt
Expand Down

0 comments on commit 3f0350d

Please sign in to comment.