Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Joel Alejandro

By: a guest on Jan 19th, 2010  |  syntax: PHP  |  size: 0.50 KB  |  hits: 52  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. ## thumbnail.php
  4.  
  5. require("csImage.lib.php");
  6.  
  7. header("Content-Type: image/jpeg"); # Change content-type according to your image.
  8.  
  9. # Parameters:
  10. #
  11. # $image: the filename of the image to open.
  12. # $scale: "w" for scaling by width, "h" for scaling by height.
  13. # $sizeInPixels: max size of the given proportion at $scale.
  14. # $writeToNewFile: true for creating an image file and returning the path, false for returning the image binary content.
  15.  
  16. echo csImage::scaleImage($image, "h", 100, false);
  17.  
  18. ?>