rifanece / timthumb

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

Rendering images with spaces in their path #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I try to resize images with spaces in them, I get this error

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 
'http://example.com/img/some thing.jpg' is not a valid JPEG file in 
/home/timthumb.php on line 308

I even tried using %20 but failed

Original issue reported on code.google.com by suhas.sh...@gmail.com on 10 May 2010 at 12:51

GoogleCodeExporter commented 8 years ago
Here's a suggestion..

This script cache's images alright. So, We can rename the file (strip spaces) 
and then 
render the image.

So, how about it?

Original comment by suhas.sh...@gmail.com on 12 May 2010 at 7:30

GoogleCodeExporter commented 8 years ago
Sorry, 

it just creates a file with the same filename, thats it... the image is not 
quite 
right..

Original comment by suhas.sh...@gmail.com on 17 May 2010 at 8:30

GoogleCodeExporter commented 8 years ago
Got the solution! .. Just use %2B instead of %20

Original comment by suhas.sh...@gmail.com on 19 May 2010 at 3:12

GoogleCodeExporter commented 8 years ago
<? $space = array("%20", "+", " ");
$tehimg = str_replace($space, "%2B", "http://blah.com/yay.jpg"); ?>

<img src=timthumb.php?src=<? echo $tehimg; ?> >

I think this should work..

Original comment by suhas.sh...@gmail.com on 19 May 2010 at 3:24

GoogleCodeExporter commented 8 years ago
Works great ! This should be fixed right now !

Original comment by djevrek on 19 Oct 2010 at 4:59

GoogleCodeExporter commented 8 years ago
:) ... Fixed it here..... 
http://suhastech.com/wp-content/uploads/2010/06/timthumb.txt

Original comment by suhas.sh...@gmail.com on 19 Oct 2010 at 5:40

GoogleCodeExporter commented 8 years ago

Original comment by BinaryMoon on 26 Nov 2010 at 11:48