Can only get image if it's in a webpage

C

chancegardinner

I use the URL's for images found within a webpage in order to display
the images alone on a tab in my browser.

Something I don't understand started happening with one of these image
files.

Til recently this URL: http://www.oceancitycam.com/images/board1.jpg
went to a webcam of a boardwalk in Maryland. The jpeg changed about
every 5 seconds.

Now when you go to that URL you get a a message:
"Visit Beach-net.com Web Cams."

However if you go to the page where the webcam image is embedded it
appears as usual:
http://www.oceancitycam.com/

Checking the current URL for the pic,it appears to be the same as it
has been:
http://www.oceancitycam.com/images/board1.jpg

Somehow, they have made the pic accessible only within the wepage.
Does anyone know how they do that?
 
D

dorayme

I use the URL's for images found within a webpage in order to display
the images alone on a tab in my browser.

Something I don't understand started happening with one of these image
files.

Til recently this URL: http://www.oceancitycam.com/images/board1.jpg
went to a webcam of a boardwalk in Maryland. The jpeg changed about
every 5 seconds.

Now when you go to that URL you get a a message:
"Visit Beach-net.com Web Cams."

However if you go to the page where the webcam image is embedded it
appears as usual:
http://www.oceancitycam.com/

Checking the current URL for the pic,it appears to be the same as it
has been:
http://www.oceancitycam.com/images/board1.jpg

Somehow, they have made the pic accessible only within the wepage.
Does anyone know how they do that?

Not quite. When I go to url where it is embedded and I control
click it in Safari and choose "open in new window", the picture
opens in new window fine. But if, instead, I choose "open in new
tab" it get what you are calling a message.
 
S

Si Ballenger

I use the URL's for images found within a webpage in order to display
the images alone on a tab in my browser.

Something I don't understand started happening with one of these image
files.

Til recently this URL: http://www.oceancitycam.com/images/board1.jpg
went to a webcam of a boardwalk in Maryland. The jpeg changed about
every 5 seconds.

Now when you go to that URL you get a a message:
"Visit Beach-net.com Web Cams."

However if you go to the page where the webcam image is embedded it
appears as usual:
http://www.oceancitycam.com/

Checking the current URL for the pic,it appears to be the same as it
has been:
http://www.oceancitycam.com/images/board1.jpg

Somehow, they have made the pic accessible only within the wepage.
Does anyone know how they do that?

It is done in the web server setup to prevent people from
hijacking the web cam feed for their own web pages (and missing
all the advertising).
 
R

rf

I use the URL's for images found within a webpage in order to display
the images alone on a tab in my browser.
Something I don't understand started happening with one of these image
files.

Til recently this URL: http://www.oceancitycam.com/images/board1.jpg
went to a webcam of a boardwalk in Maryland. The jpeg changed about
every 5 seconds.

Now when you go to that URL you get a a message:
"Visit Beach-net.com Web Cams."

However if you go to the page where the webcam image is embedded it
appears as usual:
http://www.oceancitycam.com/

Checking the current URL for the pic,it appears to be the same as it
has been:
http://www.oceancitycam.com/images/board1.jpg

Somehow, they have made the pic accessible only within the wepage.
Does anyone know how they do that?

Quite simple. They serve a different image if the image is not being
included in *their* page. Look at *their* page you get the correct image.
Look directly at the image, or include the image on *your* page, you get
something else. This is to stop bandwidth stealing.

The image you get is only a gentle hint to use *their* page to look at the
image. There have been reports of people replacing images with something
that, shall we say, you would not display in mixed company.
 
R

rf

dorayme said:
It is not quite simple. See my post.

Very simple to do. Simply check referrer. What you found is that it is hard
to ensure that it works. A simple referrer spoof is a workaround.

I suspect (not checked, I don't currently have a Safari attached to the
internet*) that Safari includes referrer in the headers sometimes. Possibly
this is because you referenced the image via control-click on *their* page.
You could check the headers sent to confirm this.

What happens when you access the image via the image URL in the OP's post?

* FWIW I abhore Safari. I develop to Camino or Firefox. Safari is simply not
complete for the stuff I do (CMS etc).
 
J

J.O. Aho

rf said:
Very simple to do. Simply check referrer. What you found is that it is hard
to ensure that it works. A simple referrer spoof is a workaround.

Yes, the board1.jpg php-script does check the HTTP referer and will serve the
message image to those requests that don't have the right referer.

For those with wget, you can try

wget http://www.oceancitycam.com/images/board1.jpg

wget --referer=http://www.oceancitycam.com/
http://www.oceancitycam.com/images/board1.jpg

and you will end with two different images.
 
J

John Hosking

Til recently this URL: http://www.oceancitycam.com/images/board1.jpg
went to a webcam of a boardwalk in Maryland. The jpeg changed about
every 5 seconds.

Now when you go to that URL you get a a message:
"Visit Beach-net.com Web Cams."

However if you go to the page where the webcam image is embedded it
appears as usual: http://www.oceancitycam.com/

Checking the current URL for the pic,it appears to be the same as it
has been: http://www.oceancitycam.com/images/board1.jpg

Somehow, they have made the pic accessible only within the wepage.
Does anyone know how they do that?

The site checks for the referrer. When I turn off referrers in my
Firefox, I only ever see the ersatz image
http://www.oceancitycam.com/images/hotlink.jpeg, even within their main
page. I must have referrers enabled, and I must be accessing the
board1.jpg image via their site. They're doubtless enforcing this with
..htaccess files.

See, for example, http://en.wikipedia.org/wiki/Hotlink and
http://altlab.com/htaccess_tutorial.html.
 
C

chancegardinner

Thanks for the replies. It is the referrer.

I use a local proxy server called Proxomitron that alllows you to
strip or replace anything in the html of the webpage or anything in
the header. I use it mainly to remove the no cache tags.

There is a prewritten rule in Proxomitron that will strip the
referer or there is an option to substitute a URL of your own as the
referring address. I don't know what a referrer tag should look like.
What is the format for a referrer tag in the header?

In reading up on referrers, I found this site:
http://www.garthgillespie.com/tools/iterator.php

It seems to act as a proxy server referrer spoofer. If you plug in the
address of the .jpg, it returns this URL which will then retrieve the
"real" pic from the server:

http://www.garthgillespie.com/tools...http://www.oceancitycam.com/images/board1.jpg

This is only for my own web browsing and enlightenment. I have
bookmarked an assortment of pics (like Piccadilly Circus and Times
Square) that I like to open in full screen views in my browser. I am
not trying to steal bandwidth by putting others' pics on a webpage.
 
D

dorayme

"rf said:
Very simple to do. Simply check referrer. What you found is that it is hard
to ensure that it works. A simple referrer spoof is a workaround.

In iCab I can control-click the image and choose open in new tab
and the image loads fine. In Mac IE, there is no webcam image to
begin with, in Opera, I see no options in context menu to open
(not a browser I know well though).

Whatever, it is a horrible looking flashing site.
What happens when you access the image via the image URL in the OP's post?

As he says.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top