#!/usr/bin/perl -wT

#---libsetup---

# having . in @INC can cause tainting issues for use

no lib '.';

use FindBin;
BEGIN {
  ($dir)=($FindBin::Bin=~/^([\w\d\-\/\.]+)$/)
    or die "invalid current directory $FindBin::Bin";
}
use lib $dir;

#---endlibsetup---

use strict;

use PhotoPub::Global qw(&init &finit);
use PhotoPub::CGIBase qw($query &printheader);

&init();

my @params = $query->param;

&printheader(type => 'text/plain');

foreach (grep { /^(desc.*\/([^\/]*))$/ } @params) {
  /^(desc.*\/([^\/]*))$/;
  print "describe $2 ".$query->param($1)."\n"
    if $query->param($1);
}

foreach (grep { /^(effect.*\/([^\/]*))$/ } @params) {
  /^(effect.*\/([^\/]*))$/;
  my $num = $2;
  my $deg = $query->param($1);
  next if $deg eq "none";
  $deg =~ s/rotate//;
  print "rotate $num $deg\n";
}

&finit();
