oseawey / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Getting file not found error on external images #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Getting this error on windows when try to resize external image. However, the 
image is resized and added to the cache fine. When request in the browser via 
timthumb, get this (note, I am using different GET params for compatibility 
with legacy script)

file not found 
C:/WebFolders/mysite/images/cache/e59056c208628b623b7392110a368acb.jpg
Query String : 
image=http://www.amante.com.au/xcart/images/P/539404_b.jpg&size=100
TimThumb version : 1.19

Original issue reported on code.google.com by dal...@gmail.com on 5 Dec 2010 at 11:43

GoogleCodeExporter commented 9 years ago
update: this is because get_document_root is checking here

C:/WebFolders/mysite/C:/WebFolders/mysite/images/cache/e59056c208628b623b7392110
a368acb.jpg

have i set my cache path wrong?

Original comment by dal...@gmail.com on 5 Dec 2010 at 11:59

GoogleCodeExporter commented 9 years ago
i want to set my cache to /images/cache under the document root. i had set 
DIRECTORY_CACHE to $_SERVER['DOCUMENT_ROOT'].'/images/cache' - was this not 
correct?

Original comment by dal...@gmail.com on 6 Dec 2010 at 12:02

GoogleCodeExporter commented 9 years ago
i think all my errors are related to running it on windows. i uploaded to my 
unix server and it works fine.

Original comment by dal...@gmail.com on 6 Dec 2010 at 3:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
An issue I've found is that the path building in get_document_root uses 
array_diff() which can fail if there is a duplicate folder name within the 
document root.  A better way to handle this is something more along the lines 
of:

$parts = explode('/', substr($_SERVER['SCRIPT_FILENAME'], 
strlen($_SERVER['DOCUMENT_ROOT'])));

Original comment by ITProSt...@gmail.com on 4 May 2011 at 6:21

GoogleCodeExporter commented 9 years ago

Original comment by BinaryMoon on 20 Jun 2011 at 3:44