Created
April 16, 2013 06:11
-
-
Save devyfriend/5393742 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _merge_photo($original_image) | |
| { | |
| //test(FCPATH.'assets/loop/img/frame.png',1); | |
| # If you don't know the type of image you are using as your originals. | |
| $image = imagecreatefromstring(file_get_contents(FCPATH.'loop_upload/'.$original_image['file_name'])); | |
| $frame = imagecreatefrompng(FCPATH.'assets/loop/img/frame.png'); | |
| # If you know your originals are of type PNG. | |
| //$image = imagecreatefrompng($original_image); | |
| //$frame = imagecreatefrompng($frame_image); | |
| imagesavealpha($frame, true); | |
| imagealphablending($frame, true); | |
| //imagecopymerge($image, $frame, 0, 0, 0, 0, 758, 512, 100); | |
| imagecopyresampled($image, $frame, 0, 0, 0, 0, 758, 512,758, 512); | |
| # Save the image to a file | |
| $dt = getdate(); | |
| imagepng($image, FCPATH.'loop_upload/gallery/'.$dt[0].'.png'); | |
| # Output straight to the browser. | |
| //header('Content-Type: image/png'); | |
| //imagepng($image); | |
| return $dt[0].'.png'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment