$limitSize) or ($imgHeight > $limitSize)) ) { try { if (!file_exists($tmbPath)) { $img = new SimpleImage($imgPath); $pathinfo = pathinfo($srcImg); if (!file_exists($rootPath . '/thumbs' . $pathinfo['dirname'])) { mkdir($rootPath . '/thumbs' . $pathinfo['dirname'], 0755, true); } $img->best_fit($limitSize, ($limitSize / 4 * 3))->save($tmbPath, 75); $img = null; } return '' . $altImg . '' . "\n"; } catch (exception $e) { echo '\n"; return '' . $altImg . '' . "\n"; } } else { return '' . $altImg . '' . "\n"; } } $content = preg_replace_callback('/]+>/i', 'xreplace', $content); return $content; } ?>