Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged resize



« Prev 1 Next »
Returns array with information like: Input image width 200 height 200 print_r(ratioResize('path/to/image.ext' , 100 , 50)); output: array( [ratio] => .5, [height] => 50, [width] => 50,...
0 2721 posted 13 years ago by ShawnG
This is my simple image resizer on the fly thing. -- WARNING -- Resizing and showing images on the fly could potentially kill your server or make the website slow. Ideally, this should save the resized image in a cache. However, more often th...
0 3125 posted 13 years ago by brownrl
A function that resizes an image to desired width and height, but does not distort the image proportions. Works for JPEG, GIF and PNG.
0 2081 posted 14 years ago by TimoZachi
Tweaked from the icant.co.uk thumbnail generator
0 1719 posted 14 years ago by dillonchr
Resize and image to fit a predetermined canvas size
0 2209 posted 15 years ago by flatearthcomms
The following script will easily allow you to resize images using PHP.
3 2013 posted 15 years ago by enkas
I edit this from tylerhall on 11/30/-1
0 1549 posted 15 years ago by redoc
I’ve made this function that receive the input $video string that contains the dirty embed code as it is from youtube. The second parameter $new_width (if specified) permits to resize the embed code proportionally to the width you need for your tem...
0 2577 posted 15 years ago by ginoplusio
If the optional parameter $crop is set to TRUE the image will be zoomed and cropped to specific size ($new_size). Else, the image will be resized to size, keeping aspect ratio and using $new_size as max size.
0 1789 posted 15 years ago by stz184
1 2156 posted 15 years ago by rave
0 1439 posted 15 years ago by metoikos
This properly handles transparencies for PNG/GIF.
0 1604 posted 16 years ago by gms8994
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0 1860 posted 16 years ago by paulgrenwood
To use the resize function you must pass in the forced width, forced height, source image, and destination image. The function then uses the GD2 library functions to read the source image's size. It will then calculate the new image's size based off...
3 3423 posted 17 years ago by Jenhale
This function will return the height and width of an image that will change if the height/width is greater than the maximum supplied width and height.
2 1759 posted 18 years ago by dmlanger
get the image size and reduces it dynamically
3 2056 posted 18 years ago by valcartei
« Prev 1 Next »