Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 30.10.2002, 04:37   #1
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Question image manipulation in php

как можно на php сделать thumbnail картинки, т.е. есть картинка(jpg или gif), надо поменять(уменьшить) размеры(dimensions)
Reply With Quote
Old 30.10.2002, 05:45   #2
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

http://www.php.net/manual/en/ref.image.php
Reply With Quote
Old 30.10.2002, 06:25   #3
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Downloads: 0
Uploads: 0
Reputation: 0 | 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]
Reply With Quote
Old 30.10.2002, 17:38   #4
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Smile

спасибо, весь мануал у меня есть, я это там искал,проглядел видимо :]
Reply With Quote
Old 31.10.2002, 02:54   #5
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Abyss jan v tvoem scripte potechialnaya problema "memory leak-a", obyazatel'no nado oputreblyat' funkchiuu ImageDestroy($img_handle) posle output-a
Reply With Quote
Old 31.10.2002, 04:42   #6
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Downloads: 0
Uploads: 0
Reputation: 0 | 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
Reply With Quote
Old 02.11.2002, 05:17   #7
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Downloads: 0
Uploads: 0
Reputation: 0 | 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 With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 02:55.


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