document.write("<div class=\"pastie\">\n");
document.write("  <link href=\"http://pastie.org/stylesheets/embed.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  <link href=\"http://pastie.org/stylesheets/clean.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  \n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("	\n");
document.write("	<div class=\"allcode\">\n");
document.write("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n");
document.write("		<tr>\n");
document.write("			<td>\n");
document.write("				\n");
document.write("				<pre class=\"textmate-source-numbers\">1\n");
document.write("2\n");
document.write("3\n");
document.write("4\n");
document.write("5\n");
document.write("6\n");
document.write("7\n");
document.write("8\n");
document.write("9\n");
document.write("10\n");
document.write("11\n");
document.write("12\n");
document.write("13\n");
document.write("14\n");
document.write("15\n");
document.write("16\n");
document.write("17\n");
document.write("18\n");
document.write("19\n");
document.write("20\n");
document.write("21\n");
document.write("22\n");
document.write("23\n");
document.write("24\n");
document.write("25\n");
document.write("26\n");
document.write("27\n");
document.write("28\n");
document.write("29\n");
document.write("<\/pre>\n");
document.write("			<\/td>\n");
document.write("		<td>\n");
document.write("		<pre class=\"textmate-source\"><pre class=\"sunburst\"><span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'>#!/bin/sh<\/span>\n");
document.write("\n");
document.write("echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;=== Start batch processing ===&quot;<\/span><span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span>\n");
document.write("\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>if<\/span> [ <span class=\'keyword keyword_operator keyword_operator_pipe keyword_operator_pipe_shell\'>!<\/span> -d <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;./output&quot;<\/span> ]<span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span> <span class=\'keyword keyword_control keyword_control_shell\'>then<\/span>\n");
document.write("    mkdir output\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>fi<\/span>\n");
document.write("\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>while<\/span> [ <span class=\'variable variable_other variable_other_special variable_other_special_shell\'>$#<\/span> -ge 1 ]<span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span> <span class=\'keyword keyword_control keyword_control_shell\'>do<\/span>\n");
document.write("\n");
document.write("    echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;Process file <span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span>&quot;<\/span><span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span>\n");
document.write("\n");
document.write("    <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'># Меняем размеры в зависимости от ориентации фотографии<\/span>\n");
document.write("    <span class=\'keyword keyword_control keyword_control_shell\'>if<\/span> [ <span class=\'string string_interpolated string_interpolated_backtick string_interpolated_backtick_shell\'>`identify -format &quot;%w&quot; $1`<\/span> -lt <span class=\'string string_interpolated string_interpolated_backtick string_interpolated_backtick_shell\'>`identify -format &quot;%h&quot; $1`<\/span> ]<span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span> <span class=\'keyword keyword_control keyword_control_shell\'>then<\/span>\n");
document.write("        convert ./<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span> -resize x800 ./output/<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span>\n");
document.write("        echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;converted to x800&quot;<\/span><span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span>\n");
document.write("    <span class=\'keyword keyword_control keyword_control_shell\'>else<\/span>\n");
document.write("        convert ./<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span> -resize 1000 ./output/<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span>\n");
document.write("        echo <span class=\'string string_quoted string_quoted_double string_quoted_double_shell\'>&quot;converted to 1000x&quot;<\/span><span class=\'keyword keyword_operator keyword_operator_list keyword_operator_list_shell\'>;<\/span>\n");
document.write("    <span class=\'keyword keyword_control keyword_control_shell\'>fi<\/span>\n");
document.write("\n");
document.write("    <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'># Накладываем прозрачное PNG-изображение с копирайтом в правый нижний угол<\/span>\n");
document.write("    composite -size 1000 -gravity SouthEast /home/feedbee/cleshe.png ./output/<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span> ./output/<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span>\n");
document.write("\n");
document.write("    <span class=\'comment comment_line comment_line_number-sign comment_line_number-sign_shell\'># Если права на запись не даются по умолчанию, даем их, чтобы можно было запускать скрипт на перезапись<\/span>\n");
document.write("    chmod 0644 ./output/<span class=\'variable variable_other variable_other_positional variable_other_positional_shell\'>$1<\/span>\n");
document.write("\n");
document.write("shift\n");
document.write("<span class=\'keyword keyword_control keyword_control_shell\'>done<\/span>\n");
document.write("<\/pre><\/pre>\n");
document.write("		<\/td>\n");
document.write("		<\/tr>\n");
document.write("		<\/table>\n");
document.write("	\n");
document.write("	<\/div>\n");
document.write("\n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("  <div class=\"credit\">\n");
document.write("    <div class=\"buttons\">\n");
document.write("      <a href=\"http://pastie.org/pastes/660242.txt\">\n");
document.write("      <img src=\"http://pastie.org/images/view.png\" height=\"20\" width=\"67\" /><\/a>\n");
document.write("    <\/div>\n");
document.write("  \n");
document.write("    <a href=\"http://pastie.org/660242\">Pastie #660242<\/a> linked directly from <a href=\"http://pastie.org/\">Pastie<\/a>.\n");
document.write("  <\/div><\/div>");

