#!/usr/bin/perl # filename: marker.pl use JPEG::Comment; use File::Slurp; use CGI; use strict; use warnings; my $images = '/path/to/images'; my $q = CGI->new; my $username = $q->remote_user; my $path_info = $q->path_info; my $filename = "$images/$path_info"; if (-e $filename) { my $image = read_file($filename); print $q->header('image/jpeg'); print jpegcomment($image, "Downloaded by $username"); } else { print $q->header( -status => '404' ); } exit;