- Successfully imported 1731 WordPress posts to Hugo markdown format - Migrated 204+ images from archive to static directory - Copied standalone directories (curtain, farm, gobbler, house, images, party, revcemetery, railsday, birthday) - Fixed all internal links to use /legacy prefix for archived content - Remapped archive links to point to correct Hugo posts - Fixed Louisville Georgia Cemetery post rendering issue 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?
|
|
function CreateImage($size,$source,$dest,$border=0) {
|
|
$sourcedate = 0;
|
|
$destdate = 0;
|
|
global $convert;
|
|
if (file_exists($dest)) {
|
|
clearstatcache();
|
|
$sourceinfo = stat($source);
|
|
$destinfo = stat($dest);
|
|
$sourcedate = $sourceinfo[10];
|
|
$destdate = $destinfo[10];
|
|
}
|
|
if (!file_exists("$dest") or ($sourcedate > $destdate)) {
|
|
global $ImageTool;
|
|
$imgsize = GetImageSize($source);
|
|
$width = $imgsize[0];
|
|
$height = $imgsize[1];
|
|
|
|
$new_width = $size;
|
|
$new_height = ceil($size * $height / $width);
|
|
if ($ImageTool == "gd") {
|
|
$im = ImageCreateFromJPEG($source);
|
|
$new_im = ImageCreate($new_width,$new_height);
|
|
|
|
ImageCopyResized($new_im,$im,0,0,0,0,$new_width,$new_height,ImageSX($im),ImageSY($im));
|
|
|
|
ImageJPEG($new_im,$dest,75);
|
|
} elseif ($ImageTool == "im") {
|
|
system("$convert -quality 80 -antialias -sample $new_width" . "x" . "$new_height \"$source\" \"$dest\" 2>&1");
|
|
}
|
|
}
|
|
}
|
|
|
|
function checkDir($pathname) {
|
|
$darray = split("/",$pathname);
|
|
for ($x = 1; $x < sizeof($darray); $x++) {
|
|
$checkdir = '';
|
|
for($y = 1; $y <= $x; $y++) {
|
|
$checkdir .= "/" . $darray[$y];
|
|
}
|
|
if (file_exists($checkdir)) {
|
|
} else {
|
|
mkdir($checkdir,0755);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
?>
|