Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
98
vendor/intervention/image/src/Drivers/AbstractDecoder.php
vendored
Normal file
98
vendor/intervention/image/src/Drivers/AbstractDecoder.php
vendored
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Intervention\Image\Drivers;
|
||||
|
||||
use Exception;
|
||||
use Intervention\Image\Collection;
|
||||
use Intervention\Image\Exceptions\DecoderException;
|
||||
use Intervention\Image\Exceptions\InvalidArgumentException;
|
||||
use Intervention\Image\Exceptions\RuntimeException;
|
||||
use Intervention\Image\Interfaces\CollectionInterface;
|
||||
use Intervention\Image\Interfaces\DecoderInterface;
|
||||
use Intervention\Image\Traits\CanBuildStream;
|
||||
use Intervention\Image\Traits\CanParseFilePath;
|
||||
use Stringable;
|
||||
use Throwable;
|
||||
|
||||
abstract class AbstractDecoder implements DecoderInterface
|
||||
{
|
||||
use CanBuildStream;
|
||||
use CanParseFilePath;
|
||||
|
||||
/**
|
||||
* Determine if the given input is GIF data format.
|
||||
*/
|
||||
protected function isGifFormat(string $input): bool
|
||||
{
|
||||
return str_starts_with($input, 'GIF87a') || str_starts_with($input, 'GIF89a');
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract and return EXIF data from given input which can be a file path
|
||||
* or a stream stream resource.
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @throws DecoderException
|
||||
* @return CollectionInterface<string, mixed>
|
||||
*/
|
||||
protected function extractExifData(string $input): CollectionInterface
|
||||
{
|
||||
if (!function_exists('exif_read_data')) {
|
||||
return new Collection();
|
||||
}
|
||||
|
||||
try {
|
||||
// source might be file path
|
||||
$source = self::readableFilePathOrFail($input);
|
||||
} catch (Throwable) {
|
||||
try {
|
||||
// source might be stream resource
|
||||
$source = self::buildStreamOrFail($input);
|
||||
} catch (RuntimeException) {
|
||||
return new Collection();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// extract exif data
|
||||
$data = @exif_read_data($source, null, true);
|
||||
} catch (Exception) {
|
||||
$data = [];
|
||||
} finally {
|
||||
if (is_resource($source)) {
|
||||
fclose($source);
|
||||
}
|
||||
}
|
||||
|
||||
return new Collection(is_array($data) ? $data : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes given base64 encoded data.
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @throws DecoderException
|
||||
*/
|
||||
protected function decodeBase64Data(mixed $input): string
|
||||
{
|
||||
if (!is_string($input) && !$input instanceof Stringable) {
|
||||
throw new InvalidArgumentException(
|
||||
'Base64-encoded data must be either of type string or instance of Stringable',
|
||||
);
|
||||
}
|
||||
|
||||
$decoded = base64_decode((string) $input, true);
|
||||
|
||||
if ($decoded === false) {
|
||||
throw new DecoderException('Input is not valid Base64-encoded data');
|
||||
}
|
||||
|
||||
if (base64_encode($decoded) !== str_replace(["\n", "\r"], '', (string) $input)) {
|
||||
throw new DecoderException('Input is not valid Base64-encoded data');
|
||||
}
|
||||
|
||||
return $decoded;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue