Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Image won't display with given name

Posted by: Robolovsky Apr 19 2019, 08:18 AM

I have been coding in HTML for many years and do not understand what is happening.

Please take a look at the following test web page: http://www.snookerlegends.co.uk/imgtest2.html

The page contains two identical images (with slightly different names), each inside a table border. The top one does not display while the lower one does.

The top image is called FP_ad1.jpg and the lower one is called FPad1.jpg (no underscore)

If you check the page source and click the link to FP_ad1.jpg you will see that it does exist on the server so why does it not appear in the page?

The Doc type is HTML 5 but I have tried it with many different Doc types and always the same result.

Even stranger is that if I add any other character after the 1 the picture then does display so FP_ad10.jpg will display

However if I remove the FP and underscore completely leaving ad1.jpg that does not display while ad10.jpg does.

I am completely baffled by this behaviour, I have tried it in different browsers always with the same result. What am I missing?

...Please note the image is an ad for a snooker book. It is not my book nor am I trying to promote it in any way. It just happens to be the image that this behaviour first occurred with...

Posted by: Darin McGrew Apr 19 2019, 11:46 AM

They both display for me.

Posted by: CharlesEF Apr 19 2019, 11:50 AM

They both display for me too.

Posted by: pandy Apr 19 2019, 02:19 PM

For me three.

Do you use any kind of content blocker, to avoid ads or for some other filtering?

Posted by: Robolovsky Apr 19 2019, 02:58 PM

That is strange. I have an ad blocker in Chrome but it wouldn't know that this image was an add and why would it still display the second one just because I change the name slightly. I have also tested in IE and Firefox with same missing image at the top.

I do use Kaspersky Internet Security so I suppose it is possible that it may be blocking the image but why does changing just one character in the file name or removing the underscore then render it visible. The code for both images is exactly the same otherwise.

Posted by: Robolovsky Apr 19 2019, 03:15 PM

Just tried it with Kaspersky protection paused but the image still fails to appear!

Posted by: Robolovsky Apr 19 2019, 03:17 PM

Incidentally I have tried this on a local server as well as on the web but the result is still the same.

Posted by: CharlesEF Apr 19 2019, 04:17 PM

I tested using Firefox v66 and current versions of IE11 and MS Edge. Both images were shown in all 3 browsers. You do have many validation errors for an HTML 5 document but I don't think that would affect it too much.

Posted by: Christian J Apr 19 2019, 05:10 PM

When I saved the file at http://www.snookerlegends.co.uk/images/book18/FP_ad1.jpg its size was just 93 bytes. It couldn't be opened by my image editor, but when tried a text editor the following content was shown:

CODE
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>

Considering the above, it's strange that the image can be viewed in a browser at all.

Posted by: pandy Apr 20 2019, 01:08 AM

QUOTE(Robolovsky @ Apr 19 2019, 09:58 PM) *

That is strange. I have an ad blocker in Chrome but it wouldn't know that this image was an add and why would it still display the second one just because I change the name slightly.


I don't know how Chrome's ad blocker works, but those things sometimes filter on file name, or at least they used to. Your file names contain "ad". Together with the underscore that could be a trigger.

Posted by: pandy Apr 20 2019, 01:14 AM

QUOTE(Christian J @ Apr 20 2019, 12:10 AM) *

When I saved the file at http://www.snookerlegends.co.uk/images/book18/FP_ad1.jpg its size was just 93 bytes. It couldn't be opened by my image editor, but when tried a text editor the following content was shown:

CODE
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>

Considering the above, it's strange that the image can be viewed in a browser at all.



Opens fine in IrfanView that tends to be picky. Neither do I see any legible characters when I open the image in a text editor. unsure.gif

Posted by: Christian J Apr 20 2019, 03:24 AM

QUOTE(pandy @ Apr 20 2019, 08:14 AM) *

Opens fine in IrfanView that tends to be picky.

That's what I used.

Now I tried again, this time it seems I got a proper 153KB image file. Maybe it's something intermittent?


Posted by: pandy Apr 20 2019, 05:44 AM

Oh, I didn't think about the file size you got the first time. So that file became broken in the download attempt and an error message, HTML and all, was somehow injected to it. How on earth can that happen? ohmy.gif

Posted by: Christian J Apr 20 2019, 08:55 AM

QUOTE(pandy @ Apr 20 2019, 12:44 PM) *

So that file became broken in the download attempt and an error message, HTML and all, was somehow injected to it.

Not sure if the actual file is broken, looks more like a server-side response.

QUOTE
How on earth can that happen? ohmy.gif

Maybe it's because I was using Tor browser. blush.gif Assuming that browser doesn't cache anything, maybe it had to request another copy of the file for the file downloading (and failed to notice that the server instead sent a 403 page).

Doesn't explain the OP's problem, though.


Posted by: pandy Apr 21 2019, 05:34 PM

Nah...

Posted by: Christian J Apr 22 2019, 03:17 AM

QUOTE(Christian J @ Apr 20 2019, 03:55 PM) *

Doesn't explain the OP's problem, though.

Or maybe it does. If the image is embedded in an IMG element you won't notice the 403 response, it will just look like an ordinary missing image in the browser. You need to load the image directly (like I did) or use the browser's network inspection tool to see the server's HTTP response.

Strange that it happens every time for the OP though.

Posted by: pandy Apr 22 2019, 05:55 PM

Why would the 403 be sent in the first place?

Posted by: Christian J Apr 23 2019, 03:59 AM

Maybe something on the server is configured incorrectly? Say, an anti-leech directive in a .htaccess file? I guess it could be anything.

Posted by: pandy Apr 23 2019, 05:41 AM

That targets the OP's browser? Sounds far-fetched to me.

Posted by: Christian J Apr 23 2019, 06:47 AM

Now I got a 403/Forbidden response even from the HTML page http://www.snookerlegends.co.uk/imgtest2.html unsure.gif

When I changed IP (Tor circuit) the page suddenly worked, then I changed IP again and got another 403. Maybe the site uses an IP blacklist? Lots of sites do block Tor exit node IPs due to abuse.

Posted by: pandy Apr 24 2019, 05:48 AM

The rule, if there is one, must also target a certain file naming pattern. It's just the one image the OP doesn't see.

Posted by: Christian J Apr 24 2019, 06:03 AM

Maybe the purpose is to prevent bots from downloading ads? "_ad" does sound advertizing related. OTOH "imgtest2.html" doesn't, and it still returns a 403 for me. So did the site's home page, BTW.


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)