Fixed thumb generating
New thumbs worked only after refreshing the page and showed placeholder thumb prior to that. Now they load correctly without need to reload.
This commit is contained in:
parent
a38b280098
commit
a2507370cc
2 changed files with 5 additions and 1 deletions
|
@ -29,8 +29,9 @@ class GetPostThumbJob extends AbstractJob
|
||||||
$post = $this->postRetriever->retrieve();
|
$post = $this->postRetriever->retrieve();
|
||||||
|
|
||||||
$post->generateThumb($width, $height);
|
$post->generateThumb($width, $height);
|
||||||
|
$path = PostModel::tryGetWorkingThumbPath($name, $width, $height);
|
||||||
|
|
||||||
if (!file_exists($path))
|
if (!$path)
|
||||||
{
|
{
|
||||||
$path = getConfig()->main->mediaPath . DS . 'img' . DS . 'thumb.jpg';
|
$path = getConfig()->main->mediaPath . DS . 'img' . DS . 'thumb.jpg';
|
||||||
$path = TextHelper::absolutePath($path);
|
$path = TextHelper::absolutePath($path);
|
||||||
|
|
|
@ -17,6 +17,9 @@ class GetPostThumbJobTest extends AbstractTest
|
||||||
|
|
||||||
$this->assert->isNotNull($post->tryGetWorkingFullPath());
|
$this->assert->isNotNull($post->tryGetWorkingFullPath());
|
||||||
$this->assert->areEqual('image/jpeg', $output->mimeType);
|
$this->assert->areEqual('image/jpeg', $output->mimeType);
|
||||||
|
$this->assert->areNotEqual(
|
||||||
|
file_get_contents(getConfig()->main->mediaPath . DS . 'img' . DS . 'thumb.jpg'),
|
||||||
|
$output->fileContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIdFail()
|
public function testIdFail()
|
||||||
|
|
Loading…
Reference in a new issue