Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get overlay image from upload form #30

Open
lamkute opened this issue Jul 9, 2021 · 0 comments
Open

How to get overlay image from upload form #30

lamkute opened this issue Jul 9, 2021 · 0 comments

Comments

@lamkute
Copy link

lamkute commented Jul 9, 2021

hi,
im trying to get overlay image from upload form with this code but it not work.
please help.
Thank you!

   <form method="post" enctype="multipart/form-data">
   <table>
   <tr>
   <td>Upload Image*</td>
   <td><input type="file" name="uploadfile" /></td>
   </tr>

   <tr>
   <td colspan="2">
    <small><em>* Acceptable image formats include: GIF, JPG/JPEG and PNG.
	</em></small>
   </td>
   </tr>

   <tr>
   <td colspan="2" style="text-align: center;">
    <input type="submit" name="submit" value="Upload"/>
  </td>
  </tr>
  </table>
  </form>

<?php
if(isset($_POST['submit'])){
require_once('../src/PHPImage.php');

$bg = './img/benji.jpg';
$overlay = $_FILES['uploadfile']['tmp_name'];
$image = new PHPImage();
$image->setDimensionsFromImage($bg);
$image->draw($bg);
$image->draw($overlay, '50%', '75%');
....
$image->show();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant