-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Collection of breaking change ideas for next major version #1391
Comments
Standardization and simplification of offset parametersTo specify parameters for offsets, For example, just |
More universal ColorInterface::create() methodCurrently only string values of the colors are processed. It would also be nice if the values of the color channels could be specified directly. use Intervention\Image\Colors\Rgb\Color;
// currently
$color = Color::create('rgb(255, 255, 255)');
// more universal
$color = Color::create('rgb(255, 255, 255)');
$color = Color::create(255, 255, 255); |
Change from scale (int) 0 - 100 to (float) 0 - 1, for more precise input options.Many functions use 0 - 100 integers as the standard for inputs. For a more precise definition of values, you could consider switching to float values from 0 - 1.
|
Switch to dedicated methods for readingThe universal method for reading images // before
ImageManager::read();
// after
ImageManager::readFromFilePath();
ImageManager::readFromBinary();
ImageManager::readFromBase64();
ImageManager::readFromDataUri();
ImageManager::readFromStream();
ImageManager::readFromSplFileInfo();
ImageManager::readFromNative(); |
Rename Image::blendTransparency() to Image::background()Could be shorter and more handy. |
Add in DriverInterface::version(): stringCould be useful to read out the version of the underlying image library. $version = Driver::version(); // "1.2.3" |
Include Driver::version() in DriverInterface::class |
Image on-demand-evaluationConversion to so-called on-demand evaluation of image objects. This means that image objects are only loaded internally into the memory when they are actually needed. Before that, they are simply a sequence of commands. Example: $image = ImageManager::withDriver($classname)
->read('image.jpg') // call delayed and saved in stack: no real image
->resize(300, 200) // call delayed and saved in stack: no real image
->brightness(10) // call delayed and saved in stack: no real image
->contrast(5) // call delayed and saved in stack: no real image
->sharpen() // call delayed and saved in stack: no real image
->toPng(); // Image only becomes real at this point: Stack is evaluated completely |
Replace string defined mime types with
|
Collection of ideas that would be nice to have but would introduce a BC and would therefore only be possible in the next major version.
Please note that this is an initial collection of ideas that may or may not be adopted.
The text was updated successfully, but these errors were encountered: