Skip to content

Instantly share code, notes, and snippets.

@Mad182
Created January 6, 2023 10:31
Show Gist options
  • Save Mad182/c6a1cca6f9507fa97d00f36757a123b1 to your computer and use it in GitHub Desktop.
Save Mad182/c6a1cca6f9507fa97d00f36757a123b1 to your computer and use it in GitHub Desktop.
<?php
$files = glob('orig/*.jpg');
foreach($files as $file) {
$newname = substr($file, 7, 2) . substr($file, 5, 2) . substr($file, 9);
$txt = substr($file, 5, 2) . '.' . substr($file, 7, 2) . '.' . substr($file, 9, 4);
exec('convert '.$file.' -resize 666x1170 \( xc:transparent -font PT_Sans-Narrow-Web-Bold.ttf -pointsize 50 -fill black -draw "rotate -4 text 20,60 '."'".$txt."'".'" -blur 0x1 \) -geometry +2+2 -composite -font PT_Sans-Narrow-Web-Bold.ttf -fill white -pointsize 50 -draw "text 20,60 '."'".$txt."'".'" renamed/'.$newname);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment