image
image copied to clipboard
guzzlehttp/psr7 v2.0 API change breaks part of the library
Hello,
With the new PSR7 library released a few days ago, some API has changed and it broke the StreamCommand that I was using. Is there any plan to upgrade the API in order to support the latest version of PSR7?
For your reference https://github.com/guzzle/psr7/blob/c0dcda9f54d145bd4d062a6d15f54931a67732f9/README.md#upgrading-from-function-api
Thanks
Using version ^2.5 for intervention/image
./composer.json has been updated
Running composer update intervention/image
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- intervention/image[2.5.0, ..., 2.5.1] require guzzlehttp/psr7 ~1.1 -> found guzzlehttp/psr7[1.1.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires intervention/image ^2.5 -> satisfiable by intervention/image[2.5.0, 2.5.1].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I'm facing issues with guzzlehttp/psr7 on a new Laravel project. Related?
I think this will fix it #1094
For those who face this issue as well when running composer require intervention/image on a Laravel 8 install.
Run:
composer require intervention/image:"master"
This will get the master branch with fix indicated above in #1094
I think this will fix it #1094
why not draft a new released
There are 2 issues here. Updating the dependency to ^2.0 will solve @bilogic's issue
In my case, I get an error saying the stream_for() function doesn't exist. For example, if you inspect StreamCommand.php
You'll see this:
$this->setOutput(\GuzzleHttp\Psr7\stream_for(
$image->encode($format, $quality)->getEncoded()
));
That's because it has been replaced with Utils::streamFor in v2.0. Switching to this works but I am sure it'll break the package for people not using the latest version.
$this->setOutput(\GuzzleHttp\Psr7\Utils::streamFor(
$image->encode($format, $quality)->getEncoded()
));
run composer require intervention/image -w
@Cynically my apologies if I hijacked your issue. To others, my issue has since been resolved with the use of composer require intervention/image -W
. There might be other solutions, but this was what worked for me. Thank you.
This issue is preventing users from uploading avatars in the Flarum software when they make a new installation or update all their dependencies since it automatically makes the PSR7 package jump to ^2.0 and cause the stream_for
error https://github.com/flarum/core/issues/2966
We are currently suggesting users require version ^1.1 of PSR7 package manually as a workaround, but a fix here would be appreciated.
Same issue here, but I can't use version ^1.1 because ^2.0 is required by other dependencies
"message": "Call to undefined function GuzzleHttp\\Psr7\\stream_for()",
"exception": "Error",
"file": "\\vendor\\intervention\\image\\src\\Intervention\\Image\\Commands\\StreamCommand.php",
"line": 19,
Facing this issue in my application as well. Image uploads are broken now. Laravel throws the following error:
Call to undefined function GuzzleHttp\Psr7\stream_for()
Please use Version 3 of Intervention Image.