Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged resize
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« 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
956
posted 11 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
1265
posted 11 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
1072
posted 13 years ago by TimoZachi
The following script will easily allow you to resize images using PHP.
3
867
posted 13 years ago by enkas
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
1351
posted 14 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
846
posted 14 years ago by stz184
Creating thumbnails of the images is required many a times, this code will be useful to know about the logic of thumbnail generation.
0
949
posted 15 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
1062
posted 16 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
817
posted 17 years ago by dmlanger
« Prev 1 Next »