refactor: Modernize horde/Image to PER-1, PSR-4, typed interfaces and DI-friendly design#6
Merged
Conversation
602b016 to
5aeedda
Compare
… DI-friendly design New modern API under src/ (Horde\Image namespace, PSR-4 autoloaded) coexists with legacy lib/ code. PHP 8.2+ strict types throughout. What changed: - ImageDriver/ImageResource/SequenceDriver interface hierarchy (ISP) - ImagickDriver, GdDriver, ImDriver (CLI), SvgDriver, PngDriver, NullDriver backends - Immutable Color value object with named(), lighten(), darken(), intensify(), brightness(), toGray() utilities - NamedColors lookup (140+ CSS color names) - DrawingContext with path-based API and state stack - SvgDrawingContext producing SVG DOM output - Brush utility with BrushShape enum (Square, Circle, Diamond, Triangle) - FontSize enum with bidirectional lookup (Tiny/Small/Medium/Large/Giant) - TextStyle accepts FontSize or raw float - Filter classes: Brightness, Contrast, Gamma, Grayscale, Colorize, Modulate, Sepia, Negate, Sharpen, Pixelate, Blur - Effect classes: TextWatermark, PolaroidImage, PhotoStack, Border, DropShadow, RoundCorners, SmartCrop, CenterCrop, LiquidResize, Composite - ImageSequence/Frame/AnimationOptions for multi-frame images - Metadata system: BundledReader, PhpExifReader, ImagickReader, ExiftoolReader with GPS parsing and MakerNote support - ImageFactory DI wrapper - Pure PHP PNG writer (PngDriver) as zero-dependency fallback - Full PHPStan level 8 compliance Not yet ported from legacy: - SWF/Flash backend (Flash EOL 2020)
5aeedda to
8151954
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New modern API under
src/(Horde\Imagenamespace, PSR-4 autoloaded) coexists with legacylib/code. PHP 8.2+ strict types throughout.What changed
Interfaces
Backends
Color
Drawing
Filters
Effects
Sequences
Metadata
Other
Not yet ported from legacy
Test plan