Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development

Reply
 
Thread Tools

image manipulation in php
Old 30.10.2002, 04:37   #1
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Question image manipulation in php

как можно на php сделать thumbnail картинки, т.е. есть картинка(jpg или gif), надо поменять(уменьшить) размеры(dimensions)

Old 30.10.2002, 05:45   #2
VX
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Rep Power: 0
Post

http://www.php.net/manual/en/ref.image.php
__________________
Праздник к нам приходит...

|^^^^^^^^^'''^\| ||\__
| ВОДКА-ВОДКА | ||','''|'''''''\_____,_
| _..... _ | ||_ _|'__|_____||.........| |
'(@)'(@)'(@)''''''''''''''''''''''*|(@)""""|(@)*

Old 30.10.2002, 06:25   #3
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Rep Power: 0
Post

imagecopyresized
(PHP 3, PHP 4 )

imagecopyresized -- Copy and resize part of an image
Description
int imagecopyresized ( resource dst_im, resource src_im, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)

imagecopyresized() copies a rectangular portion of one image to another image. Dst_im is the destination image, src_im is the source image identifier. If the source and destination coordinates and width and heights differ, appropriate stretching or shrinking of the image fragment will be performed. The coordinates refer to the upper left corner. This function can be used to copy regions within the same image (if dst_im is the same as src_im) but if the regions overlap the results will be unpredictable.

See also imagecopyresampled().

User Contributed Notes
imagecopyresized
plusplus7 at hotmail dot com
25-Sep-1999 04:10

saw this one on the ng and it works fine - just trying to figure it out for jpg.
Code:
<? 
$new_w=100; 
$new_h=100; 

header(&quot;Content-type: image/gif&quot;); 

$dst_img=ImageCreate($new_w,$new_h); 

$src_img=ImageCreateFromGif(&quot;./imgtest.gif&quot;); 

ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); 

ImageGif($dst_img); 

?>
source : http://www.php.net/manual/en/functio...opyresized.php
take a look
__________________
[x]-=-[ ]-=-[x]

Old 30.10.2002, 17:38   #4
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Smile

спасибо, весь мануал у меня есть, я это там искал,проглядел видимо :]

Old 31.10.2002, 02:54   #5
VX
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Rep Power: 0
Post

Abyss jan v tvoem scripte potechialnaya problema "memory leak-a", obyazatel'no nado oputreblyat' funkchiuu ImageDestroy($img_handle) posle output-a
__________________
Праздник к нам приходит...

|^^^^^^^^^'''^\| ||\__
| ВОДКА-ВОДКА | ||','''|'''''''\_____,_
| _..... _ | ||_ _|'__|_____||.........| |
'(@)'(@)'(@)''''''''''''''''''''''*|(@)""""|(@)*

Old 31.10.2002, 04:42   #6
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Rep Power: 0
Post

Quote:
Originally posted by VX:
Abyss jan v tvoem scripte potechialnaya problema "memory leak-a", obyazatel'no nado oputreblyat' funkchiuu ImageDestroy($img_handle) posle output-a
Kто сказал что это мой скрипт? : User Contributed Notes
__________________
[x]-=-[ ]-=-[x]

Old 02.11.2002, 05:17   #7
VX
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Rep Power: 0
Post

Quote:
Originally posted by Dark Abyss of Yerevan:
Quote:
Originally posted by VX:
Abyss jan v tvoem scripte potechialnaya problema "memory leak-a", obyazatel'no nado oputreblyat' funkchiuu ImageDestroy($img_handle) posle output-a
Kто сказал что это мой скрипт? : User Contributed Notes
V TVOEM PREDSTAVLENNOM SCRIPTE,
Is it clear now?
__________________
Праздник к нам приходит...

|^^^^^^^^^'''^\| ||\__
| ВОДКА-ВОДКА | ||','''|'''''''\_____,_
| _..... _ | ||_ _|'__|_____||.........| |
'(@)'(@)'(@)''''''''''''''''''''''*|(@)""""|(@)*
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 12:07.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.