CKFinder is an excellent companion for CKEditor and allows you to set the maximum size of the loaded image in the configuration .
If you do not want to use this, you yourself will resize the image to PHP using the following:
<?php $maxWidth = 250; $maxHeight = 500; $size = getimagesize($url); if ($size) { $imageWidth = $size[0]; $imageHeight = $size[1]; $wRatio = $imageWidth / $maxWidth; $hRatio = $imageHeight / $maxHeight; $maxRatio = max($wRatio, $hRatio); if ($maxRatio > 1) { $outputWidth = $imageWidth / $maxRatio; $outputHeight = $imageHeight / $maxRatio; } else { $outputWidth = $imageWidth; $outputHeight = $imageHeight; } } ?>
From: Arbitrary image resizing in PHP
source share