Merge changes from prometheus/mebox-40a7378b

This commit is contained in:
truewhile
2026-11-12 22:38:54 +08:00
parent 5806839601
commit 08d521b65d
8 changed files with 118 additions and 14 deletions
+5 -1
View File
@@ -167,10 +167,14 @@ func TestCropAdultCoverPosterKeepsPortrait(t *testing.T) {
// Create an already vertical portrait image (500x700)
origBytes := createTestImage(500, 700, color.RGBA{R: 255, A: 255}, color.RGBA{B: 255, A: 255})
croppedBytes, _, err := CropAdultCoverPoster(origBytes)
croppedBytes, ctype, err := CropAdultCoverPoster(origBytes)
if err != nil {
t.Fatalf("CropAdultCoverPoster error: %v", err)
}
// 未裁剪时必须回传真正的 MIME(image/jpeg),否则侧车文件扩展名会退化成 .img。
if ctype != "image/jpeg" {
t.Fatalf("portrait ctype = %q, want image/jpeg", ctype)
}
croppedImg, _, err := image.Decode(bytes.NewReader(croppedBytes))
if err != nil {