Forum Moderators: open
So does anyone know of a way to keep a URL from showing up in those detail windows? I'm afraid that if I feed the image from another page it will just show that URL as well.
Also, I know it's an extremely small number of users that will ever find this as a way to grab images, but I want to solve the problem just to prove that it can be done.
One trick that I've often done is to display images as background images in CSS, with a 1-pixel transparent shim stretched over them to make people think they can grab the image. I even hacked < an online image gallery > to do this. The main drawback is that it can take longer to draw the image.
When push comes to shove, you'll never be able to close the "analog hole" so don't go crazy over it.
<removed inappropriate links.
See Forum Charter [webmasterworld.com]>
[edited by: tedster at 7:49 am (utc) on Dec. 22, 2006]
I'd spend my time creating more content instead.
P.S. You might not be able to stop people taking your images but are you watermarking them so that you know for certain they are yours when you come across them elsewhere?
This is more of a personal project rather than a full blown necessity, so watermarking and other stuff isn't really an issue. I just want to see how overly secure I can get an image.
And doing more research I was able to come up with something in case anyone else needs to know. If you link to a PHP page as an image source then set the header ("Content-type: image/jpeg") you can control if the image is displayed only if there is a referring page and you could go further to display only if it comes from your page.
<?php
// From comments on php.net
function imageCreateFromJpegEx($file)
{
$data = file_get_contents($file);
$im = @imagecreatefromstring($data);
$i = 0;
while (!$im)
{
$data = substr_replace($data, "", -3, -2);
$im = @imagecreatefromstring($data);
}
return $im;
}
// Check to see if the image is loaded directly or not
if ($_SERVER['HTTP_REFERER']!= "") {
// Image is opened with a page so display it
header ("Content-type: image/jpeg");
$path = "http://whereever/image.jpg";
$im = imageCreateFromJpegEx($path);
imagejpeg( $im );
};
?>
The PHP page shows up as the URL of the image because that's where the browser gets the image from, but the true URL of the image isn't revealed.
You can go further and load URLs from a database or image names from the querystring while the actual image folder is not displayed.
So far it's a pretty good solution. Maybe someone could offer some upgrades?