I've got this function that flips an image from left to right, but it only works on some of my images, on others, it has a little problem on the far right of the flipped image, and I can't seem to find why.
function FlipImage( $image, $imagestr ) {
$image_info = GetImageSize( $imagestr );
list($image_width, $image_height, $image_type, $image_width_height_string) = $image_info;
$imageTemp = ImageCreate(1,$image_height);
$j=$image_width-1;
for ($i=0; $i<($image_width/2)-1; $i++){
ImageCopy( $imageTemp, $image, 0,0, $i,0, 1,$image_height);
ImageCopy( $image, $image, $i,0, $j,0, 1,$image_height);
ImageCopy( $image, $imageTemp, $j,0, 0,0, 1,$image_height);
$j-=1;
}ImageDestroy( $imageTemp );}