Branch: Tag:

2015-08-08

2015-08-08 02:40:19 by Martin Nilsson <nilsson@fastmail.com>

Test Image.ANY a bit. Made JPEG test fuzzier.

699:      dnl #### Encodings    + define(test_image_any,[[ +  test_any([[ +  return Image.ANY.decode(Image.$1.encode(Image.Image(10,10)))->xsize(); +  ]],10) +  test_any([[ +  mapping m=Image.ANY._decode(Image.$1.encode(Image.Image(10,10))); +  if(!m->image || !m->type) return -1; +  if(!has_prefix(m->type, "image/")) return -2; +  return 1; +  ]], 1) + ]]) +  + ; Missing tests for XCF, PSD, TIM, XWD + test_image_any(PNM) + test_image_any(JPEG) + test_image_any(PNG) + test_image_any(GIF) + test_image_any(ILBM) + test_image_any(BMP) + test_image_any(RAS) + test_image_any(PVR) + test_image_any(PCX) +  +    define(test_encoding,[[    cond( (master()->resolv("Image.$1")||([]))->encode,[[    test_any([[
782:    test_any([[    object img=Image.Image(100,100)->test(43);    object img1=Image.JPEG.decode(Image.JPEG.encode(img,(["quality":100]))); -  return img-img1<10; +  return img-img1<20;    ]],1)   ]])