/** * Resize Image and create the file on the resized folder * * @param Int $userID * @param String $file * @param $destWidth * @param $destHeight * @param null $sourceX * @param null $sourceY * @param null $sourceWidth * @param null $sourceHeight * @return Resized File name * @internal param Int $width * @internal param Int $height */ public function resizeImage($userID, $file, $destWidth, $destHeight, $sourceX = null, $sourceY = null, $sourceWidth = null, $sourceHeight = null) { // Get the image size for the current original photo list($currentWidth, $currentHeight, $destType) = getimagesize(DIR_FS_PHOTO . "users/" . $userID . "/original/" . $file); $destType = image_type_to_mime_type($destType); // Find the correct x/y offset and source width/height. Crop the image squarely, at the center. if (!$sourceWidth) { $sourceWidth = $currentWidth; } if (!$sourceHeight) { $sourceHeight = $currentHeight; } //Create Thumbnail; BuckysPost::createThumbnail($userID, $file); $destPath = DIR_FS_PHOTO . "users/" . $userID . "/resized/" . $file; return buckys_resize_image(DIR_FS_PHOTO . "users/" . $userID . "/original/" . $file, $destPath, $destType, $destWidth, $destHeight, $sourceX, $sourceY, $sourceWidth, $sourceHeight); }