in reply to Find the thief: CGI & JPG & hidden info
This is an implementation of what was suggested in the nodes above:
This script should be called this way: <img src="/cgi-bin/marker.pl/image.jpg">. All the comments you have read apply to this solution; please note that you should check the obtained $filename to avoid possible problems; remember that served images should not be visible directly.#!/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;
HTH, Valerio
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Find the thief: CGI & JPG & hidden info
by diotalevi (Canon) on Feb 27, 2004 at 20:12 UTC | |
by ysth (Canon) on Feb 29, 2004 at 06:29 UTC | |
by diotalevi (Canon) on Feb 29, 2004 at 15:08 UTC |