Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images - Not Getting it !!

Status
Not open for further replies.

cptk

Technical User
Mar 18, 2003
305
US
Can someone give me the 2 minute drill on images?
I'll explain:
I'm using copies of jpg images and for the life of me I can't figure out why some work and some don't in my <img src=blahblah> or my <object ...> tags.

I'm not asking about the syntax within html (because I can get some images to display), but rather the ins-and-outs of images ...thanks!!!
 
if you show us your actual code and ideally a link to the page in question it's alot easier to answer.

Do you have the correct pathname to the images in the image tag?

Are you only using GIF, JPEG or PNG file formats?

Foamcow Heavy Industries - Web design and ranting
Toccoa Games - Day of Defeat gaming community
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
"I'm making time
 

I believe there was an issue with JPEG files saved from Photoshop using the "Save" command (and not the "Save for web" command), whereby some meta information, color profiles, etc, that were saved in the JPEG would cause IE 5 to not display, and in some cases, lock up the computer quite badly, forcing a power-cycle.

If that is your specific problem, then you can rectify it by using the "Save for web" option. If not, as Foamcow says, you'd need to give a bit more information about the specifics of your situation.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Here's my problem:

When I locate either a *.jpg or *.gif file that's being used as an image on other projects' web sites within our company's intranet, I simply copy the file(s) over to my directory and access via the <img> or <object> tags (all in a unix environment). These images work as expected on my web page. However, other images - located via the internet, saved to the pc and then ftp'd to my unix box in binary form, don't seem to work. All I get on my web page is an empty image placeholder. Note though that when I open these files in some image viewer (e.g. - MS Photo Editor), the images appear as expected.

What am I failing to realize here when copying image files?
 

Are the file extensions of the images you are saving "correct" for the file type that they are (e.g. ".gif" for GIF files, and ".jpg" or ".jpeg" for JPEG files)?

I say "correct" because in theory it shouldn't matter. But you never know - some browsers may be fussy.

Are the images that open in the photo viewer from your PC, or from the unix box? If the former, have you tried loading the ones from the unix box? If they fail, I'd double-check to make sure you FTPd them in binary mode.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
1.) Are you sure that your FTP client was in binary mode when moving them to the unix server... If the transfer was in ASCII then some bytes would have changed, and caused problems.

Run an md5 check sum on the images on the window machine and on the unix box. To be sure they really are identical

2.) What is displayed where the image should be, when the page is served? Is it a broken image or an image that doesn't display correctly or ???

3.) Are you giving the images proper permissions on the server? This would be one of a few reasons that the picture would be broken and not display at all.

4.) Is the path to file correct in the img tag? Again, this would cause a broken image.

[plug=shameless]
[/plug]
 
Thanks for the responses ...

Here's my replies:

1.) The extensions are correct - *.jpg & *.gif . Didn't try *.jpeg
2.) The files were indeed ftp'd in binary.
3.) I can view them on the unix side via an image viewer.
4.) path is correct in the <img> tags becuase all my image files are in the same directory and all I'm doing is switching-out file names. Recall that some images do display correctly on the web page.
5.) all have been chmod 777 to play it "safe".
6.) what's being displayed on web page is a broken images - just asquare placeholder with a tiny "x".

Although I ran the cksum on the unix side, I tried running some downloaded sw for the pc, but I'm having trouble interpreting the results. I've using "Advanced Checksum Verifier". Is there a product you can recommend for the pc? Do the results match the same format on the unix side?
 
md5 for dos/Windows:

Didn't think about spaces, but makes sense. When I saw all the steps he was using to grab the images, I was wondering if one of the hopps might be ascii changing all instance of the byte "\n" to the bytes "\n\r" and a few other changes.

I noticed above that your not closing the img tag in the example above, and your not adding quotes... Are the img tags in question closed, and do they have quotes? A thing to consider is that <img src=blah.jpg/> is ambigous in meaning,
<img src=blah balh.jpg/> or <img src=blah blah.jpg> will be broken because of the space. The proper way (in XHTML strict) would be to use both quotes and close the tag:
<img src="blah.jpg"/> or <img src="blah blah.jpg"/>.

Lastly, you should consider renaming them if they have spaces or longer file names... as older browsers and OSs can get confused by both.

[plug=shameless]
[/plug]
 
I didn't have any spaces in them, but I did have and underline. Took that out, to no avail.

As far closing the tag out, I don't need to, do I? But assumming I do, I tried it to no avail as well.
not closed: <img src=".../JPEGs/clogo.hpg">
closed: <img src=".../JPEGs/clogo.hpg"/>


I don't readly upload, but give me a site that I can and I will send a few of the images.

I just notice that when I save a file that does work via the img viewer (on unix), the new img file doesn't load on the page.
 
my typo - yes I correctly have them as .jpg and yes, the relative path is correct (I have other files in that path that do work!).

Where can I ftp the img files for you all to look at them?
 

When looking at the broken images in IE, right-click and choose "properties". Copy the URL it shows - if nothing obvious is wrong with it (in which case it's a source code fix), then try pasting the URL into a browser and visiting it directly.

It may well be a cachcing issue, for example, and refreshing the image itself may resolve this.... So try clearing your cache too.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
cleared my cache, to no avail.

From the web page, I looked at the RC properties of the broken image and interestingly the FILE Type = "not avail" (should be JPEG) and size = "not avail" . The URL itself is fine, although when I try to manually access this URL via IE, it can't load.

This same file though can be successfully viewed on the unix-side.

This is brutal !!!
 

Download something like "httpExplorer", which lets you analyse the responses from the web server. That should let you narrow down the errors.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top