/    Sign up×
Community /Pin to ProfileBookmark

Where are images coming from?

Can someone check out this page [url]http://www.bargainmonkey.com/prodlist/DId/3708/[/url]
it is pretty much the same as the rest of our pages, so it’s a good example.
My business partner seems to think the product pictures are loading THROUGH our server even though the links for the pics all point to external servers. Could some expert out there please confirm this one way or the other?
Thank you.

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@EupseudesSep 16.2004 — I thinky that the script is retrieving the images and then sending them to the client. Here's a url:

http://www.bargainmonkey.com/getjpeg.php?errfile=moreinfo30x30.png&size=30&url=http://www.entertainmentearth.com/images//AUTOIMAGES/TM33259Alg.jpg

Even if these weren't stored on your server, the script handles the jpegs in some way or another.
Copy linkTweet thisAlerts:
@CyCoSep 16.2004 — The images actually reside here:

http://www.entertainmentearth.com/images//AUTOIMAGES/TM33259Alg.jpg

...as one example...
Copy linkTweet thisAlerts:
@EupseudesSep 16.2004 — Ah... but the server resizes them, so they must be coming through the server!
Copy linkTweet thisAlerts:
@pcs800authorSep 16.2004 — Isn't it the browser that resizes them not the server?

The size attributes are in the code, which executes on the users machine in the browser.

Correct me if i am wrong.
Copy linkTweet thisAlerts:
@EupseudesSep 16.2004 — Can I see the code for the getjpeg.php script? That would help.
Copy linkTweet thisAlerts:
@pcs800authorSep 16.2004 — <?

require_once('Connections/dbTBM.php'); // for $basedir

// set error graphic

if (isset($_GET['errfile']))

$errfile = $_
GET['errfile'];

else

$errfile = 'moreinfo60x60.png';

if (!file_exists($basedir . 'images/' . $errfile))

$errfile = 'moreinfo60x60.png';

$errfile = 'images/' . $errfile;

// default a size if not specified

if (isset($_GET['size']))

$pSize = $_
GET['size'];

if ($pSize < 10 || $pSize > 400)

$pSize = 250;

$error = false;

if (ereg('^http://', $_GET['url'])) {

$imgurl = $_
GET['url'];

$size = @getimagesize($imgurl); //suppress any errors, such as bad URL

switch($size[2]) {

case 1: // no support yet for GIF; open the not available entry for now

// $im = imagecreatefromgif($imgurl);

$im = imagecreatefrompng($errfile);

$error = true;

break;

case 2:

$im = imagecreatefromjpeg($imgurl);

break;

default:

$im = imagecreatefrompng($errfile);

$error = true;

}


}


else {
$im = imagecreatefrompng($errfile);
$error = true;
}
if (!$error && $size[0] > $pSize) { // width
$reduce = $pSize / $size[0];
$new_width = round($size[0] * $reduce);
$new_height = round($size[1] * $reduce); // height
$im_tmp = $im;
$im = imagecreatetruecolor($new_width, $new_height);
imagecopyresized($im, $im_tmp, 0, 0, 0, 0,
$new_width, $new_height,
$size[0], $size[1]);
}
header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im_tmp);
imagedestroy($im);

?>
Copy linkTweet thisAlerts:
@pcs800authorSep 17.2004 — Ok, I posted the code. Any idea's?
Copy linkTweet thisAlerts:
@EupseudesSep 17.2004 — I dunno. I'm not familiar with these functions.
Copy linkTweet thisAlerts:
@pcs800authorSep 17.2004 — ok, thanks anyway. I guess I'll wait and see if anyone else answers.
×

Success!

Help @pcs800 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...