See how this will work...
This is the slightly modified thumbnailer code for ImageMajick from Reflection-ig.com in their gallery (which I run...)
Code:
exec("{$ibforums->vars['gallery_im_dir']}identify -verbose {$file}", $returnarray);
$returnarray[2] = str_replace("Geometry: ", "", $returnarray[2]);
list($length, $height) = explode("x", $returnarray[2]);
$this->size = "{$length} {$ibforums->lang['pixels']} x {$height} {$ibforums->lang['pixels']}";
if($length > ( $ibforums->vars['gallery_max_tw'] - 2 ) or $height > ( $ibforums->vars['gallery_max_th'] - 2 ))
{
$ratio = ($length > $height) ? ($height / $length) : ($length / $height);
exec("{$ibforums->vars['gallery_im_dir']}mogrify -resize " . ( $ibforums->vars['gallery_max_tw'] - 2 ) . "x" . ( $ibforums->vars['gallery_max_th'] - 2 ) . " {$file} ");
}
copy("./uploads/images/blank.jpg", "./uploads/images/blank_tmp{$id}.jpg");
if($ratio > 0)
{
$width = ($length > $height) ? ( $ibforums->vars['gallery_max_tw'] - 2 ) : (( $ibforums->vars['gallery_max_th'] - 2 ) * $ratio);
$height = ($length > $height) ? ($width * $ratio) : ( $ibforums->vars['gallery_max_th'] - 2 );
$x = ( $ibforums->vars['gallery_max_tw'] - $width ) / 2;
$y = ( $ibforums->vars['gallery_max_th'] - $height ) / 2;
}else
{
$x = ( $ibforums->vars['gallery_max_tw'] - $length ) / 2;
$y = ( $ibforums->vars['gallery_max_th'] - $height ) / 2;
}
exec("{$ibforums->vars['gallery_im_dir']}composite -geometry +{$x}+{$y} {$file} {$ibforums->vars['upload_dir']}/images/blank_tmp{$id}.jpg {$file}");
unlink("{$ibforums->vars['upload_dir']}/images/blank_tmp{$id}.jpg");
$file is the file (including the complete path...
You must have a blank.jpg file and give it the complete path to it and a place to put a copy of it while it resizes it, the file should have no more than a 1 px border and its background will be the color of the background of any extra space on the image.
$ibforums->vars['gallery_max_th'] is the max thumbnail hieght
$ibforums->vars['gallery_max_tw'] is the max thumbnail width
$ibforums->vars['gallery_im_dir'] is the path to image majick
$ibforums->vars['upload_dir'] is the path to the upload directory...
/images past that is where it expects blank.jpg and where it expects to put its temp files
$id is the images id which it use in the temp file name and origanaly would have been used in the thumbnail name as this normally would be used to create a new file thumbnail and not just resize the other file.
/thumbs is where it expects the thumbnail to go...
PS If this doesn't work I can't help because I have no idea how to use ImageMajick the gallery was given to me with this part already written. I can write in GD graphic manipulation though.
If it just returns some small error I may can fix it as I editted the code...
If you would like to donate to reflections if this works you can do that on reflections-ig.com in the forums