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