Comments (3)
Okay, so I've just messed around with how you could manually create an instance of the Request
object, and it can be done like so:
use Symfony\Component\HttpFoundation\Request;
$request = new Request(
[
'w' => (string) 100,
],
[],
[],
[],
[],
[
'REQUEST_URI' => '/rose.jpg'
]
);
Just a little messy, so a factory helper is probably smart.
from glide.
The other option is that we still allow the sending of the $filename
and $params
values to the method, and those methods just convert them into a Request
object behind the scenes.
This sort of comes down to what is more likely. Will people prefer to send these in manually, or will they prefer to simply send an instance of the Request
object? I sort of feel like the prior (two parameters) if they are using Glide within an app, and the later (request object) if they are using Glide as it's own image server.
# Option 1 (most likely used in image server)
public function outputImage(Request $request)
public function getImageResponse(Request $request)
public function makeImage(Request $request)
# Option 2 (most likely used within an app)
public function outputImage($filename, Array $params)
public function getImageResponse($filename, Array $params)
public function makeImage($filename, Array $params)
Would it be terrible if these methods accepted both options?
- If the first parameter is an instance of
Request
, use it and ignore the second parameter. - If the first parameter is a
string
, use it with the second parameter (array) to create a newRequest
instance.
from glide.
Done: cfc837d
Ended up allowing three methods to accept either an instance of Request
, or a string
and array
combination, which is automatically converted into a Request instance.
from glide.
Related Issues (20)
- [ feature ] Save resized files to another directory with different link
- Create custom 404 route? HOT 1
- Repeat watermarks
- Mockery error in League\Glide\ServerTest::testMakeImageFromSource HOT 1
- Could not find the image error in Laravel
- how to get with and height of picture after glide traitement HOT 2
- Image will not manipulate when using crop focus zoom and when resize dimensions are equal to original asset dimensions
- ImagickException: NoDecodeDelegateForThisImageFormat `PNG' HOT 1
- Black border added to images during processing HOT 3
- generate a temporarySignedRoute
- Feature request for base_url option to be regular expression
- HEIC format support HOT 2
- We need upgrading to intervention/image ^3 please HOT 2
- Differences in the use of fit=fill and fit=fill-max HOT 3
- Cannot make it working in RAW PHP... pls help 🙇♂️
- upgrade intervention/image to V3 HOT 1
- locale srouce and cache with cdn setting
- not working with laravel 11 HOT 1
- Support intervention/image:^3 HOT 4
- 3.x release date HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glide.