Cropping, rotating, scaling image sizes, and flipping the images vertically or horizontally in wordpress

Cropping, rotating, scaling image sizes, and flipping the images vertically or horizontally in WordPress

 

Generally we have lot of images in our website and we need different sized images, but generally in WordPress we have 3 sized images called as Small, Middle and Actual or Full size.

 

We can also scale down an image to fit a particular size and save a new copy of the image in our directory.

 

WordPress Function

[php]
image_resize( $file, $max_w, $max_h, $crop, $suffix, $dest_path, $jpeg_quality );
[/php]

 

Here in image_resize function first 3 parameter are required and rest are optional depends on your requirement.

 

$crop (boolean)                   Default: false
$suffix (string)                      Default: null
$dest_path (string)             Default: null
$jpeg_quality (int)              Default: 90

 

Note : The PNG transparency will be preserved using the function, as well as the image type. If the file going in is PNG, then the re sized image is going to be PNG.The only supported image types are PNG, GIF, and JPEG.