JPEG image doesn't always appear

R

Ron Brennan

Good evening.

I have a page which is supposed to display several small JPEG images using
elements like:

<image src="SmallImages/image1.jpeg" height="40" width="30"></image>

The image files are fine - I can open them reliably by double clicking in
Windows Explorer. But in a browser sometimes they display properly and
sometimes not and it's not always the same images that don't display.

I'm betting this behavior and its solution is well know to at least hard
core developers and I'd be quite appreciative if someone would give me a
hand.

Thank you,
Ron.
 
D

Dan Abrey

Ron Brennan said:
Good evening.

I have a page which is supposed to display several small JPEG images using
elements like:

<image src="SmallImages/image1.jpeg" height="40" width="30"></image>

The image files are fine - I can open them reliably by double clicking in
Windows Explorer. But in a browser sometimes they display properly and
sometimes not and it's not always the same images that don't display.

I'm betting this behavior and its solution is well know to at least hard
core developers and I'd be quite appreciative if someone would give me a
hand.

Thank you,
Ron.

1) Use <img> tags rather than <image>
2) Check that all of the files are of the correct extension (ie .jpeg or
..jpg)
 
M

Matt N. Jones

Dan Abrey said:
1) Use <img> tags rather than <image>
2) Check that all of the files are of the correct extension (ie .jpeg or
.jpg)

I'd add that URLs are case sensitive, so make sure what you've got in
your <img> tags exactly matches the names of the files and folders.

Also, your image tag should look something like this:

<img src="SmallImages/image1.jpeg" alt="Image Description" height="40" width="30" />

Matt
 
R

Ron Brennan

Nope, still doesn't work, even after changing the image tags to img, and
making sure of the other suggestions.

Again, these images have been sometimes displaying and at other times not,
with the same code.

Is there a timing problem perhaps that varies according to Internet traffic?
Any other possibilities?
 
M

Mark Parnell

Also, your image tag should look something like this:

<img src="SmallImages/image1.jpeg" alt="Image Description" height="40" width="30" />

1) The alt attribute is a textual _replacement_ for the image, not a
description.
2) The /> at the end is only correct in XHTML. Remove the / if using
HTML.
 
R

Ron Brennan

The HTML is being generated by a Java servlet and is a bit complex to post
here. It was suggested that I post the URL. It's an on-line Want Ads
application, similar to eBay without the bidding.

www.quick-trader.com
 
S

Spartanicus

Mark Parnell said:
1) The alt attribute is a textual _replacement_ for the image, not a
description.

Typically a description of the image is exactly what is required for it
to function as a textual replacement.
 
R

Ron Brennan

2) The /> at the end is only correct in XHTML. Remove the / if using
HTML.

Sorry, that was a typing mistake on my part. I don't actually have a final
/> in the <img> part of the element.(The code is actually in a Java
servlet.)
 
R

Ron Brennan

2) The /> at the end is only correct in XHTML. Remove the / if using

Sorry, that was a typing mistake on my part. I don't actually have a final
/> in the <img> part of the element.
 
C

CPA

Nope, still doesn't work, even after changing the image tags to img, and
making sure of the other suggestions.

Again, these images have been sometimes displaying and at other times not,
with the same code.

Is there a timing problem perhaps that varies according to Internet traffic?
Any other possibilities?

Yes, I suspect there are timing problems but I suspect it is a
combination of hardware and software but pauses from the internet
connection could complicate things.

When computers were slower than they are now the javascript 'onload'
was used to preload graphics. If javascripting is acceptable this
might work for you?


Charles.Angelich

tech:
http:/www.devedia.com/dosghost/
arts:
http:/www.devedia.com/dosghost/faf/
music
http:/www.devedia.com/dosghost/dos/samples.asp
 
R

Ron Brennan

CPA said:
Yes, I suspect there are timing problems but I suspect it is a
combination of hardware and software but pauses from the internet
connection could complicate things.

When computers were slower than they are now the javascript 'onload'
was used to preload graphics. If javascripting is acceptable this
might work for you?


Charles.Angelich

tech:
http:/www.devedia.com/dosghost/
arts:
http:/www.devedia.com/dosghost/faf/
music
http:/www.devedia.com/dosghost/dos/samples.asp


JavaScript is certainly acceptable; the app is about 25 % JavaScript. Can
you give me a code snippet?
 
M

Mark Parnell

Typically a description of the image is exactly what is required for it
to function as a textual replacement.

In some instances yes, but not typically. If the image is of text (which
it shouldn't be, but we won't go there), then the alt text should be
that same text, not "blue button".

If the image is purely decorative, the alt text should be blank - "",
not "swirly green border".

In other cases such as a photo, the alt text may actually be a
description of the image, but that is not the norm.
 
R

Ron Brennan

I haven't finished the fix but it appears that the problem was that the
extension .jpg was being referenced as .JPG in parts of the system which
were forgiving and in others that were not.

Thanks for all the help, especially to the gentleman who suggested this
earlier and put it on my list of things to check.
 
C

CPA

[...]
JavaScript is certainly acceptable; the app is about 25 % JavaScript. Can
you give me a code snippet?

Preload:

http://www.macromedia.com/devnet/mx/dreamweaver/articles/code_standards.html

The info at the following link would suggest that my assumption(s)
are wrong but it's another possibile solution?

http://lists.evolt.org/archive/Week-of-Mon-20040614/160341.html


Charles.Angelich

tech:
http:/www.devedia.com/dosghost/
arts:
http:/www.devedia.com/dosghost/faf/
music
http:/www.devedia.com/dosghost/dos/samples.asp
 
R

Ron Brennan

Although I haven't implemented the fix yet, it appears the problem was much
more simple than I had feared. (See the latest post here.) I'm going to take
a look at that article anyways.

Thanks CPA.
 
N

Neal

In other cases such as a photo, the alt text may actually be a
description of the image, but that is not the norm.

Also, it's better to think in terms of replacement instead of description.
An example: a pie graph showing the percent of polled voters supporting
various candidates in an upcoming election.

Description:

alt="Pie graph showing 40% of polled voters support Jones, 35% support
Smith, and 25% support Bozo"

The sightless have no need to be told this is a pie graph. What they need
is the communicated information. (If that information is explicitly
included in the text content, then this image is supplementary and alt=""
is fine. But if this image communicates something not in the prose, the
alt text must communicate it.)

Replacement:

alt="In a recent poll by NCG, 40% of voters indicated they support Jones
in the race for town dogcatcher. Smith was supported by 35% of those
polled, and 25% supported Bozo."

By thinking, "What sentence(s) would I use if this picture could not be
included in the page?", the readability of the image-less page is
enhanced. The above is clearly superior.

So the key to good alt text is to think about what you'd do instead if
HTML didn't allow images. Would you add a paragraph of text instead, would
you use link text, would you not use anything in lieu of the image? That's
what your alt text should be.
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top