Fragment of code in uniload.php, noting that I also updated picmgmt.inc.php below if (isset($result['error'])) { if (isset($result['halt_upload'])) { // KF Add code to, if single upload, redirect back to upload page with message if image too high/wide // KF Otherwise call errorOut as before if (($upload_form == 'upload_sgl') && ($result['halt_upload']==2)) { $msg = sprintf($lang_db_input_php['err_fsize_too_large'], $CONFIG['max_upl_width_height'], $CONFIG['max_upl_width_height']); $redirect = "upload.php?album=" . $album; cpgRedirectPage($redirect, $lang_db_input_php['info'], $msg, 1, 'warning'); } else { errorOut($result['error'], $result['halt_upload'], __FILE__, __LINE__); } } else { errorOut($result['error'], 0, __FILE__, __LINE__); } } else { errorOut($lang_upload_php['no_place'] .'*'. $path_to_image .'*'.$uploaded_pic , 0, __FILE__, __LINE__); } Fragment of code from picmgmt.inc.php The change is to return a code of 2 for halt_upload to signal this error. A bit messy but it works. // resize picture if it's bigger than the max width or height for uploaded pictures if (max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']) { if ((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1) || (!USER_IS_ADMIN && $CONFIG['auto_resize'] > 0)) { $resize_method = $CONFIG['picture_use'] == "thumb" ? ($CONFIG['thumb_use'] == "ex" ? "any" : $CONFIG['thumb_use']) : $CONFIG['picture_use']; resize_image($image, $image, $CONFIG['max_upl_width_height'], $resize_method, 'false'); $imagesize = cpg_getimagesize($image); } elseif (USER_IS_ADMIN) { // skip resizing for admin $picture_original_size = true; } else { @unlink($uploaded_pic); $msg = sprintf($lang_db_input_php['err_fsize_too_large'], $CONFIG['max_upl_width_height'], $CONFIG['max_upl_width_height']); // KF Change code below from 1 to 2 for case when file is too wide/high return array('error' => $msg, 'halt_upload' => 2); } }