image icon indicating copy to clipboard operation
image copied to clipboard

Couldn't find a way to provide custom headers for Image::make()

Open zaheer15351 opened this issue 3 years ago • 1 comments

We have encountered some cases where Image::make() doesn't work if passed an image URL as a parameter. The URL requires some specific headers along with the request in order to make connection but using Intervention library, we couldn't find any way to provide additional/custom headers.

Digging deep into the library, I can see in Intervention/Image/AbstractDecoder.php method initFromUrl() has predefined set of headers but these should be extendable.

EDIT: You can try "https://www.dhl.com/content/dam/General%20DHL%20pictures/IARefresh/Homepage/Rotator/automotive_203x125.jpg"

zaheer15351 avatar Mar 02 '21 11:03 zaheer15351

Made a Code Relay task for this: https://github.com/code-relay-io/image/blob/master/README.md . We will work on it!

mmulet avatar Mar 19 '21 11:03 mmulet

Running into the same issue. Need to be able to provide headers for connection purposes. This is helpful for working with various cloud networking set ups.

kdevan avatar Nov 11 '22 07:11 kdevan

The integration of the option to read data directly via URLs was a mistake. The task of this library is image manipulation. Reading data via HTTP should be done by a corresponding client. For this reason, Intervention Image Version 3 does not support reading URLs.

olivervogel avatar Dec 08 '23 18:12 olivervogel