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 2729 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 3137 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 2090 posted 14 years ago by TimoZachi
Tweaked from the icant.co.uk thumbnail generator
0 1732 posted 14 years ago by dillonchr
Resize and image to fit a predetermined canvas size
0 2235 posted 15 years ago by flatearthcomms
The following script will easily allow you to resize images using PHP.
3 2023 posted 15 years ago by enkas
I edit this from tylerhall on 11/30/-1
0 1558 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 2590 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 1804 posted 15 years ago by stz184
1 2165 posted 15 years ago by rave
0 1447 posted 15 years ago by metoikos
This properly handles transparencies for PNG/GIF.
0 1618 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 1870 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 3437 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 1774 posted 18 years ago by dmlanger
get the image size and reduces it dynamically
3 2066 posted 18 years ago by valcartei
« Prev 1 Next »