I have a page which creates thumbnails with or without watermarks from a source image using GD.
Basically all I have to do is, on the page I want the thumbnail picture to appear I use :
[code=php]<img src=”imagethumb.php?s=$url&w=100″ border=”0″></a>
where $url is the url of the source Image e.g.
$url = “/Images/mypics/image1.jpg”
In imagethumb.php I just use $_GET[‘s’] to get the path of the source image and manipulate it. The page then just returns the manipulated image which is why you can call the page in the IMAGE tags.
Doing this, however it is possible for someone to get the path to the Image, $url, just by viewing the source of the page. I was wondering is there any way of passing $url to the imagethumb.php page either through the url string or some other way so that no one can see the $url string/value?
I cannot use a hidden form element as a form is not being submitted.
Any help is greatly appreciated,
Kosh
Why not create the thumbnail as you upload the picture, then just link to it whenver you need it?[/QUOTE]that would work best because gd uses a lot of system resources
I have tried to tell them repeatedly that this will increase server load and that the original image path is visible and so the original unmarked images are currently accessible as putting them in a non-public directory is something I do not have access to do at the moment. [/QUOTE]
[code=php]
<?php
$file = '/path/to/non-public/directory/' . 'filename.ext';
header("Content-Type: image/jpeg");
header("Content-Disposition: inline");
@readfile($file);
?>
[/code]
[code=php]
$path = /Images/path/to/whatever
[/code]
[code=php]
$file = 'filename.ext';
$path = $_SERVER['DOCUMENT_ROOT'] . '/path/to/images/from/root/';
$combined = $path . $file;
[/code]
0.1.9 — BETA 5.4