Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/encoder-options' into next
- Loading branch information
Showing
100 changed files
with
644 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
use Intervention\Image\Exceptions\DecoderException; | ||
use Intervention\Image\Interfaces\ColorInterface; | ||
use Intervention\Image\Interfaces\DecoderInterface; | ||
use Intervention\Image\Interfaces\ImageInterface; | ||
use Intervention\Image\Interfaces\SpecializableInterface; | ||
|
||
abstract class AbstractDecoder implements DecoderInterface, SpecializableInterface | ||
{ | ||
public function decode(mixed $input): ImageInterface|ColorInterface | ||
{ | ||
throw new DecoderException('Object must be specialized by the driver first.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class Base64ImageDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class BinaryImageDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class DataUriImageDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class FilePathImageDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class FilePointerImageDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class ImageObjectDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Decoders; | ||
|
||
class SplFileInfoImageDecoder extends AbstractDecoder | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Drivers; | ||
|
||
use Intervention\Image\Interfaces\DriverInterface; | ||
use Intervention\Image\Interfaces\SpecializedInterface; | ||
|
||
abstract class DriverSpecialized implements SpecializedInterface | ||
{ | ||
protected DriverInterface $driver; | ||
protected object $generic; | ||
|
||
public function __construct() | ||
{ | ||
} | ||
|
||
public static function buildSpecialized(object $generic, DriverInterface $driver): SpecializedInterface | ||
{ | ||
$specialized = new static(); | ||
$specialized->generic = $generic; | ||
$specialized->driver = $driver; | ||
|
||
return $specialized; | ||
} | ||
|
||
public function driver(): DriverInterface | ||
{ | ||
return $this->driver; | ||
} | ||
|
||
public function generic(): object | ||
{ | ||
return $this->generic; | ||
} | ||
|
||
/** | ||
* Magic method to read attributes of underlying modifier | ||
* | ||
* @param string $name | ||
* @return mixed | ||
*/ | ||
public function __get(string $name): mixed | ||
{ | ||
return $this->generic->$name; | ||
} | ||
|
||
/** | ||
* Magic method to call methods of underlying modifier | ||
* | ||
* @param string $name | ||
* @param array $arguments | ||
* @return mixed | ||
*/ | ||
public function __call(string $name, array $arguments): mixed | ||
{ | ||
return $this->generic->$name(...$arguments); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.