Sesse::pr0n::Common::header($r, "Rotation/deletion results");
{
# Enable transactions and error raising temporarily
Sesse::pr0n::Common::header($r, "Rotation/deletion results");
{
# Enable transactions and error raising temporarily
# Rotation
if ($key =~ /^rot-(\d+)-(90|180|270)$/ && $apr->param($key) eq 'on') {
my ($id, $rotval) = ($1,$2);
my $fname = Sesse::pr0n::Common::get_disk_location($r, $id);
# Rotation
if ($key =~ /^rot-(\d+)-(90|180|270)$/ && $apr->param($key) eq 'on') {
my ($id, $rotval) = ($1,$2);
my $fname = Sesse::pr0n::Common::get_disk_location($r, $id);
- system("/usr/bin/jpegtran -rotate $rotval -copy all < '$fname' > '$tmpfname' && mv '$tmpfname' '$fname'") == 0
- or error($r, "Rotation of $id [/usr/bin/jpegtran -rotate $rotval -copy all < '$fname' > '$tmpfname' && mv '$tmpfname' '$fname'] failed: $!.");
+ system("/usr/bin/jpegtran -rotate $rotval -copy all < '$fname' > '$tmpfname' && /bin/mv '$tmpfname' '$fname'") == 0
+ or error($r, "Rotation of $id [/usr/bin/jpegtran -rotate $rotval -copy all < '$fname' > '$tmpfname' && /bin/mv '$tmpfname' '$fname'] failed: $!.");
$r->print(" <p>Rotated image ID `$id' by $rotval degrees.</p>\n");
if ($rotval == 90 || $rotval == 270) {
$r->print(" <p>Rotated image ID `$id' by $rotval degrees.</p>\n");
if ($rotval == 90 || $rotval == 270) {
$dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?', undef, $r->get_server_name, $event)
or dberror($r, "Cache invalidation failed");
$dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?', undef, $r->get_server_name, $event)
or dberror($r, "Cache invalidation failed");
+ push @to_purge, "/$event/";
+ push @to_purge, "/+all/";
+ Sesse::pr0n::Common::purge_cache($r, @to_purge);
+