/    Sign up×
Community /Pin to ProfileBookmark

A question about thumbnials.

I am displaying all the images on my site as h = 150 w = 200.

It seems that I am wasting disc space by storing the full images and them displaying them smaller.

The images are uploaded by the user.

Is it possible to create a thumbnail with the uploaded image and then just save the thumbnail and discard (delete ? ) the uploaded image ?

Thanks.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@jeddikauthorAug 07.2006 — What I mean is ...

When uploading an image you end up with:
[code=php]
$destination = 'D:Webimages'."\".$temp_image;
$temp_file = $_FILES['upLoad1']['tmp_name'];
move_uploaded_file($temp_file,$destination);[/code]



Then to process the thubmnail you might start with:
[code=php]
$image_info = getImageSize($o_file).[/code]


Could I leave out the "move_uploaded_file()" and just process

the temp_file ?

EG
[code=php]
$o_file = $_FILES['upLoad1']['tmp_name'];

$image_info = getImageSize($o_file);
//...
imageCreateFromGIF($o_file)
//...[/code]


That way I never even upload the file - just use it to make a thumbnail version.

???
×

Success!

Help @jeddik 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 5.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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