1

I have a script thats working great for image upload with creation of a thumbnail, but my problem is that I can`t figure out how to size the large image. I know well how where to add my ratio code. Here's the code for uploading the main image:

if(preg_match('/[.](jpg)|(gif)|(png)$/', $_FILES['obv']['name'])) {

    $filename = $_FILES['obv']['name'];
    $source = $_FILES['obv']['tmp_name'];   
    $target = $path_to_image_directory . $filename;

    move_uploaded_file($source, $target);

    createThumbnail($filename);     
}

This is the code I want to use for the main image resize:

    $ratio = $size[0]/$size[1];
    $req_width = 800;
    $height = $req_width / $ratio;

Any help is greatly appreciated!

Mike P
  • 11
  • 4

0 Answers0