<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="Upload" />
</form>
<?php
include('class.upload.php');
$handle = new Upload($_FILES['file']);
if ($handle->uploaded) {
$handle->image_resize = true;
$handle->image_x = 283;
$handle->image_y = 221;
$handle->image_ratio_crop = true;
$handle->jpeg_quality = 100;
$handle->image_watermark = 'frame.png';
$handle->Process('./');
if ($handle->processed) {
$filename = $handle->file_dst_name;
}else{
echo 'Error: ' . $handle->error . '';
}
$handle-> Clean();
}else{
echo 'Error: ' . $handle->error . '';
}
?>
Firstly, you include the class file you downloaded that will handle the image functions. You can find more information about the available properties in the class file, but for this one we resize the image to the same size as the frame, and crop any overflow. We then use the watermark property to specify the location of the frame.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (5)
Commented:
Nice article, thank you. What is frame-property.png?
Author
Commented:The frame-property.png file is the rounded corner frame applied to the image at the very top of the page. It's not easy to see is it's currently displayed over a white background. I suggest downloading it and opening it in a good image editing program, you will see the rounded corners right away!
Commented:
Well done on the article. Keep it up, I look forward to reading more.
Commented:
https://www.fpwr.org/demo5/framemaker.php
Commented: