linccce

resize.php

Apr 21st, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <?php
  2.  
  3. ///////////////////////////////////////////////////////
  4. // FlowerBoy paveiksleliu mazinimo varikliukas v.1.2 //
  5. ///////////////////////////////////////////////////////
  6. $filename = $_GET['f'];
  7.  
  8. if (isset ($_GET['p'])) { $plotis = $_GET['p']; }
  9. if (isset ($_GET['a'])) { $aukstis = $_GET['a']; }
  10. if (isset ($_GET['max'])) {
  11. $dydis = getimagesize ($filename);
  12. if ($dydis['0'] <= $dydis['1']) { $aukstis = $_GET['max']; }
  13. if ($dydis['0'] > $dydis['1']) { $plotis = $_GET['max']; }
  14. }
  15. if (isset ($_GET['min'])) {
  16. $dydis = getimagesize ($filename);
  17. if ($dydis['0'] >= $dydis['1']) { $aukstis = $_GET['min']; }
  18. if ($dydis['0'] < $dydis['1']) { $plotis = $_GET['min']; }
  19. }
  20.  
  21. header("Content-type: image/jpeg");
  22.  
  23. $source = imagecreatefromjpeg($filename);
  24.  
  25. if ($plotis != "") {
  26. $thumbX = $plotis;
  27. $imageX = imagesx($source);
  28. $imageY = imagesy($source);
  29. $thumbY = (int) (($thumbX * $imageY) / $imageX );
  30. }
  31.  
  32. if ($aukstis != "") {
  33. $thumbY = $aukstis;
  34. $imageX = imagesx($source);
  35. $imageY = imagesy($source);
  36. $thumbX = (int) (($thumbY * $imageX) / $imageY );
  37. }
  38.  
  39. $dest = imagecreatetruecolor($thumbX, $thumbY);
  40.  
  41. imagecopyresampled ($dest, $source, 0, 0, 0, 0, $thumbX, $thumbY, $imageX, $imageY);
  42. imagejpeg($dest, "", "100");
  43.  
  44. imagedestroy($dest);
  45. imagedestroy($source);
  46.  
  47. ?>
  48.  
  49. Code is not returning this:
  50. <div class="fotoFullRemas" style="background-position :center; background-image: url('/keleiviu-vezimas-anglija-ispanija.php?f=media/image/keleiviu-vezimas-ispanija/keleiviu-vezimas-ispanija.jpg&amp;min=80'); width: 80px; height: 80px;"><a onclick="window.open('/keleiviu-vezimas.php?fotoid=55','Image','width=1000,height=750,scrollbars=no,toolbar=no,location=no,status=no,resizable=no,screenX=120,screenY=100');return false;" title="keleiviu vezimas ispanija 1" href="#"><img alt="keleiviu vezimas ispanija 1" src="/media/blank.gif" class="fullFoto" style="width: 80px; height: 80px;"></a></div>
  51.  
  52. Anymore after upgrade from 5.3.28 to 5.5.11
Advertisement
Add Comment
Please, Sign In to add comment