Closed GoogleCodeExporter closed 9 years ago
Actually, it's not a base_folder config option that is needed, but a doc_root
option. This would require very little change to the code, just add two lines
to calcDocRoot, and I have a very good use case:
The current version of timthumb.php doesn't work for user_dir in Apache. The
reason is that DOCUMENT_ROOT is (typically) /var/www, but the user home
directory is (typically) /home/username/public_html. Since these have no common
part, the images locate somewhere below /home/username/public_html will never
be found by timthumb.
Thx for listening.
Original comment by hansfn@gmail.com
on 23 Nov 2011 at 10:24
what are the two lines you would add to calcDocRoot?
Original comment by BinaryMoon
on 24 Nov 2011 at 8:52
I can write a proper patch later tonight (with those two lines ++).
PS! Why didn't I get an email change notification? That should be automatic for
people that have commented and I thought it was ...
Original comment by hansfn@gmail.com
on 24 Nov 2011 at 8:22
PS! Issue 271 is strongly connected to this issue. They aren't 100% identical,
but a solution here could fix the problems in issue 271 too.
Original comment by hansfn@gmail.com
on 24 Nov 2011 at 8:30
Patch against rev 190 attached. It does nothing unless you define
LOCAL_FILE_BASE_DIRECTORY in timthumb-config.php.
In the use case I described above, the needed line in timthumb-config.php would
be:
define ('LOCAL_FILE_BASE_DIRECTORY', '/home/username/public_html');
Original comment by hansfn@gmail.com
on 24 Nov 2011 at 9:06
Attachments:
@BinaryMoon: Did you miss my patch above? It's trivial so it shouldn't be hard
to decide whether you accept it or not.
Original comment by hansfn@gmail.com
on 3 Dec 2011 at 6:49
I didn't miss it - I just don't check the issues every day.
I have implemented a much simpler version of what you are suggesting. Same
theory, but only 3 lines of code added to calcDocRoot method.
Hansfn - no idea why you didn't get an email notification I'm afraid. I would
assume it's automatic too.
Original comment by BinaryMoon
on 5 Dec 2011 at 10:24
Thx, Binarymoon. Very much appreciated.
PS! The reason I didn't change calcDocRoot was in case you used it for
something else. Making the change only in getLocalImagePath I knew it would
have minimal impact.
Original comment by hansfn@gmail.com
on 6 Dec 2011 at 7:44
Original issue reported on code.google.com by
harm.kra...@gmail.com
on 21 Nov 2011 at 9:37