|
|
|
| php and image resizing | |
Posted: 06-25-2002 11:39 AM |
|
|
Shn |
R.I.P. |
|
|
Joined: 10 Feb 2002 |
Posts: 738 |
|
|
|
|
|
|
|
I was wondering how i could create a thumbnail of pics.
The pics are in the folder root/pics.
The thumbnails would be in root/pics/thumbnails.
now, i've read about imageCopyResized function.
But it doesn't seem to work on my server and i've got no idea why.
So, if there's a way to recreate this function, or any other way to create thumbnails, i'd like to know.
(These thumbnails would be created when the pics are uploaded.)
Yes, it's for the imagearchive thing. |
|
|
|
|
Posted: 06-29-2002 02:57 AM |
|
|
TuMTuM |
Will code HTML for food! |
|
|
Joined: 17 Feb 2002 |
Posts: 425 |
|
|
|
|
|
|
|
Try using apache and php first, maybe that helps, but since Im making a site for my dad and it has to be complete on friday, I cant really try. If youre stuck, try looking at the sources on http://www.hotscripts.com cause they have some of those scripts for sure. |
|
|
|
|
Posted: 06-29-2002 08:03 AM |
|
|
Shn |
R.I.P. |
|
|
Joined: 10 Feb 2002 |
Posts: 738 |
|
|
|
|
|
|
|
k thanks, i already looked at a few scripts on other sites.
I guess i just have to think a little to find out, as it doesn't look too difficult... |
|
|
|
|
| | |
Posted: 09-21-2002 08:13 AM |
|
|
js995 |
Deletes your posts |
|
|
Joined: 10 Feb 2002 |
Posts: 226 |
|
|
|
|
|
|
|
if you are still doing this, you should look into the GD library.
THIS MUST BE INSTALLED TO MANIPULATE GRAPHICS IN PHP ! ..
the function that is probably most use for this is ... (syntax)
int ImageCopyResized(int dst_im, int src_im, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, intsrcH);
so .. um .. to make a image twice as small as it is at the moment ..
<?php
$size = GetImageSize("theexistingimage.gif");
$im_in = ImageCreateFromGif("theexistingimage.gif");
$im_out = ImageCreate($size[0] / 2, $size[1] /2);
$ImageCopyResized ($im_out, $im_in, 0, 0, 0, 0, $size[0] / 2, $size[1] / 2, $size[0], $size[1]);
ImageGif($im_out, "outputthumbnail.gif");
ImageDestroy($im_in);
ImageDestroy($im_out);
?>
Disclaimer : Havent tested this..
if you have any more questions e-mail me,
js
btw, if its just a a server problem, php can be added to with the GD as following ...
C:\php\extensions>dir *gd*
Directory of C:\php\extensions
06/09/2002 10:50 AM 471,040 php_gd.dll
06/09/2002 11:02 AM 659,456 php_gd2.dll
php 4.2.3 / apache 2.0.40
then uncomment
;extension=php_gd.dll
(on my system: around line 456 of php.ini, using recommended)
or change it to php_gd2 if you need the extra functions |
|
|
|
|
| | |
Posted: 09-21-2002 11:49 AM |
|
|
Shn |
R.I.P. |
|
|
Joined: 10 Feb 2002 |
Posts: 738 |
|
|
|
|
|
|
|
Hmmm hi js, nice to see you again :)
Now that's an old thread, and as you can maybe see in the image archive, i found out the answer, and i do use the GD library to resize images... I could make it better (including quality...)... but i'm lazy :D
K, end.
Oh and thanks for your help :) |
|
|
|
|
Mindcontroll Forum Index » Programs/Programming Development |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You can vote in polls in this forum
|
All times are GMT - 5 Hours
Page 1 of 1
|
|
|
|
|
Video Games Suck - XXXSwim - Archive |
Powered by phpBB © 2001-2005 phpBB Group. |
Designed for Trushkin.net | Themes Database |
|