Solved: failed image renders from blank lines in config.php

robroyaus

Joined: 2003-10-29
Posts: 1
Posted: Mon, 2005-02-07 22:34

Just in case you too are tearing your hair out...

In my newly installed Gallery 2 install, I was able to upload images but unable to see thumbnails or images in my web pages (via Xaraya integration as it happens, but thats not really relevant as it turns out)

A rectangle of the correct size would flash up but then disappear. When I did a View Source to copy the url for the generated image and paste it into the browers URL window, I got a screen with

Warning: Cannot modify header information - headers already sent by (output started at /home/roblog/public_html/gallery/config.php:144) in /home/roblog/public_html/gallery/modules/core/DownloadItem.inc on line 162

repeated four or so times, then a string of "random" characters from the binary data of the image.

The clue is in the message if you know where to look. When I checked my config.php, I found a series of blank lines after the closing ?>, probably inserted by the cruddy browser-based text editor included with my hosting solution.

I removed everything after the ?>, and BEHOLD! Images!

So... the moral is to check your config.php finishes after the closing ?>