Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Cache folder URL #129

Open
Colir opened this issue Sep 17, 2015 · 2 comments
Open

Cache folder URL #129

Colir opened this issue Sep 17, 2015 · 2 comments

Comments

@Colir
Copy link

Colir commented Sep 17, 2015

Hi.
After retrieving a WP's database online, and setting up this one in my localhost,
WP Thumb try to get image from cache with this url:
locahost/upload/cache/folder-image/image.jpg

As you see there is a '' in the cache folder url. if i remove it manually, this work great.

I'm on a Windows machine, and when i install WP with WP Thumb in my localhost, i never encountered this error...

This seems to happen only after retriving a WP's database from online..

Can you help me please.

Thanks you very much

@Colir
Copy link
Author

Colir commented Sep 17, 2015

i 've identified the problem.
This wrong url appears when i ask to WordPress to not organize my files at upload (directory 'uploads/year/month').

In this case, the generated images by WP Thumb are at the root of the folder 'cache', and the wrong url is generated.

I 've found a patch:

I add this line at line 307

$subdir = dirname( str_replace( $upload_dir['basedir'], '', $this->getFilePath() ) );
if ($subdir == DIRECTORY_SEPARATOR) { $subdir = ''; }

and at line 313

$subdir = dirname( str_replace( WP_CONTENT_DIR, '', $this->getFilePath() ) );
if ($subdir == DIRECTORY_SEPARATOR) { $subdir = ''; }

i will made a pull request

@Colir
Copy link
Author

Colir commented Sep 17, 2015

In fact, i didn't understand how to submit this modification in a pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant