You are now rendering stylesheet gallery images.
The used parameters can be seen on the right, returned statuses are displayed below.
= $Style['Name'] ?>
Build preview: $CmdLine = '/usr/bin/phantomjs "' . dirname(__FILE__) . '/render_build_preview.js" "' . SERVER_ROOT . '" "' . STATIC_SERVER . '" "' . $Style['Name'] . '" "' . dirname(__FILE__) . '"'; $BuildResult = json_decode(shell_exec(escapeshellcmd($CmdLine)), true); switch ($BuildResult['status']) { case 0: echo 'Success.'; break; case -1: echo 'Err -1: Incorrect paths, are they passed correctly?'; break; case -2: echo 'Err -2: Rendering base does not exist. Who broke things?'; break; case -3: echo 'Err -3: No permission to write to preview folder.'; break; case -4: echo 'Err -4: Failed to store specific preview file.'; break; default: echo 'Err: Unknown error returned'; } ?>
//If build was successful, snap a preview. if ($BuildResult['status'] === 0) { ?>Snap preview: $CmdLine = '/usr/bin/phantomjs "' . dirname(__FILE__) . '/render_snap_preview.js" "' . SERVER_ROOT . '" "' . STATIC_SERVER . '" "' . $Style['Name'] . '" "' . dirname(__FILE__) . '"'; $SnapResult = json_decode(shell_exec(escapeshellcmd($CmdLine)), true); switch ($SnapResult['status']) { case 0: echo 'Success.'; $CmdLine = '/usr/bin/convert "' . $ImagePath . '/full_' . $Style['Name'] . '.png" -filter Box -resize 40% -quality 94 "' . $ImagePath . '/thumb_' . $Style['Name'] . '.png"'; $ResizeResult = shell_exec(escapeshellcmd($CmdLine)); if ($ResizeResult !== null) { echo ' But failed to resize image'; } break; case -1: echo 'Err -1: Incorrect paths. Are they passed correctly? Do all folders exist?'; break; case -2: echo 'Err -2: Preview file does not exist; running things in the wrong order perhaps?'; break; case -3: echo 'Err -3: Preview is empty; did it get created properly?'; break; case -4: echo 'Err -4: No permission to write to preview folder.'; break; case -5: echo 'Err -5: Failed to store full image.'; break; case -6: echo 'Err -6: Cannot find temp file to remove; are the paths correct?'; break; default: echo 'Err: Unknown error returned.'; } ?>
} ?>