Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 19  |  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. class JPEGEncoder
  4.  
  5. {
  6.  
  7.         function JPEGEncoder ( )
  8.        
  9.         {
  10.        
  11.         }
  12.        
  13.         /**
  14.         @desc save the JPEG on server
  15.         */
  16.         function saveToServer ( $pInfos )
  17.        
  18.         {
  19.                
  20.                 $bytearray = $pInfos["jpegstream"];
  21.                 // bytearray is in the ->data property
  22.                 $imageData = $bytearray->data;
  23.                 $idimage = $pInfos["fileName"];
  24.                
  25.                 return ( $success = file_put_contents("../../../".$idimage, $imageData) ) ? $idimage : $success;
  26.          
  27.         }
  28.  
  29. }
  30.  
  31. ?>