views:

79

answers:

0

I'm doing some work in GD and I have a series of image sizes that I'm converting from my large 1920x1080 jpg.

So for instance:

1920x1080 > 640x480 (4:3)
1920x1080 > 640x360 (16:9)
1920x1080 > 360x280

Should the best practice here to use a letterbox effect or fullscreen? With the letterbox I'll see more of the image, but the latter will fill the screen.

I'm using this script here:

$new_img = imagecreatetruecolor($width, $height);

if (($width/$img_width) < ($height/$img_height)) { $new_width = $width; $new_height = ($width/$img_width) * $img_height; $new_x = 0; $new_y = ($height - $new_height) / 2; } else { $new_width = ($height/$img_height) * $img_width; $new_height = $height; $new_x = ($width - $new_width) / 2; $new_y = 0; }

imagecopyresampled($new_img, $img, $new_x, $new_y, 0, 0, $new_width, $new_height, $img_width, $img_height);