anchor.diff:  
   
   
  -make_progressive_jpeg(List) ->
  -  [?COMMAND2(F) || F <- List].
  +make_progressive_jpeg(Dir,List) ->
  +  _ = [?COMMAND2(Dir++"/"++F,Dir++"/pr_"++F) || F <- List],
  +  case filelib:wildcard("pr_*.jpg", Dir) of
  +    [] -> ?D({error_converting_to_progressive,Dir}),false;
  +    List2 -> {ok,List2}
  +  end.
   
   
   
  
positive.code:       case filelib:wildcard("*.jpg", PagesDir) of
          [] -> {error, Data};
          List ->
            make_progressive_jpeg(List),
            JSON = jiffy:encode({
              [
                {name, list_to_binary(Name)},
                {dir, <<"pages">>},
                {length, length(List)},
                {thumbs, [list_to_binary(T) || T <- List]}
              ]
            }),
            JSONFile = Dir ++ "/" ++ Name ++ ".pages.json",
  
negative.code: 
  -export([run/1, run/2]).
  
  -define(COMMAND(In, OutName), "gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=jpeg  -sOutputFile=\"page_" ++ OutName ++ "_%d.png\" -r200 -q \"" ++ In ++ "\" -c quit").
  -define(COMMAND2(In,Out), "jpegtran -copy none -progressive -outfile \""++Out++"\" \"" ++ In ++ "\"").
  
  run(File) -> run(File, []).
  
  