Jump to content


Photo

Thumbnails


  • Please log in to reply
2 replies to this topic

#1 han003

han003

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 January 2013 - 07:02 PM

Hi!

After I've gotten an image from my database I'd like to make it small like a thumbnail, say 200x100, instead of 1920x1080.
And after I've resized it I'd like to put it inside an <img>, this is like a gallery, with several rows of pictures. Any who can help?
Thanks!

#2 Psycho

Psycho

    Advanced Member

  • Gurus
  • 10,384 posts
  • LocationCanada

Posted 21 January 2013 - 07:23 PM

This forum is for people to get help with code they have written. Are you looking for someone to do this for you? If so, we can move this to the freelance forum.

If you are wanting to do this yourself, then we are willing to help. But, you have to at least make an effort. There are plenty of tutorials out there on this subject. And, there are plenty of posts on this forum where the same question/problem has been raised. In fact, there was one today! Have you read a tutorial or other forum post and having a problem understanding part of it?

What have you done already?
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#3 han003

han003

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 January 2013 - 08:20 PM

THere's my code
I get an image from a folder but some of them are big, like over 1mb, so id like to make just thumbnails and show the thumbnails in the <img> tag, but if you're not willing to help then by all mean put this in the other forum
thank you :)

<?php
  $counter = 0;
 
  echo '<table><tr>';
  foreach(glob("../Pics/Wallpapers/*.*") as $filename){

    if ( $counter%5 == 0){
	 echo '</tr><tr><td>';
    } else{
	 echo '<td>';
    }
   
    echo '<div id="thumbs"><div id="image">';
    echo '<a href="'. $filename .'"><img src="'. $filename .'" height="180" width="320" /></a></div>';
    echo '<div id="text"><span>'. filesize($filename) .'</span></div></div>';
   
    echo '</td>';
    $counter++;
   }
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com