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 96 posted 7 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 133 posted 7 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 115 posted 8 years ago by TimoZachi
Tweaked from the icant.co.uk thumbnail generator
0 75 posted 8 years ago by dillonchr
Resize and image to fit a predetermined canvas size
0 99 posted 9 years ago by flatearthcomms
The following script will easily allow you to resize images using PHP.
3 77 posted 9 years ago by enkas
I edit this from tylerhall on 11/30/-1
0 72 posted 9 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 130 posted 9 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 79 posted 9 years ago by stz184
This properly handles transparencies for PNG/GIF.
0 69 posted 10 years ago by gms8994
Can't seem to remember where I found this and it's no longer in my bookmarks. If you know where this came from please provide the link so credit can go to the right person.
1 76 posted 10 years ago by The14thGOD
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0 68 posted 10 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 75 posted 11 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 53 posted 12 years ago by dmlanger
get the image size and reduces it dynamically
3 96 posted 12 years ago by valcartei
« Prev 1 Next »