ProPeler
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
tmp
/
Filename :
compress.php
back
Copy
<?php foreach (glob("/var/www/html/wp-content/themes/bayisihat-jurnal/assets/*.jpg") as $p) { $im = @imagecreatefromjpeg($p); if (!$im) { echo "skip ".basename($p)."\n"; continue; } $w = imagesx($im); $h = imagesy($im); $max = 1400; if ($w > $max) { $r = imagescale($im, $max, intval($h*$max/$w)); imagejpeg($r, $p, 82); imagedestroy($r); } else { imagejpeg($im, $p, 82); } imagedestroy($im); echo basename($p)." -> ".intval(filesize($p)/1024)."KB\n"; }