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 540 posted 9 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 723 posted 9 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 646 posted 11 years ago by TimoZachi
Tweaked from the icant.co.uk thumbnail generator
0 482 posted 11 years ago by dillonchr
Resize and image to fit a predetermined canvas size
0 626 posted 11 years ago by flatearthcomms
The following script will easily allow you to resize images using PHP.
3 488 posted 12 years ago by enkas
I edit this from tylerhall on 11/30/-1
0 444 posted 12 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 756 posted 12 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 488 posted 12 years ago by stz184
1 557 posted 12 years ago by rave
0 403 posted 12 years ago by metoikos
This properly handles transparencies for PNG/GIF.
0 494 posted 13 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 542 posted 13 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 552 posted 14 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 416 posted 15 years ago by dmlanger
get the image size and reduces it dynamically
3 584 posted 15 years ago by valcartei
« Prev 1 Next »