Click to See Complete Forum and Search --> : IMG tag and Apache Server settings


andynic
08-24-2009, 02:25 AM
Hi,
I posted this on HTML client side development and am now wondering if possibly it belongs on the server side. Might the problem described below have something to do with Apache Server settings? The reason I ask here, is that everything works as it should if I open the generated HTML file directly in a browser. But if the CGI calls it via "submit", the image often does not display.

Everything is on one computer, client and server. Using Internt Explorer 8 and Safari 3, Perl v 5.8, CGI, Apache 2.2

Orignal Post:
I have what seems to me a strange problem, but then again, I'm pretty new to this stuff.

I have written a perl CGI script. The question is about a generated HTML file.

There are two HTML files, call them A and B. A pops B. The question is about B.

About file A:
=============
The A file presents the user with some input fields and buttons.
When the user clicks the following button in A, the server displays HTML file B.
<input type="button" style="font-size:10pt; color:black"
name="DGCdisplayLocal"
value="Display gallery from local database"
onClick="popWindow('/tmp/gllryToDelLocalDbVsn.html', 'width=1000', 'height=600')">

This is javascript code for popWindow:
function popWindow(theURL, width, height)
{
newWindow = window.open(theURL, "_blank",
"toolbar=no,
menubar=yes,
resizable=yes,
scrollbars=yes,
status=no,
location=no,
left=1,
top=1"+width+","+height);
}

About file B:
=============
File B (/tmp/gllryToDelLocalDbVsn.html), contains the <IMG> tag.
Please see the end of this post for an example.
When the user clicks the button shown above in A, the server pops a window that is file B.

The problem:
============
When the server pops the window, with no consistency, sometimes the image displays, and
sometime it does not. Whether or not the image displays, when the user clicks on the image area,
the server pops the requested window (a much larger version) and the image displays.

When I click on file B itself (/tmp/gllryToDelLocalDbVsn.html). the image always displays.

I have passed the file B code through the validator at http://validator.w3.org/#validateby_upload
and it shows no errors.

Why is it sporadic when the server pops the window. What is wrong with my code?

Example of how the <IMG> tag is coded in file B:
================================================
<center>
<table>
<tr style="font-family:courier; color:green" >
<td align="center">
<IMG name="img0"
src="http://lh6.ggpht.com/_Pih7W33IT_M/RqaYDhT9U3I/AAAAAAAAAAo/iqYp5vTxZYU/DSC_0026.JPG"
alt="Image not available from Picasa"
title="Image not available from Picasa"
height="100" width="33"
onMouseDown="window.open('http://lh6.ggpht.com/_Pih7W33IT_M/RqaYDhT9U3I/AAAAAAAAAAo/iqYp5vTxZYU/DSC_0026.JPG',
'_blank', 'toolbar=no, menubar=no, resizable=yes, top=0, left=200')">
</td>
<td align="left">
Url......................: http://lh6.ggpht.com/_Pih7W33IT_M/RqaYDhT9U3I/AAAAAAAAAAo/iqYp5vTxZYU/DSC_0026.JPG<br>
File uploaded to Picasa..: DSC_0026.JPG<br>
Title....................: DSC_0026.JPG<br>
Caption from Picasa......: <br>
Special caption..........:
</td>
</tr>
</table> </center>

Thanks for your help.
Andynic

edatz
08-24-2009, 03:21 PM
This may or may not help.

One of my clients is an e-commerce site with a lot of images. To save time I copied/pasted the filenames, until one day a manufacturer began captilizing their ones on the CD they sent me. The image would not appear on Apache. I changed it to lower case and it was okay. Since then I make sure they are lower case.

For instance
DSC_0026.JPG becomes dsc_0026.jpg

I don't know why Apache would do this, or if it has been corrected by patches or not, but it's worth a try.

First off try an image without the Javascript in both forms. If they both work, then your problem is the JS, not the image name or paths.

Hope this is of some help.

Nedals
08-24-2009, 07:56 PM
I don't know why Apache would do this
Apache directory and file names are case sensitive. Mico$'s are not.

edatz
08-25-2009, 03:42 AM
My current server is okay on this (first try in over 5 years). I think I had the problem on an early version of Apache 1.3. Current is 2.

I seem to remember changing my MS settings to stop captilized file extensions. Trouble is you do it once, forget about it and don't remember how you did it :)

O the relief when Apache/Unix allowed more than 8 characters in a filename. Saved me time and hassle that did.

If andynic isn't having consistancy it may well be the javascript. I'll have a play with that - though it's out of context for this forum. I only use pops for things like notices that relate to something in the Perl script (help files etc).

Oh andynic, just how big is this image? If it's not been made into 72dpi you might well have some hiccups on some servers. If it comes from an older version of Photoshop that "will" be a problem as PS had a different jpeg engine (geared for hi-res print) and often you'd only get a portion of the image, instead of the whole, on a website. There are a number of factors in all this, some are not straight forward, especially if you are altering images before uploading them.

andynic
08-26-2009, 02:02 AM
Hi Edatz,
Thanks very much for your interest in the problem.
The images are those made with a digital camera, untouched such as an Olympus mu700. They vary in size. The one I mentioned in the post is 1600 high by 583 wide, but in the pop up (which is an "Are you sure" type of report if the user wants to delete the gallery from a local database) the thumbnail is reduced to 100 x 33.
Andynic

edatz
08-26-2009, 04:24 PM
I couldn't see anything glaringly wrong, but it might be worth checking to see if there's any reported conflicts with Apache 2.2 and Picasa's way of doing things. I don't know whether or not Google have a forum for it as it's their software.

Have you tried deleting the stuff from your server and uploading again?

I assume the Javascript is in a .js file?

The images are 72dpi as most camera's now use that, so that side of things seems okay.

Other than that I can't think of anything.