Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to: auto get image size/resolution/etc and print  (Read 3518 times)

0 Members and 1 Guest are viewing this topic.

And 1

    Topic Starter


    Rookie

    how to: auto get image size/resolution/etc and print
    « on: March 16, 2009, 10:53:52 PM »
    You know 4chan.org (http://orz.4chan.org/hr/imgboard.html).  It thumbnails picturs and shows the details of the original.  Below the small thumbail it will say something like:  File :1237263364.jpg-(415 KB, 2000x1600, test.jpg)

    How do you do that?

    Use getimagesize() function? (http://us2.php.net/manual/en/function.getimagesize.php)

    Do you need php or just HTML? 

    Can someone show me an example of how do it with a 1 picture gallery?

    thanks

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: how to: auto get image size/resolution/etc and print
    « Reply #1 on: March 17, 2009, 03:33:59 AM »
    Use getimagesize() function? (http://us2.php.net/manual/en/function.getimagesize.php)

    Exactly. HTML cannot do it.

    Can someone show me an example of how do it with a 1 picture gallery?

    The link above shows plenty of examples to get you going.

    And 1

      Topic Starter


      Rookie

      Re: how to: auto get image size/resolution/etc and print
      « Reply #2 on: March 17, 2009, 02:28:12 PM »
      i figured it out.  Here is an exmple of a working one on a blank page.  Just one image and to the right of it it says "800x500"

      <?php

      list($width, $height, $type, $attr) = getimagesize("test.jpg");
      echo "<img src=\"test.jpg\" />";
      echo $width; echo 'x'; echo $height;

      ?>

      kpac

      • Web moderator
      • Moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: how to: auto get image size/resolution/etc and print
      « Reply #3 on: March 17, 2009, 02:39:07 PM »
      Good job. :D