/    Sign up×
Community /Pin to ProfileBookmark

making a photo album

I’m at it again guys! New project, i’m making a photo album! I think i have almost everything figured out, but what I need is a good method to take an image that is on the server and create another, simpler image of it that is scaled down.

I tried just going

[code]<img src=”” width=”50″ height=”50″>[/code]

but image still takes some time to load, thus defeating the purpose of creating a thumbnail at all.

not sure if php is what i need for this one… I dunno, what do u guys think? I’ve read a bnit about image maps, is this what i need?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@SpectreReturnsMay 05.2005 — Heres a script I wrote to create thumbnails. You'll need to fill in the missing variables.

[code=php]
$img = ImageCreateTrueColor($site['p_width'],$site['p_height']);
switch($ext[1]) {
case "jpg":
$src = ImageCreateFromJPEG($location);
break;
case "jpeg":
$src = ImageCreateFromJPEG($location);
break;
case "png":
$src = ImageCreateFromPNG($location);
break;
case "gif":
$src = ImageCreateFromGIF($location);
break;
}
$size = GetImageSize($location);
ImageCopyResized($img,$src,0,0,0,0,$site['p_width'],$site['p_height'],$size[0],$size[1]);
ImagePNG($img,'images/photos/thumbs/'.$ext[0].'.png');
[/code]
×

Success!

Help @gameguy43 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...