#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    28
    Rep Power
    0

    Vague and blurred picture


    ,

    In HTML I make the width and height of an image equal: 100px.
    But this returns a problem viewing this picture and it gets vague and blurry.

    The solution I have now is by using paint.
    I look at the size of picture and make new file with, then I put the image in the center.

    Is there any other way to automatise this on server/client side using HTML, CSS or PHP?

    Thanks in advance
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    28
    Rep Power
    0
    Here's a solution if u decide the width to be 100px.

    PHP Code:


    function gmp_gcd($a$b) {
        while (
    $b != 0) {
            
    $remainder $a $b;
            
    $a $b;
            
    $b $remainder;
        }
        return 
    abs($a);
    }



    $a $w// the original width
    $b $h// the original height

    $gcd gmp_gcd($a$b);
    $a $a/$gcd;
    $b $b/$gcd;
    $aspect_ratio $b $a;

    // thumbnail


    $t_h 100 $aspect_ratio

IMN logo majestic logo threadwatch logo seochat tools logo