Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glide version 0.3.0 #1

Closed
reinink opened this issue Jan 28, 2015 · 8 comments
Closed

Glide version 0.3.0 #1

reinink opened this issue Jan 28, 2015 · 8 comments

Comments

@reinink
Copy link

reinink commented Jan 28, 2015

Hey @freekmurze, thanks so much for putting this library together. I just wanted to let you know that I just released Glide version 0.3.0. I'll be honest, this release has many breaking changes from version 0.2.x. I apologize for that, but I did want to make all significant changes prior to an eventual 1.0 release. You can find the changelog here.

I will note that I designed version 0.3.0 with Laravel 5 in mind. In fact, Taylor was even kind enough to accept a tweak to the new filesystem adapter in Laravel 5 to to allow access to underlying Flysystem driver. This allows you to use the already configured Flysystem instance with Glide. Here is a rough example:

$this->app->singleton('League\Glide\Server', function ($app) {

    $filesystem = $this->app->make('Illuminate\Contracts\Filesystem\Filesystem');

    return League\Glide\ServerFactory::create([
        'source' => $filesystem->getDriver(),
        'cache' => $filesystem->getDriver(),
        'source_path_prefix' => 'path/to/source/images',
        'cache_path_prefix' => 'path/to/image/cache',
    ]);
});

Laravel 5 was also a big reason why I added the new source_path_prefix and cache_path_prefix options. Normally you would just set this when create your Flysystem objects, but since you only have one instance available in Laravel 5 you need a way to set the source and cache paths at the Server level.

You'll also notice that I rearranged the folder structure significantly in this version as well, so there are a bunch of new class names and namespaces. This was a bit painful, but I think it was a good move thinking long term.

Just thought I'd touch base and bring you up to speed on all this! :)

@freekmurze
Copy link
Member

Hi @reinink,

thanks for letting me know. I'll implement the necessary changes in my package during the coming weeks.

And also a big thank you for keeping Glide awesome! 👍

@freekmurze
Copy link
Member

The new version 0.3.0 of this package is compatible with Glide 0.3.0.

@reinink
Copy link
Author

reinink commented Jan 30, 2015

Awesome! :)

@reinink
Copy link
Author

reinink commented Jan 30, 2015

And not telling you what to do, but have you considered a slightly less verbose API? I haven't thought this through too much, but I'm thinking something like this:

<img src="{{ Glide::image('kayaks.jpg')->modify(['w' => 50, 'filt' => 'greyscale']) }}" />

Or even:

<img src="{{ Glide::image('kayaks.jpg', ['w' => 50, 'filt' => 'greyscale']) }}" />

Or even extending Blade?

<img src="@image('kayaks.jpg', ['w' => 50, 'filt' => 'greyscale'])" />

Just an idea, that's all! 😜

@freekmurze
Copy link
Member

Thanks for your fine suggestions! I'll probably change the API a bit in that direction you're pointing to.

Next week I plan on playing with the stable release of Laravel 5 quite a bit and I'll look into extending Blade.

@reinink
Copy link
Author

reinink commented Jan 30, 2015

Good stuff Freek, and again I didn't think through it too much, so keep that in mind. ;)

@freekmurze
Copy link
Member

Hi @reinink,

just wanted to let you know that we followed a few of your suggestions for making the API somewhat less verbose. The package is now also L5 compatible.

I also plan on using the already configured L5 Flysystem instance in the next release.

@reinink
Copy link
Author

reinink commented Feb 12, 2015

Awesome dude! Good stuff. 👍

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

No branches or pull requests

2 participants