1--TEST--
2Scale images and preserve aspect ratio
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7
8$img = imagecreatetruecolor ( 256, 384);
9
10$thumbnail = imagescale($img, 64, -1, IMG_BICUBIC);
11var_dump(imagesx($thumbnail));
12var_dump(imagesy($thumbnail));
13
14$thumbnail = imagescale($img, -1, 64, IMG_BICUBIC);
15var_dump(imagesx($thumbnail));
16var_dump(imagesy($thumbnail));
17
18$img = imagecreatetruecolor ( 384, 256);
19
20$thumbnail = imagescale($img, 64, -1, IMG_BICUBIC);
21var_dump(imagesx($thumbnail));
22var_dump(imagesy($thumbnail));
23
24$thumbnail = imagescale($img, -1, 64, IMG_BICUBIC);
25var_dump(imagesx($thumbnail));
26var_dump(imagesy($thumbnail));
27
28$img = imagecreatetruecolor ( 256, 256);
29
30$thumbnail = imagescale($img, 64, -1, IMG_BICUBIC);
31var_dump(imagesx($thumbnail));
32var_dump(imagesy($thumbnail));
33
34$thumbnail = imagescale($img, -1, 64, IMG_BICUBIC);
35var_dump(imagesx($thumbnail));
36var_dump(imagesy($thumbnail));
37
38?>
39DONE
40--EXPECT--
41int(64)
42int(96)
43int(42)
44int(64)
45int(64)
46int(42)
47int(96)
48int(64)
49int(64)
50int(64)
51int(64)
52int(64)
53DONE
54