So i have my php file which recieves a file, and saves it. Works fine. However, i would like it to generate a thumbnail as well (using http://abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/)
Here is my current code:
<?php
$destination_path = getcwd().DIRECTORY_SEPARATOR . '/uploads/';
$result = 0;
$target_path = $destination_path . basename( $_FILES['myfile']['name']);
if(@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
$result = 1;
square_crop($target_path, 'thumb.jpg');
}
?>
When i try to use the square_crop($target_path, 'thumb.jpg'); i get a parse error on the line if( $image[0] > $image[1] ) {
Am i using it the wrong way? Thanks
>is an HTML entity for>– I had the same problem when I copied the code from the site – just replace all instances of>with>and you’re good to go!