Closed KarelWintersky closed 4 weeks ago
It is ok. $i1 and $i2 have the same Image instance.
Hello, @KarelWintersky ! Thank you for using Aplus Framework!
The Image class implements a design called fluent interface.
To generate two different images you need to create two Image objects:
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Framework\Image\Image;
$filename = __DIR__ . '/test.jpg';
$width = 200;
$height = 200;
$marginLeft = 100;
$marginTop = 100;
$i1 = new Image($filename);
$i1->crop($width, $height, $marginLeft, $marginTop)
->save('test_crop.jpg');
$i2 = new Image($filename);
$i2->filter(IMG_FILTER_NEGATE)
->save('test_negate.jpg');
I hope I could help you.
yes, i know that you can do that. i was hoping that the framework would implement the ability to process the same image object in different ways. unfortunately no framework (except mine) can do that.
Both images are cropped and negated.