So I want to take an image... which is 4:3... resize it, and then crop it to 16:9. I know how to do this using GD2, but sadly it doesnt work with ImageMagick. So now I'm trying to use the existing image classes in VB to handle it... but I can't get them working either...
Code:
require_once(DIR . '/includes/class_image.php');
$image =& vB_Image::fetch_library();
$image->fetch_thumbnail($filename, $location, $newWidth, $newHeight, $quality);
Doesnt seem to do anything...
--------------- Added [DATE]1273196508[/DATE] at [TIME]1273196508[/TIME] ---------------
This is what I am using now...
Code:
if ($vbulletin->options['imagetype'] == 'GD')
{
$newImage = imagecreatetruecolor(160, 90);
$oldImage = imagecreatefromjpeg($target);
imagecopyresampled($newImage, $oldImage, 0, 0, 0, $offHeight, $newWidth, $newHeight, $oldWidth, $oldHeight);
unlink($target);
imagejpeg($newImage, $target, $quality);
}
/*
if ($vbulletin->options['imagetype'] == 'Magick')
{
$thumb = new Imagick($target);
$thumb->cropThumbnailImage($newWidth,$newHeight);
$thumb->writeImage($target);
$thumb->destroy();
}
*/
The second set is commented out, because I can't get it working... Either I need to figure out how to do this with the built in image classes... or I need to figure out how to do this with the imagick class... I can't figure out either.