Resizing Script Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Resizing Script Help

    This 2 servers use the same script max.php and one shows thumb on other nothing???

    Link 1

    Link 2

    Script is max.php

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
    $height= 128;
    $width= 128;
    // Content type
    header(&#39;Content-type: image/jpeg&#39;);
    if(!$filename)
    $filename="./images/nopic.jpg";
    // Get new dimensions
    list($width_orig, $height_orig) = getimagesize($filename);

    if ($width && ($width_orig < $height_orig)) {
    $width = ($height / $height_orig) * $width_orig;
    } else {
    $height = ($width / $width_orig) * $height_orig;
    }

    // Resample
    $image_p = imagecreatetruecolor($width, $height);
    $image = imagecreatefromjpeg($filename);
    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

    // Output
    imagejpeg($image_p, null, 100);
    ImageDestroy ($image_p);
    ?></div>
    Attached Files

    #2
    Check if the gdlib installed correctly on the server where its does not work
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      <div class='quotetop'>QUOTE (GumSlone @ Nov 5 2008, 06:04 PM) <{POST_SNAPBACK}></div>
      Check if the gdlib installed correctly on the server where its does not work[/b]
      On non working server is:

      GD Support enabled
      GD Version bundled (2.0.34 compatible)
      FreeType Support enabled
      FreeType Linkage with freetype
      FreeType Version 2.3.5
      T1Lib Support enabled
      GIF Read Support enabled
      GIF Create Support enabled
      JPG Support enabled
      PNG Support enabled
      WBMP Support enabled
      XPM Support enabled
      XBM Support enabled

      on other:

      GD Support enabled
      GD Version bundled (2.0.34 compatible)
      GIF Read Support enabled
      GIF Create Support enabled
      JPG Support enabled
      PNG Support enabled
      WBMP Support enabled
      XPM Support enabled
      XBM Support enabled

      Comment

      Working...
      X