Sorry... I can't deal with all the SPAM so until I can find a better solution for the forums, I'm locking them down. For now please use awesome services like stackoverflow.com for community support. Thanks.
This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
Thumbnail creation
  • Thumbnail creation is a common topic once an image is uploaded. Below is a basic script (added to upload.php) that can be used to create thumbnails and store them to another directory. With some slight modifications it could also be used to resize an image to specified parameters. - Requires "GD" library
    [code=php]
    if 
    (!empty($_FILES)) {
        $tempFile = $_FILES['Filedata']['tmp_name'];
        $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
        $targetPath =  str_replace('//','/',$targetPath);
        $targetFile =  $targetPath . $_FILES['Filedata']['name'];
        move_uploaded_file($tempFile,$targetFile);
    }

    $imgsize = getimagesize($targetFile);
    switch(
    strtolower(substr($targetFile, -3))){
        case "jpg":
            $image = imagecreatefromjpeg($targetFile);    
        break
    ;
        case "png":
            $image = imagecreatefrompng($targetFile);
        break;
        case "gif":
            $image = imagecreatefromgif($targetFile);
        break;
        default:
            exit;
        break;
    }

    $width = 80; //New width of image    
    $height = $imgsize[1]/$imgsize[0]*$width; //This maintains proportions

    $src_w = $imgsize[0];
    $src_h = $imgsize[1];
        

    $picture 
    = imagecreatetruecolor($width, $height);
    imagealphablending($picture, false);
    imagesavealpha($picture, true);
    $bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h); 

    if($bool){
        switch(strtolower(substr($targetFile, -3))){
            case "jpg":
                header("Content-Type: image/jpeg");
                $bool2 = imagejpeg($picture,$targetPath."Thumbs/".$_FILES['Filedata']['name'],80);
            break;
            case "png":
                header("Content-Type: image/png");
                imagepng($picture,$targetPath."Thumbs/".$_FILES['Filedata']['name']);
            break;
            case "gif":
                header("Content-Type: image/gif");
                imagegif($picture,$targetPath."Thumbs/".$_FILES['Filedata']['name']);
            break;
        }
    }

    imagedestroy($picture);
    imagedestroy($image);

    echo '1'; // Important so upload will work on OSX
     [/code]
  • I'm fairly certain that imagecreatefromgif() will break animated-gif's, which some people/places like to use as avatars.

    Here's a function to determine if it is animated or not, and if it is you can do some different image processing.
    function is_animated_gif( $filename )
    {
    $raw = file_get_contents( $filename );

    $offset = 0;
    $frames = 0;
    while ($frames < 2)
    {
    $where1 = strpos($raw, \"\x00\x21\xF9\x04\", $offset);
    if ( $where1 === false )
    {
    break;
    }
    else
    {
    $offset = $where1 + 1;
    $where2 = strpos( $raw, \"\x00\x2C\", $offset );
    if ( $where2 === false )
    {
    break;
    }
    else
    {
    if ( $where1 + 8 == $where2 )
    {
    $frames ++;
    }
    $offset = $where2 + 1;
    }
    }
    }

    return $frames > 1;
    }


    on PHP one could use the convert function along with coalesce to resize the image if needed.
  • Hey thats wonderfull, it works great...thx

    i've got a question about thies thumbnail creation, its possible to make 2 Thumbnails at one upload... ive copied the source code and paste it again below, but it doesnt work, can andybody help me please, what must i do, to realize this?

    i repeat, i want 2 or many thumbnail creations...? its possible?

    Thanks.
  • If your wanting to run the code multiple times then you should convert the code to work as a function. Create the function to receive variables width, height, inputFile and outputFile.

    True programming is about reuse. If you call a piece of code more than once it should be converted into a function that can be called multiple times.

    In your upload script you would then call it with something like

    thumbnail(80, 80, 'image1.jpg', 'image1preSmall');
    thumbnail(240, 240, 'image1.jpg', 'image1preLarge');
  • Hi i'm a newbie here. i had implemented your thumbnail creation and it really works great. i've a problem, when i upload the image, the filename of my thumbnail picture is the same as my original one. Is there a way on how i can put e.g.image1_thumb.jpg something like this to avoid confusion?

    My second question is how to store the image to the database? thanks in advance and God bless :D :D :D
  • of course you can.

    simply change the portions of code that contain [code=php]$targetPath."Thumbs/".$_FILES['Filedata']['name'[/code]
    to something like [code=php]$targetPath.substr($_FILES['Filedata']['name'], 0, -4)."_thumb".strtolower(substr($targetFile, -4)) [/code]

    Adding the name of the image to a database. You need to learn php and SQL. You'll find plenty of examples and tutorials on the net. It's easy enough, it just depends on the structure of your database
  • Thanks!!! :D its working

    $bool2 = imagejpeg($picture,$targetPath."Thumbs/".substr($_FILES['Filedata']['name'], 0, -4)."_thumb".strtolower(substr($targetFile, -4)));
  • i have a question that I have changed the code as the post says but why the img does not display ? how to make it show ?
    <?php
    session_start();
    include_once \"../../conn/conn.inc.php\";
    $name=$_SESSION['uname'];
    $des=$_GET['description'];

    if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
    $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];




    $extension = end(explode('.', $targetFile));
    $type = \".\".strtolower($extension);


    $filename= $_FILES['Filedata']['name'];
    // Uncomment the following line if you want to make the directory if it doesn't exist
    // mkdir(str_replace('//','/',$targetPath), 0755, true);

    move_uploaded_file($tempFile,$targetFile);



    $sql = \"INSERT INTO `login_reg_love`.`up_file` (`filename`, `filepath`, `filetype`, `upauthor`,`descr`, `uptime`) VALUES ('\".$filename.\"', '\".$targetFile.\"', '\".$type.\"', '\".$name.\"','\".$des.\"', NOW())\";

    $num=$conne->uidRst($sql);
    /*
    if($num==1){
    echo $up_path;

    }else{
    echo \"上传失败\";
    }
    */








    }
    switch ($_FILES['Filedata']['error'])
    {
    case 0:
    //$msg = \"No Error\"; comment this out if you don't want a message to appear on success.
    break;
    case 1:
    $msg = \"The file is bigger than this PHP installation allows\";
    break;
    case 2:
    $msg = \"The file is bigger than this form allows\";
    break;
    case 3:
    $msg = \"Only part of the file was uploaded\";
    break;
    case 4:
    $msg = \"No file was uploaded\";
    break;
    case 6:
    $msg = \"Missing a temporary folder\";
    break;
    case 7:
    $msg = \"Failed to write file to disk\";
    break;
    case 8:
    $msg = \"File upload stopped by extension\";
    break;
    default:
    $msg = \"unknown error \".$_FILES['Filedata']['error'];
    break;
    }

    If ($msg)
    $stringData = \"Error: \".$_FILES['Filedata']['error'].\" Error Info: \".$msg;
    else
    $stringData = \"1\"; // This is required for onComplete to fire on Mac OSX

    echo $stringData;




    $imgsize = getimagesize($targetFile);
    switch(strtolower(substr($targetFile, -3))){
    case \"jpg\":
    $image = imagecreatefromjpeg($targetFile);
    break;
    case \"png\":
    $image = imagecreatefrompng($targetFile);
    break;
    case \"gif\":
    $image = imagecreatefromgif($targetFile);
    break;
    default:
    exit;
    break;
    }

    $width = 80; //New width of image
    $height = $imgsize[1]/$imgsize[0]*$width; //This maintains proportions

    $src_w = $imgsize[0];
    $src_h = $imgsize[1];


    $picture = imagecreatetruecolor($width, $height);
    imagealphablending($picture, false);
    imagesavealpha($picture, true);
    $bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);

    if($bool){
    switch(strtolower(substr($targetFile, -3))){
    case \"jpg\":
    // header(\"Content-Type: image/jpeg\");
    $bool2 = imagejpeg($picture,$targetPath.\"Thumbs/\".$_FILES['Filedata']['name'],80);
    break;
    case \"png\":
    // header(\"Content-Type: image/png\");
    imagepng($picture,$targetPath.\"Thumbs/\".$_FILES['Filedata']['name']);
    break;
    case \"gif\":
    // header(\"Content-Type: image/gif\");
    imagegif($picture,$targetPath.\"Thumbs/\".$_FILES['Filedata']['name']);
    break;
    }
    }

    imagedestroy($picture);
    imagedestroy($image);

    echo '1';
    ?>
  • Hi,TravisN, are you busy? I think it is midnight in your city. I wish you can release your self and have a good sleep... but if you still do not feel sleepy, can you help me?
    I really do not know how to make the image desplay.will the session_start affect the image show, I try to run the code without session, but it does not work. what I have done includes 1.add img tag in a div and give the img tag an id "thumbs". 2 in js file,write the command $('#thumbs').attr("src","../javascripts/jquery.uploadify-v1.6.2.mit/upload.php"); 3. I have check the path of thumbs. the path is right,but it display an "X" without showing anything. 4.I also echo bool, it is true. but why the img cannot show? 5 php version is also support gd :( I really do not know where is wrong. can you help me....
  • The code you have posted generates the thumbnail image. It has nothing to do with displaying the image. There are a couple of things I will need

    1. Is the thumbnail physically created in the 'thumbs' directory
    2. your code that adds the img and surrounding code that sets the src (not just the one line)
  • yes, the thumbnail is indeed created in the 'thumbs' directory, one thumbnail is created when uploading one image.it works well.
    <div id=\"ff\">
    <div><img id=\"thumbs\"></div>
    <div>select images:</div>
    <div><input type=\"file\" id=\"fileInput\" name=\"fileInput\" /></div>
    <button type=\"button\" id=\"fileUploadStart\">fileUploadStart</button>
    <button type=\"button\" onclick=\"$('#fileInput').fileUploadClearQueue();\">Clear queue</button>

    </div>

    is it right that I set the image here ? what should I do next..... ? thank you!
  • Is it possible to show the thumbnail after upload?
  • I made an adjusted thumbnailer.php script that returns the thumbnail as octet-stream for use with the onComplete function
    $sourceFile = $_GET['file'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . '/uploadify/' . $_GET['folder'] . '/';
    $targetPath = str_replace('//','/',$targetPath);
    $localSourceFile = $targetPath . $sourceFile;
    $thumbUrl = $targetPath.\"Thumb_\".$sourceFile;
    $imgsize = getimagesize($localSourceFile);
    $image = imagecreatefromjpeg($localSourceFile);

    $width = 70; //New width of image
    $height = $imgsize[1]/$imgsize[0]*$width; //This maintains proportions

    $src_w = $imgsize[0];
    $src_h = $imgsize[1];

    $picture = imagecreatetruecolor($width, $height);
    imagealphablending($picture, false);
    imagesavealpha($picture, true);
    $bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);

    if($bool){
    header(\"Content-Type: image/jpeg\");
    $bool2 = imagejpeg($picture,$thumbUrl,80);
    }

    imagedestroy($picture);
    imagedestroy($image);

    header(\"Content-Type: image/jpeg\");
    echo file_get_contents($thumbUrl);
  • For those who don't need thumbnails saved to the server, there is a great script for creating thumbs on the fly with caching.

    http://www.darrenhoyt.com/2008/04/02/ti ... -released/
  • I try to include a function in the uploadify.php file but i don't know why it doesn't work.


    Here my function in uploadify.php :


    function fct_redim_image($Wmax, $Hmax, $rep_Dst, $img_Dst, $rep_Src, $img_Src) {
    // ------------------------------------------------------------------
    $condition = 0;
    // If some parameter are empty :
    if ($rep_Dst == '') { $rep_Dst = $rep_Src; } // (same folder)
    if ($img_Dst == '') { $img_Dst = $img_Src; } // (same name)
    if ($Wmax == '') { $Wmax = 0; }
    if ($Hmax == '') { $Hmax = 0; }
    // ------------------------------------------------------------------
    // if file exist in the folder, go on...
    if (file_exists($rep_Src.$img_Src) &amp;&amp; ($Wmax!=0 || $Hmax!=0)) {
    // ----------------------------------------------------------------
    // accepted extension files :
    $ExtfichierOK = '\" jpg jpeg png\"';
    // extension
    $tabimage = explode('.',$img_Src);
    $extension = $tabimage[sizeof($tabimage)-1]; // last part
    $extension = strtolower($extension);
    // ----------------------------------------------------------------
    // extension OK ? go on ...
    if (strpos($ExtfichierOK,$extension) != '') {
    // -------------------------------------------------------------
    // taking dimension of the original file
    $size = getimagesize($rep_Src.$img_Src);
    $W_Src = $size[0]; // largeur
    $H_Src = $size[1]; // hauteur
    // -------------------------------------------------------------
    // some condition of resizing
    // -------------------------------------------------------------
    // A- WIDTH and Height max fix
    if ($Wmax != 0 &amp;&amp; $Hmax != 0) {
    $ratiox = $W_Src / $Wmax; // ratio in width
    $ratioy = $H_Src / $Hmax; // ratio in height
    $ratio = max($ratiox,$ratioy); //the biggest
    $W = $W_Src/$ratio;
    $H = $H_Src/$ratio;
    $condition = ($W_Src>$W) || ($W_Src>$H); // 1 if true
    } // -------------------------------------------------------------
    // B- WIDTH max fix
    if ($Hmax != 0 &amp;&amp; $Wmax == 0) {
    $H = $Hmax;
    $W = $H * ($W_Src / $H_Src);
    $condition = $H_Src > $Hmax; // 1 if true
    }
    // -------------------------------------------------------------
    // C- HEIGHT max fix
    if ($Wmax != 0 &amp;&amp; $Hmax == 0) {
    $W = $Wmax;
    $H = $W * ($H_Src / $W_Src);
    $condition = $W_Src > $Wmax; // 1 if true
    }
    // -------------------------------------------------------------
    // Resize if $condition is true
    // -------------------------------------------------------------
    if ($condition == 1) {

    switch($extension) {
    case 'jpg':
    case 'jpeg':
    $Ress_Src = imagecreatefromjpeg($rep_Src.$img_Src);
    $Ress_Dst = ImageCreateTrueColor($W,$H);
    break;
    case 'png':
    $Ress_Src = imagecreatefrompng($rep_Src.$img_Src);
    $Ress_Dst = ImageCreateTrueColor($W,$H);
    imagesavealpha($Ress_Dst, true);
    $trans_color = imagecolorallocatealpha($Ress_Dst, 0, 0, 0, 127);
    imagefill($Ress_Dst, 0, 0, $trans_color);
    break;
    }
    // ----------------------------------------------------------
    //
    ImageCopyResampled($Ress_Dst, $Ress_Src, 0, 0, 0, 0, $W, $H, $W_Src, $H_Src);
    // ----------------------------------------------------------
    // Save in the folder
    switch ($extension) {
    case 'jpg':
    case 'jpeg':
    ImageJpeg ($Ress_Dst, $rep_Dst.$img_Dst);
    break;
    case 'png':
    imagepng ($Ress_Dst, $rep_Dst.$img_Dst);
    break;
    }
    // ----------------------------------------------------------
    //
    imagedestroy ($Ress_Src);
    imagedestroy ($Ress_Dst);
    }
    // -------------------------------------------------------------
    }
    }
    // ---------------------------------------------------------------------------------------------------------------------
    }



    The rest of basic code of uploadify.php :



    if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
    $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];

    // $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
    // $fileTypes = str_replace(';','|',$fileTypes);
    // $typesArray = split('\|',$fileTypes);
    // $fileParts = pathinfo($_FILES['Filedata']['name']);

    // if (in_array($fileParts['extension'],$typesArray)) {
    // Uncomment the following line if you want to make the directory if it doesn't exist
    // mkdir(str_replace('//','/',$targetPath), 0755, true);

    move_uploaded_file($tempFile,$targetFile);
    }

    $img_Src = $_FILES['Filedata']['name'];
    $rep_Src = $targetPath;
    $rep_Dst = $targetPath.\"miniatures/\";
    $img_Dst = 'pict-'.$img_Src;
    $RedimOK = fct_redim_image(200, 200, $rep_Dst, $img_Dst, $rep_Src, $img_Src);

    echo \"1\";
    // } else {
    // echo 'Invalid file type.';
    // }



    The root of files is http://127.0.0.1/images/a_selected_folder/miniatures/
  • Finally I get it working... but still don't know why. The point with this code is that you can apply a ratio when you resize a picture. For me the max width and height is 200.

    So here my uploadify.php :

    [code=php]
    function fct_redim_image
    ($Wmax, $Hmax, $rep_Dst, $img_Dst, $rep_Src, $img_Src) {
      // ------------------------------------------------------------------
     $condition = 0;
      // Si certains parametres ont pour valeur '' :
       if ($rep_Dst == '') { $rep_Dst = $rep_Src; }  // (meme repertoire)
       if ($img_Dst == '') { $img_Dst = $img_Src; }  // (meme nom)
       if ($Wmax == '') { $Wmax = 0; }
       if ($Hmax == '') { $Hmax = 0; }
      // ------------------------------------------------------------------
      // si le fichier existe dans le répertoire, on continue...
     if (file_exists($rep_Src.$img_Src) && ($Wmax!=|| $Hmax!=0)) { 
        
    // ----------------------------------------------------------------
        // extensions acceptees : 
       $ExtfichierOK = '" jpg jpeg png"';  // (l espace avant jpg est important)
        // extension
       $tabimage = explode('.',$img_Src);
       $extension = $tabimage[sizeof($tabimage)-1];  // dernier element
       $extension = strtolower($extension);  // on met en minuscule
        // ----------------------------------------------------------------
        // extension OK ? on continue ...
       if (strpos($ExtfichierOK,$extension) != '') {
           // -------------------------------------------------------------
           // recuperation des dimensions de l image Src
          $size = getimagesize($rep_Src.$img_Src);
          $W_Src = $size[0];  // largeur
          $H_Src = $size[1];  // hauteur
           // -------------------------------------------------------------
           // condition de redimensionnement et dimensions de l image finale
           // -------------------------------------------------------------
           // A- LARGEUR ET HAUTEUR maxi fixes
          if ($Wmax != 0 && $Hmax != 0) {
             $ratiox = $W_Src / $Wmax;  // ratio en largeur
             $ratioy = $H_Src / $Hmax;  // ratio en hauteur
             $ratio = max($ratiox,$ratioy);  // le plus grand
             $W = $W_Src/$ratio;
             $H = $H_Src/$ratio;   
             $condition 
    = ($W_Src>$W) || ($W_Src>$H);  // 1 si vrai (true)
          }       // -------------------------------------------------------------
           // B- LARGEUR maxi fixe
          if ($Hmax != 0 && $Wmax == 0) {
             $H = $Hmax;
             $W = $H * ($W_Src / $H_Src);
             $condition = $H_Src > $Hmax;  // 1 si vrai (true)
          }
           // -------------------------------------------------------------
           // C- HAUTEUR maxi fixe
          if ($Wmax != 0 && $Hmax == 0) {
             $W = $Wmax;
             $H = $W * ($H_Src / $W_Src);         
             $condition 
    = $W_Src > $Wmax;  // 1 si vrai (true)
          }
           // -------------------------------------------------------------
           // on REDIMENSIONNE si la condition est vraie
           // -------------------------------------------------------------
          if ($condition == 1) {
              // creation de la ressource-image"Src" en fonction de l extension
              // et on cree une ressource-image"Dst" vide aux dimensions finales
             switch($extension) {
             case 'jpg':
             case 'jpeg':
               $Ress_Src = imagecreatefromjpeg($rep_Src.$img_Src);
               $Ress_Dst = ImageCreateTrueColor($W,$H);
               break;
             case 'png':
               $Ress_Src = imagecreatefrompng($rep_Src.$img_Src);
               $Ress_Dst = ImageCreateTrueColor($W,$H);
                // fond transparent (pour les png avec transparence)
               imagesavealpha($Ress_Dst, true);
               $trans_color = imagecolorallocatealpha($Ress_Dst, 0, 0, 0, 127);
               imagefill($Ress_Dst, 0, 0, $trans_color);
               break;
             }
              // ----------------------------------------------------------
              // REDIMENSIONNEMENT (copie, redimensionne, re-echantillonne)
             ImageCopyResampled($Ress_Dst, $Ress_Src, 0, 0, 0, 0, $W, $H, $W_Src, $H_Src); 
              
    // ----------------------------------------------------------
              // ENREGISTREMENT dans le repertoire (avec la fonction appropriee)
             switch ($extension) { 
             case 
    'jpg':
             case 'jpeg':
               ImageJpeg ($Ress_Dst, $rep_Dst.$img_Dst);
               break;
             case 'png':
               imagepng ($Ress_Dst, $rep_Dst.$img_Dst);
               break;
             }
              // ----------------------------------------------------------
              // liberation des ressources-image
             imagedestroy ($Ress_Src);
             imagedestroy ($Ress_Dst);
          }
           // -------------------------------------------------------------
       }
     }
    // ---------------------------------------------------------------------------------------------------------------------
      // retourne : 1 (vrai) si le redimensionnement et l enregistrement ont bien eu lieu, sinon rien (false)
      // si le fichier a bien ete cree
     if ($condition == 1 && file_exists($rep_Dst.$img_Dst)) { return true; }
     else { return false; }
    }
     [/code]

    And here the next part of uploadify.php

    [code=php]
    if 
    (!empty($_FILES)) {
        $tempFile = $_FILES['Filedata']['tmp_name'];
        $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
        $targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
            
        
        
    // $fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
        // $fileTypes  = str_replace(';','|',$fileTypes);
        // $typesArray = split('\|',$fileTypes);
        // $fileParts  = pathinfo($_FILES['Filedata']['name']);
        
        
    // if (in_array($fileParts['extension'],$typesArray)) {
            // Uncomment the following line if you want to make the directory if it doesn't exist
            // mkdir(str_replace('//','/',$targetPath), 0755, true);
            
            move_uploaded_file
    ($tempFile,$targetFile);

        // } else {
        //     echo 'Invalid file type.';
        // }
    }

    $img_Src = $_FILES['Filedata']['name'];
    $rep_Src = $targetPath;
    $rep_Dst = $targetPath."miniatures/";
    $img_Dst = 'pict-'.$img_Src;
    $RedimOK = fct_redim_image(200, 200, $rep_Dst, $img_Dst, $rep_Src, $img_Src);


    ////////////////////////////////////////////////////
    switch ($_FILES['Filedata']['error'])
    {
         
         case 0
    :
                 //$msg = "No Error"; // comment this out if you don't want a message to appear on success.
                 break;
         case 1:
                  $msg = "The file is bigger than this PHP installation allows";
                  break;
          case 2:
                  $msg = "The file is bigger than this form allows";
                  break;
           case 3:
                  $msg = "Only part of the file was uploaded";
                  break;
           case 4:
                 $msg = "No file was uploaded";
                  break;
           case 6:
                 $msg = "Missing a temporary folder";
                  break;
           case 7:
                 $msg = "Failed to write file to disk";
                 break;
           case 8:
                 $msg = "File upload stopped by extension";
                 break;
           default:
                $msg = "unknown error ".$_FILES['Filedata']['error'];
                break;
    }

    If ($msg)
        $stringData = "Error: ".$_FILES['Filedata']['error']." Error Info: ".$msg;
    else
       $stringData = "1"; // This is required for onComplete to fire on Mac OSX
    echo $stringData;
     [/code]
  • Hi,
    i have a problem with this script because it doesn't create thumbnails even if the file is uploaded, i have created the folder "Thumbs" under my "uploads" folder but nothing appears after upload !
    any idea ?
    thanks.
  • Anyone looking to improve the thumb quality, search for this line:
    ImageJpeg ($Ress_Dst, $rep_Dst.$img_Dst);


    and replace with:
    ImageJpeg ($Ress_Dst, $rep_Dst.$img_Dst, 100);


    Same for png.
    Cu!
  • RonnieSan said:
    For those who don't need thumbnails saved to the server, there is a great script for creating thumbs on the fly with caching.

    http://www.darrenhoyt.com/2008/04/02/ti ... -released/


    This is really nice... very easy to use... The one i've been looking for... Thnx Ronnie, I'm your fan, the uploadify u've made really amaze me...
  • TravisN, good job!
    But... if I want a squared thumbnail? How can I crop the images?
  • Hi Guys I have stumbled into this discussion because I am looking for a modification on uploadify script. I basically want to display the thumbnail of the image after upload and also save the filename of the image to a database.

    I tried to implement all the suggestions in this thread but I can't make it work... Everyone have added several codes but I don't even know what are the main files to edit.

    If somebody could post a complete or compiled version of this thread from a tutorial step by step instruction, that would be great...

    Thank you...
  • Hello, I have a problem.

    This thumbnail creation script is awesome and it works great. However whenever I try to upload an image that is larger than ~1.7+ megabytes I get a HTTP error. It looks like this: HTTP error

    The original image file gets uploaded to the server(in this case P1030055.JPG), but its' thumbnail is not created and I get the HTTP error shown above.

    I have a hard time troubleshooting this, because when I try to examine the error it seems all its parameters are undefined. Like so:
    Undefined

    My php.ini file allows me to upload files as large as 12M, and this shouldn't be the issue since the large file actually gets uploaded, but the thumbnail is not created.

    What do you think is causing this? Is anyone else having this problem? How can I solve it?

    Cheers,
    Janne

    EDIT: The error code I am given is HTTP 500 Internal Server Error.
  • Usually a 500 error means a file is missing on the server. Make sure all the required files and scripts are present on the server.
  • Hi I am having some trouble with the thumbnail creation. The uploads still works fine after adding the script but no thumbnails are created. Any ideas?

    I use it for creating different galleries so i have a script to create the upload and thumbnail folder for each gallery, the images are uploaded as usual but the thumbnails appear not to be created
  • This thumbnail tutorial looks great it help me a lot to solve my web developing issue.

    Mark,
    Car Insurance
    Personal Loans
  • Form is definitely a season this happens and then appeal a season a general change in like alternative michael kors outlet season begins clearly your existing sweeps. We can't ever stay in a mere one type, Specially the youngsters. Everybody loves to be in vogue and therefore place in a sophisticated style to presently michael kors outlet sale right now generally at this time now certainly, truth be told furthermore in that respect so here character, Don't you should? And thinking about way about forceful, michael kors outlet There's not much along together using which you may test like options young women have but we've got different days artist less difficult, Extremely very popular to equal to your hair style.
  • hi i just use TravisN. code it save the image well but i need to display the image during uploading
  • I am having an issue with the creation of thumbnails when the original picture is wider than 1920 pixels. For what ever reason the upload goes smoothly, but the thumbnail is not created on larger images. Anything that is 1920 pixels wide or smaller has a thumbnail generated for it and that thumbnail is added to the "Thumbs" folder. Why won't this PHP code generate the thumbnails for higher pixeled pictures?