Created
July 23, 2016 18:00
-
-
Save ericstone57/4079c7a9bf6b08dfa184d2e74d60379e to your computer and use it in GitHub Desktop.
Revisions
-
ericstone57 created this gist
Jul 23, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ <?php $from = 1; $to = 360; $figure_lenght = 4; $pic_one_row = 3; $file_prefix = "output_"; $file_extension = ".jpg"; $output_folder = "./result/"; $output_index = 1; while ($from < $to) { $str_pics = ''; for ($i = 0; $i < $pic_one_row; $i++) { $filename = $file_prefix.str_pad($from+$i, $figure_lenght, 0, STR_PAD_LEFT).$file_extension; if (file_exists("./".$filename)) { $str_pics .= $filename." "; } } exec("convert $str_pics +append $output_folder/result_" . str_pad($output_index, $figure_lenght, 0, STR_PAD_LEFT) . ".jpg"); print $output_index ."\n"; $output_index++; $from += $pic_one_row; }