php image upload help

Out of context: Reply #2

  • Started
  • Last post
  • 3 Responses
  • cosmo0

    you can use the gd library to resize.

    use this to resize jpeg's:

    $imgPath = "yourdomain.com";
    $fixedImageName = "something.jpg";

    $src_img = imagecreatefromjpeg($imgPath.$fi...
    $origw = imagesx($src_img);
    $origh = imagesy($src_img);
    $new_w = 150; // resize to 100px wide
    $diff = $origw/$new_w;
    $new_h = 50;

    $dst_img = imagecreate($new_w,$new_h);
    imagecopyresized($dst_img,$src_i...
    imagejpeg($dst_img, $imgPath.$fixedThumbnailName

View thread