Guest User

Untitled

a guest
Nov 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function saveBig($savefile){
  2. $image=new Gmagick($savefile);
  3.  
  4. $width=$image->getimagewidth();
  5. $height=$image->getimageheight();
  6.  
  7. $standartWidth=1024;
  8. $standartHeight=756;
  9.  
  10. $masWidth=1300;
  11. $masHeight=900;
  12.  
  13. $kw=$width/$masWidth;
  14. $kh=$height/$masHeight;
  15.  
  16. $wx=$width/$kw;
  17. $hy=$height/$kh;
  18.  
  19. $image->setCompressionQuality(75);
  20. $image->resizeimage($wx,$hy,null, 1, true);
  21.  
  22. $x=(($masWidth-$standartWidth)/2);
  23. $y=(($masHeight-$standartHeight)/2);
  24.  
  25.  
  26. $image->cropimage($standartWidth, $standartHeight, $x,$y);
  27. $image->writeimage($savefile);
  28. }
Add Comment
Please, Sign In to add comment