Open GoogleCodeExporter opened 8 years ago
I hope this wasn't overlooked or maybe I wasn't clear. I set an image default
to be shown if there is an error - for example if the first image is on a
server not in the allowed domain list.
I get the error but the error image isn't shown. It is the same as the default
image used for the related posts but error message says image is invalid
Original comment by voncadf...@gmail.com
on 20 Sep 2011 at 9:07
I had a similar problem and managed to resolve it a few minutes ago. The
attached file has a file size of 12.6Kb and can be confirmed using stat in
linux:
File: `no_image.png'
Size: 12230 Blocks: 24 IO Block: 4096 regular file
...
And the correct type is being detected as well if I use file on the CLI:
no_image.png: PNG image data, 395 x 395, 8-bit/color RGB, non-interlaced.
The funny thing is if you try and view the file size with something like
imagemagick GUI it has a file size of 0 bytes. When trying to access the file
via timthumb the script is setting the header "Content-Length" to 0 and the
browser interprets that the file is truncated or incomplete, but the file is
actually fine if you load it up in the browser.
With the latest version of Timthumb I changed line 1224 from:
header ('Content-Length: ' . filesize($file) );
to:
if(filesize($file)) {
header ('Content-Length: ' . filesize($file) );
}
This solves the issue for valid images but might not be an ideal workaround if
an image really is 0 bytes.
Original comment by and...@gmail.com
on 14 Nov 2012 at 1:57
Attachments:
Original issue reported on code.google.com by
voncadf...@gmail.com
on 8 Sep 2011 at 11:19Attachments: