Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Photo Album - Amos

Amos, you have made reference to a How-to section on your website in the following link.

http://discuss.fogcreek.com/CityDesk/default.asp?cmd=show&ixPost=5400&ixReplies=3

The link http://www.satterlee.com/backend/gallery.html
does not work.

I am interested in your How-to -- do you have a current link?

This very fine application http://www.b-zone.de/software.htm 
seems to have a problem that I cannot figure out. The problem is that when a thumbnail is clicked the resulting html page only show a “red x” versus the enlarged image. Any clues how to fix? Thanks.

David Mozer
Saturday, April 03, 2004

OK I found out why I get the red x marker.

It seems that all JPEG files have the wrong file type extension. Currently my JPEG file have the following naming convention "jepegfile.JPG " -- for it to work properly the file needs to have the following naming convention "jepegfile.jpg "

So now I am not sure how my files got named with the uppercase JPG --- any clues? Thanks

David Mozer
Saturday, April 03, 2004

OK I found out that the application Gallery Wizard converts all JPEG file to uppercase ... or should I say that "I think" that GW converts all JPEG files to uppercase ...

What a bummer :-)

http://www.b-zone.de/software/galwiz.htm

BTW, did I say that GW is a very nice [Photo Album] application .. Well it is a very nice application --- except for this glitch. :-)

David Mozer
Saturday, April 03, 2004

OOPS slight correction;

GW inserts a line of html
<a href="<%GALLERYPAGE%>"><img src="<%IMAGENAME%>"></a>

and the variable %IMAGENAME% prints the filename in uppercase ... apparently my web server [Linux based] does not like “file extensions” to be uppercase.

David Mozer
Saturday, April 03, 2004

Problem Solved with a little help from JS

The following is the code that delivers the desired result:

<HTML>
<HEAD>
<TITLE><%IMAGENAME%></TITLE>
</HEAD>
<body bgcolor="#FFFFFF">
<center>
<a href="<%GALLERYPAGE%>">
<script type="text/javascript">
var str = "<%IMAGENAME%>";
str = str.substring(0,8) + ".jpg";
document.write('<img src="' + str + '">')
</script>
</a>
<br>
<a href="<%PREVIOUSIMAGEPAGE%>">Previous Image</a>
<a href="<%NEXTIMAGEPAGE%>">Next Image</a>
</center>
</body>
</html>

David Mozer
Tuesday, April 06, 2004

BTW, the code above assums that the filename size is 12 chacters -- 8,1,3 where 1=period[.]

If the image name part doesn't always have a constant number of chars, you could use str.match and str.slice methods.

David Mozer
Wednesday, April 07, 2004

And if the numbers of characters in "<%IMAGENAME%>" may not be constant then the following code would work just great;

<HTML>
<HEAD>
<TITLE><%IMAGENAME%></TITLE>
</HEAD>
<body bgcolor="#FFFFFF">
<center>
<a href="<%GALLERYPAGE%>">
<script type="text/javascript">
myString = new String("<%IMAGENAME%>")
rExp = /.JPG/gi;
newString = new String (".jpg")
results = myString.replace(rExp, newString)
document.write('<img src="' + results + '">')
</script>
</a>
<br>
<a href="<%PREVIOUSIMAGEPAGE%>">Previous Image</a>
<a href="<%NEXTIMAGEPAGE%>">Next Image</a>
</center>
</body>
</html>

David Mozer
Wednesday, April 07, 2004

*  Recent Topics

*  Fog Creek Home