fabianmichael/kirby-imagekit

Create thumbnails in panel fails

omz13 opened this issue · 3 comments

omz13 commented

When trying to create thumbnails from the panel, after scanning the pages in my site the following error is shown:

Call to a member function image() on boolean in file: [...]/site/plugins/imagekit/lib/lazythumb.php on line: 143

Any ideas what I can do to narrow down/fix the issue?

Did you rename a page or more specifically change the slug of a page that had thumbnail jobs in the queue? Your error message probably means, that the page of a thumbnail was not found. Best ways for narrowing down which file causes the issue would be to either set a breakpoint with XDebug at that specific line or — if you’re not into dedicated debuggers — just insert a die() statement or similar in lazythumb.php right before line 143 to know where your error comes from.

If you can confirm that the issue is caused by what I believe it causes it, I will implement better error handling at this point.

https://github.com/fabianmichael/kirby-imagekit/blob/master/lib/lazythumb.php#L143

omz13 commented

Ah. OK. I had deleted some pages that were no longer needed... so I now I cleaned out the thumbs cache from the panel (and double checked that the thumbs directory was empty), and now create thumbs from the panel works.

(I'm working in my development environment, and I did delete a few pages manually instead of using the panel, so I guess imagekit somehow got confused by this... even so, perhaps it would be better to soft error instead of failing hard?)

Had the same issue today :( Had to delete all my thumbs an re-create them (which can be a veeeery long task on a limited server environment)

I've renamed a page maybe that was the problem, I am not sure if some of its thumbs were in the queue already.. Is there a way to prevent this from happening in the future?

bildschirmfoto 2018-01-08 um 22 59 20

Dennis