How can I crop the an uploaded profile picture automatically into different sizes so that I have different versions of the picture on the server to show it in differnt positions and sizes on the website? Is there some plugin available to help me to archieve the required functionality?
WordPress is croping all uploaded pictures automatically into few predefined sizes. The default sizes are:
Thumbnail: 150px x 150px
Medium: 300px x 300px
Large: 1024px x 1024px
You can change these default sizes in the Media Settings area.
Some Themes add individual sizes to these default sizes. If you wish to add individual sizes per code you need to add some lines of code in the functions.php
add_image_size( $name, $width, $height, $crop);
$name Thats a simple string where you can give it a name
$width Thats an integer number where you can specify the width in pixel i.e. 50
$height Thats an interger number where you can specify the height in pixel i.e. 50
$crop boolean write true if you want to crop the picture, otherwise write false
Please bear in mind that the number of individual croped sizes will increase the number of pictures created per upload. It is also not possible to crop picture that already have been uploaded before by this method as this function only crops the picture in case of upload of a new picture.
There is some plugin available that can crop also images that have been already uploaded before. Please check the plugin "Automatically regenerate all your imgae thumbnails". https://wordpress.org/plugins/regenerate-thumbnails/
This plugin may help you to resize the existing and already uploaded pictures.
Please login or Register to submit your answer