Giter Site home page Giter Site logo

Comments (14)

frasmage avatar frasmage commented on June 11, 2024 1

Released 6.1.0 which will attempt to automatically pick a driver while still allowing it to be configured using intervention/image-laravel.

from laravel-mediable.

edux04 avatar edux04 commented on June 11, 2024

I have the same issue, Laravel 11 and PHP 8.3.

from laravel-mediable.

frasmage avatar frasmage commented on June 11, 2024

Hi there, so this isn't a bug with the package, it's just that Laravel doesn't know which driver to use when building Intervention image class without you telling it. It isn't really up to this package to pick for you, as you may have other code using the library already in place.

Adding the following to a service provider would be sufficient:

// for GD
$app->bind(Intervention\Image\Interfaces\DriverInterface::class, \Intervention\Image\Drivers\Gd\Driver::class);

// or for Imagick
$app->bind(Intervention\Image\Interfaces\DriverInterface::class, \Intervention\Image\Drivers\Imagick\Driver::class);

Preferably, you can use the intervention/image-laravel package to configure intervention/image, then Mediable will be able to load it from the container already set up.

I'm sure that others will run into similar issues, so I will add a note about this to the documentation. Thank you for bringing it to my attention

from laravel-mediable.

sgtcoder avatar sgtcoder commented on June 11, 2024

It works fine on Plank Mediable 5 and also on Image Intervention version 2.

We shouldn't need to make all these changes to get it to work.

from laravel-mediable.

frasmage avatar frasmage commented on June 11, 2024

That is a change in the intervention/image package, not this one. Version 2 of intervention/image would automatically assume the use of GD as a driver, if no other was specified. Version 3 no longer makes that assumption, and requires a driver to be explicitly provided.

You are welcome to pin your application's composer.json to use "intervention/image": "^2.0" if you prefer that one. This package is compatible with both.

from laravel-mediable.

sgtcoder avatar sgtcoder commented on June 11, 2024

I am using Imagick with v2 and somehow it works.

Are you able to put that in your composer requirements?

So everyone doesn't have to run through this same issue?

from laravel-mediable.

frasmage avatar frasmage commented on June 11, 2024

Some manual configuration was always necessary to use imagick:

  • Do you have a config/image.php file configuring which driver to use, such as the one described in this documentation? Previously the provider was built into the intervention/image package. With V3 this provider is extracted out into the intervention/image-laravel extension.
  • The docs of the this package suggested an alternative from prior to that provider being available (this needs to be updated for V3)

I don't think it make sense to require it (manual installation steps necessary), but I will add the intervention/image-laravel to the composer "suggest" list to provide the reminder. I will also update the docs accordingly with V3 instructions.

from laravel-mediable.

sgtcoder avatar sgtcoder commented on June 11, 2024

I actually was unaware that Plank was using GD by default or why it is even used in the first place?

I do use Imagick post processing to crop, compress, and scale the image. I know Plank doesn't do this.

from laravel-mediable.

frasmage avatar frasmage commented on June 11, 2024

Tagged 6.0.2 with composer suggest and new documentation

from laravel-mediable.

frasmage avatar frasmage commented on June 11, 2024

plank/mediable uses intervention/image as it is available in the Laravel service container, it doesn't configure that 3rd party package for you. If you were previously doing no configuration, then you were using GD which was previously the default of that package.

Yes, the GD extension is capable of cropping and resizing images.

from laravel-mediable.

sgtcoder avatar sgtcoder commented on June 11, 2024

I get that GD is capable of cropping and resizing, but what is Plank using it for?

I am looking into the configuration/package you suggested.

Also, I didn't see anywhere in the Plank documentation about any of this either.

from laravel-mediable.

sgtcoder avatar sgtcoder commented on June 11, 2024

Installing that package throws a new error

Illuminate\Container\EntryNotFoundException 

Intervention\Image\ImageManager

The app bind suggestion also doesn't work on Laravel 11, and v3 removes Laravel support without the laravel package.

from laravel-mediable.

sgtcoder avatar sgtcoder commented on June 11, 2024

OMG, thank you! I ran the composer update and it finally installed successfully and ran the package:discover script.

from laravel-mediable.

frasmage avatar frasmage commented on June 11, 2024

glad it worked! Apologies for the back and forth on this. There was a bit of a chicken and egg situation in the bootstrapping order that I wasn't aware of

from laravel-mediable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.