I am trying to make a montage using imagemagick. I get it to work partially. I want to make a montage 2 columns by 2 rows. With 5px of padding between images, on a white background. When I use the following code the resulting image is twice as high and twice as wide as one image although only the first of four images appear in its correct size and spot, with white in the remaining three spots. All images are the same dimensions and same filetype.
<?php
header('Content-type: image/jpeg');
$loc1 = 'http://localhost:8888/gallery_edited/0116.jpg';
$loc2 = 'http://localhost:8888/gallery_edited/0115.jpg';
$loc3 = 'http://localhost:8888/gallery_edited/0114.jpg';
$loc4 = 'http://localhost:8888/gallery_edited/0113.jpg';
$image = new Imagick("$loc1 $loc2 $loc3 $loc4");
$image -> setFormat("jpg");
$image = $image -> montageImage(new ImagickDraw, '2x2', '600x400', 0, '0');
echo $image;

