<?php

/**
 * Created by PhpStorm.
 * User: stanley-king
 * Date: 2017/6/9
 * Time: 下午5:25
 */
class TestGD extends PHPUnit_Framework_TestCase
{
    public function testMerge()
    {
        $back_img = '/Users/stanley-king/Desktop/back.jpg';
        $icon_img = '/Users/stanley-king/Desktop/icon.png';
        $dest_img = '/Users/stanley-king/Desktop/dest.jpg';
        $back = imagecreatefromjpeg($back_img);
        $icon = imagecreatefrompng($icon_img);
        imageinterlace($back);

        imagecopy($back, $icon, 60, 60, 0, 0, imagesx($icon), imagesy($icon));
        imagejpeg($back, $dest_img,100);
    }
}
