Laravel-medialibrary: Conversions folder not being generated on server?

Created on 17 Sep 2015  路  4Comments  路  Source: spatie/laravel-medialibrary

Hi,

First, thank you for creating this library. It has been really helpful and working well until recently. However, for some reason, the conversions folder is no longer being created on my server. Any thoughts on what might be causing this? The original file is being uploaded properly and calling getFirstMediaUrl('images', 'thumbnail') returns the proper url, but the actual conversions folder and the appropriate file do not exist. As far as I'm aware, no errors are being thrown.

Server permissions on the public folder are 777 and gd is installed.

My model

...
use Spatie\MediaLibrary\HasMedia\Interfaces\HasMediaConversions;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;

class Listing extends Model implements HasMediaConversions
{

    use HasMediaTrait;

        ...

    public function registerMediaConversions(){
        $this->addMediaConversion('thumbnail')
            ->setManipulations(['w' => 150, 'h' => 170])
            ->performOnCollections('images');
    }
...
}

Add the method where the upload is taking place

        if ( $request->hasFile('thumbnail'))  {
            $listing->addMedia($request->file('thumbnail'))->toCollection('images');
        }

Thanks for your help!

Most helpful comment

For anyone else ending up here with a similar issue:

  • The "conversions" are handled/generated by Laravel's queue-jobs
  • If your QUEUE_DRIVER env-variable is set to sync, then it will just generate them automatically
  • If, on the other hand, like in my case, it's set to something else (like database or redis etc.), then it will just insert those jobs in that queue
  • To process those jobs you'll have to either (a) manually run php artisan queue:work or (b) have some sort of automatic process that executes that command for you (like e.g. a cronjob)

All 4 comments

Whelp. I'm dumb. It was an issue with my queue handler. Thanks!

I'm glad you found the solution quickly :+1:

I know it is a old issue but i am having a similar problem. Could one of you please tell me how this is fixed?

For anyone else ending up here with a similar issue:

  • The "conversions" are handled/generated by Laravel's queue-jobs
  • If your QUEUE_DRIVER env-variable is set to sync, then it will just generate them automatically
  • If, on the other hand, like in my case, it's set to something else (like database or redis etc.), then it will just insert those jobs in that queue
  • To process those jobs you'll have to either (a) manually run php artisan queue:work or (b) have some sort of automatic process that executes that command for you (like e.g. a cronjob)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

swash13 picture swash13  路  3Comments

whdckszxxx picture whdckszxxx  路  4Comments

xron89 picture xron89  路  3Comments

eichgi picture eichgi  路  3Comments

ideadx picture ideadx  路  4Comments