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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Consolidating images

Status
Not open for further replies.

StuH

Programmer
Mar 25, 2001
53
AU
Is there a simple way with Frontpage or some other tool to investigate the html code automatically, see if image links (JPGs/gifs etc) are local to the html page or located elsewhere? Also, then to make a copy of those images and adjust the reference in the html to have all files related to the webpage to be in the same folder or nested below?

For example, a school student creates a webpage in a folder, but links to images which are in My Documents/My pictures (or somewhere external via http). While that site may work while you are at the PC where it was created, copying the folder for the website to a CD or another PC will mean broken images.

Is there a tool that fixes the html automatically so the image gets copied to the right place?

Any help appreciated.

Stu.
 
Hi Stu,

Well, first off, it is best to start by placing the images in the images folder or just paste the image into page view and let FrontPage name it automatically. In terms of the current images with broken file paths, these will have to be dealt with manually. I don't use my images folder, I just save the image to the page and it subsequently shows up alphabetically in the folder list. This results in scrolling to get to my pages but I always do it this way.

Image path mistakes are quite common. To view the image path for any image in the site, you can right click the image and select Picture Properties. This will tell you where the image is located.

If the image is saved to the page, it should either have the original image name or something like index2.gif. When I create a nav gif in Image Composer, instead of saving the image, I copy and paste it into page view. When the page is saved, I am prompted to save the image as well as being presented with the opportunity to rename the image.

If I take an image from another source, say MyDocuments, when saving that page, the image prompt will show the original name e.g. grapes.gif.

If you have Image Composer or another image program, you could paste the image into that program, copy and paste below the original image to make sure it copies properly and then replace the image with it. When saving the page, the image path would now be in the site.

Hope I didn't put you asleep with this answer.

Hope I have been of some help,
Micheal

FrontPage Form Tutorials & Form ScriptExamples
 
Thanks Michael,

This would be great if students would follow this rule from the beginning, but I really need a tool that fixes html after the students have all done it the wrong way and I need to burn CDs of their webpages for them...

Stu.
 
If I'm understaning the issue correctly SSI (Server Side Includes) should be able to accomplish this task. A central location which can change/edit images throughout the site. You can add SSI calls (e.g. #include file="filename/path"). You just have to be sure your web server supports SSI.

Hope that helps!
 
Hi anthonyon.

It's students building webpages. They are supposed to be contained fully within their own folder with relative paths to images which are stored within their folder. Problem is some kids insert images poorly - they don't copy them to their folder first then insert them, instead, they insert from My Documents\My Pictures or by making a link to an image in the net via a http: link.

It runs fine on the host PC, but when you want to move the site, the image links break. I need something like HTML Tidy, but which looks at image paths, if they are external, copies the image to the local folder and reinserts them as relative paths - it needs to do this by simply investigating the html and tidying it up.

An SSI is not the solution unforunately.

Stu.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top