showimg.inc 620 B

123456789101112131415
  1. <?php
  2. $info = getimagesize($post);
  3. $ratio = round($info[0]/$info[1],2);
  4. $parent = dirname($post);
  5. if ($ratio == 1.00) {
  6. echo "<img alt=\"$post\" src=\"$post\" height=100% width=100% />";
  7. } elseif ($ratio > 1.00) {
  8. $ht = (1.20-($ratio-1))*100;
  9. echo "<img alt=\"$post\" src=\"$post\" height=$ht% width=100% />";
  10. } else {
  11. $wd = 100-(($ratio-1)*100);
  12. echo "<img alt=\"$post\" src=\"$post\" style=\"padding-left: auto; padding-right: auto;\" />";
  13. }
  14. echo "<a title=back href=\"index.php?nav=1&dir=$parent\"><img alt=back src=".$icondir."tsfolder-up.gif /></a>".basename($post)."&nbsp".$info[0]."x".$info[1]."<hr />";
  15. ?>