Showing preview only (1,061K chars total). Download the full file or copy to clipboard to get everything.
Repository: Intervention/image
Branch: develop
Commit: c073d1c93a11
Files: 551
Total size: 933.6 KB
Directory structure:
gitextract_zeq9zksh/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows/
│ └── run-tests.yml
├── .gitignore
├── .well-known/
│ └── funding-manifest-urls
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── composer.json
├── docker-compose.yml
├── phpcs.xml.dist
├── phpstan.dist.neon
├── phpunit.dist.xml
├── readme.md
├── src/
│ ├── Analyzers/
│ │ ├── ColorspaceAnalyzer.php
│ │ ├── HeightAnalyzer.php
│ │ ├── PixelColorAnalyzer.php
│ │ ├── PixelColorsAnalyzer.php
│ │ ├── ProfileAnalyzer.php
│ │ ├── ResolutionAnalyzer.php
│ │ └── WidthAnalyzer.php
│ ├── Collection.php
│ ├── Colors/
│ │ ├── AbstractColor.php
│ │ ├── AbstractColorChannel.php
│ │ ├── Cmyk/
│ │ │ ├── Channels/
│ │ │ │ ├── Cyan.php
│ │ │ │ ├── Key.php
│ │ │ │ ├── Magenta.php
│ │ │ │ └── Yellow.php
│ │ │ ├── Color.php
│ │ │ ├── Colorspace.php
│ │ │ └── Decoders/
│ │ │ └── StringColorDecoder.php
│ │ ├── Hsl/
│ │ │ ├── Channels/
│ │ │ │ ├── Hue.php
│ │ │ │ ├── Luminance.php
│ │ │ │ └── Saturation.php
│ │ │ ├── Color.php
│ │ │ ├── Colorspace.php
│ │ │ └── Decoders/
│ │ │ └── StringColorDecoder.php
│ │ ├── Hsv/
│ │ │ ├── Channels/
│ │ │ │ ├── Hue.php
│ │ │ │ ├── Saturation.php
│ │ │ │ └── Value.php
│ │ │ ├── Color.php
│ │ │ ├── Colorspace.php
│ │ │ └── Decoders/
│ │ │ └── StringColorDecoder.php
│ │ ├── Profile.php
│ │ └── Rgb/
│ │ ├── Channels/
│ │ │ ├── Alpha.php
│ │ │ ├── Blue.php
│ │ │ ├── Green.php
│ │ │ └── Red.php
│ │ ├── Color.php
│ │ ├── Colorspace.php
│ │ └── Decoders/
│ │ ├── HexColorDecoder.php
│ │ ├── HtmlColornameDecoder.php
│ │ ├── StringColorDecoder.php
│ │ └── TransparentColorDecoder.php
│ ├── Config.php
│ ├── Decoders/
│ │ ├── Base64ImageDecoder.php
│ │ ├── BinaryImageDecoder.php
│ │ ├── ColorObjectDecoder.php
│ │ ├── DataUriImageDecoder.php
│ │ ├── EncodedImageObjectDecoder.php
│ │ ├── FilePathImageDecoder.php
│ │ ├── FilePointerImageDecoder.php
│ │ ├── ImageObjectDecoder.php
│ │ ├── NativeObjectDecoder.php
│ │ └── SplFileInfoImageDecoder.php
│ ├── Drivers/
│ │ ├── AbstractDecoder.php
│ │ ├── AbstractDriver.php
│ │ ├── AbstractEncoder.php
│ │ ├── AbstractFontProcessor.php
│ │ ├── AbstractFrame.php
│ │ ├── Gd/
│ │ │ ├── Analyzers/
│ │ │ │ ├── ColorspaceAnalyzer.php
│ │ │ │ ├── HeightAnalyzer.php
│ │ │ │ ├── PixelColorAnalyzer.php
│ │ │ │ ├── PixelColorsAnalyzer.php
│ │ │ │ ├── ResolutionAnalyzer.php
│ │ │ │ └── WidthAnalyzer.php
│ │ │ ├── Cloner.php
│ │ │ ├── ColorProcessor.php
│ │ │ ├── Core.php
│ │ │ ├── Decoders/
│ │ │ │ ├── AbstractDecoder.php
│ │ │ │ ├── Base64ImageDecoder.php
│ │ │ │ ├── BinaryImageDecoder.php
│ │ │ │ ├── DataUriImageDecoder.php
│ │ │ │ ├── EncodedImageObjectDecoder.php
│ │ │ │ ├── FilePathImageDecoder.php
│ │ │ │ ├── FilePointerImageDecoder.php
│ │ │ │ ├── NativeObjectDecoder.php
│ │ │ │ └── SplFileInfoImageDecoder.php
│ │ │ ├── Driver.php
│ │ │ ├── Encoders/
│ │ │ │ ├── AvifEncoder.php
│ │ │ │ ├── BmpEncoder.php
│ │ │ │ ├── GifEncoder.php
│ │ │ │ ├── JpegEncoder.php
│ │ │ │ ├── PngEncoder.php
│ │ │ │ └── WebpEncoder.php
│ │ │ ├── FontProcessor.php
│ │ │ ├── Frame.php
│ │ │ └── Modifiers/
│ │ │ ├── AlignRotationModifier.php
│ │ │ ├── BlendTransparencyModifier.php
│ │ │ ├── BlurModifier.php
│ │ │ ├── BrightnessModifier.php
│ │ │ ├── ColorizeModifier.php
│ │ │ ├── ColorspaceModifier.php
│ │ │ ├── ContainModifier.php
│ │ │ ├── ContrastModifier.php
│ │ │ ├── CoverDownModifier.php
│ │ │ ├── CoverModifier.php
│ │ │ ├── CropModifier.php
│ │ │ ├── DrawBezierModifier.php
│ │ │ ├── DrawEllipseModifier.php
│ │ │ ├── DrawLineModifier.php
│ │ │ ├── DrawPixelModifier.php
│ │ │ ├── DrawPolygonModifier.php
│ │ │ ├── DrawRectangleModifier.php
│ │ │ ├── FillModifier.php
│ │ │ ├── FlipModifier.php
│ │ │ ├── FlopModifier.php
│ │ │ ├── GammaModifier.php
│ │ │ ├── GreyscaleModifier.php
│ │ │ ├── InvertModifier.php
│ │ │ ├── PadModifier.php
│ │ │ ├── PixelateModifier.php
│ │ │ ├── PlaceModifier.php
│ │ │ ├── ProfileModifier.php
│ │ │ ├── ProfileRemovalModifier.php
│ │ │ ├── QuantizeColorsModifier.php
│ │ │ ├── RemoveAnimationModifier.php
│ │ │ ├── ResizeCanvasModifier.php
│ │ │ ├── ResizeCanvasRelativeModifier.php
│ │ │ ├── ResizeDownModifier.php
│ │ │ ├── ResizeModifier.php
│ │ │ ├── ResolutionModifier.php
│ │ │ ├── RotateModifier.php
│ │ │ ├── ScaleDownModifier.php
│ │ │ ├── ScaleModifier.php
│ │ │ ├── SharpenModifier.php
│ │ │ ├── SliceAnimationModifier.php
│ │ │ ├── TextModifier.php
│ │ │ └── TrimModifier.php
│ │ ├── Imagick/
│ │ │ ├── Analyzers/
│ │ │ │ ├── ColorspaceAnalyzer.php
│ │ │ │ ├── HeightAnalyzer.php
│ │ │ │ ├── PixelColorAnalyzer.php
│ │ │ │ ├── PixelColorsAnalyzer.php
│ │ │ │ ├── ProfileAnalyzer.php
│ │ │ │ ├── ResolutionAnalyzer.php
│ │ │ │ └── WidthAnalyzer.php
│ │ │ ├── ColorProcessor.php
│ │ │ ├── Core.php
│ │ │ ├── Decoders/
│ │ │ │ ├── Base64ImageDecoder.php
│ │ │ │ ├── BinaryImageDecoder.php
│ │ │ │ ├── DataUriImageDecoder.php
│ │ │ │ ├── EncodedImageObjectDecoder.php
│ │ │ │ ├── FilePathImageDecoder.php
│ │ │ │ ├── FilePointerImageDecoder.php
│ │ │ │ ├── NativeObjectDecoder.php
│ │ │ │ └── SplFileInfoImageDecoder.php
│ │ │ ├── Driver.php
│ │ │ ├── Encoders/
│ │ │ │ ├── AvifEncoder.php
│ │ │ │ ├── BmpEncoder.php
│ │ │ │ ├── GifEncoder.php
│ │ │ │ ├── HeicEncoder.php
│ │ │ │ ├── Jpeg2000Encoder.php
│ │ │ │ ├── JpegEncoder.php
│ │ │ │ ├── PngEncoder.php
│ │ │ │ ├── TiffEncoder.php
│ │ │ │ └── WebpEncoder.php
│ │ │ ├── FontProcessor.php
│ │ │ ├── Frame.php
│ │ │ └── Modifiers/
│ │ │ ├── AlignRotationModifier.php
│ │ │ ├── BlendTransparencyModifier.php
│ │ │ ├── BlurModifier.php
│ │ │ ├── BrightnessModifier.php
│ │ │ ├── ColorizeModifier.php
│ │ │ ├── ColorspaceModifier.php
│ │ │ ├── ContainModifier.php
│ │ │ ├── ContrastModifier.php
│ │ │ ├── CoverDownModifier.php
│ │ │ ├── CoverModifier.php
│ │ │ ├── CropModifier.php
│ │ │ ├── DrawBezierModifier.php
│ │ │ ├── DrawEllipseModifier.php
│ │ │ ├── DrawLineModifier.php
│ │ │ ├── DrawPixelModifier.php
│ │ │ ├── DrawPolygonModifier.php
│ │ │ ├── DrawRectangleModifier.php
│ │ │ ├── FillModifier.php
│ │ │ ├── FlipModifier.php
│ │ │ ├── FlopModifier.php
│ │ │ ├── GammaModifier.php
│ │ │ ├── GreyscaleModifier.php
│ │ │ ├── InvertModifier.php
│ │ │ ├── PadModifier.php
│ │ │ ├── PixelateModifier.php
│ │ │ ├── PlaceModifier.php
│ │ │ ├── ProfileModifier.php
│ │ │ ├── ProfileRemovalModifier.php
│ │ │ ├── QuantizeColorsModifier.php
│ │ │ ├── RemoveAnimationModifier.php
│ │ │ ├── ResizeCanvasModifier.php
│ │ │ ├── ResizeCanvasRelativeModifier.php
│ │ │ ├── ResizeDownModifier.php
│ │ │ ├── ResizeModifier.php
│ │ │ ├── ResolutionModifier.php
│ │ │ ├── RotateModifier.php
│ │ │ ├── ScaleDownModifier.php
│ │ │ ├── ScaleModifier.php
│ │ │ ├── SharpenModifier.php
│ │ │ ├── SliceAnimationModifier.php
│ │ │ ├── StripMetaModifier.php
│ │ │ ├── TextModifier.php
│ │ │ └── TrimModifier.php
│ │ ├── Specializable.php
│ │ ├── SpecializableAnalyzer.php
│ │ ├── SpecializableDecoder.php
│ │ ├── SpecializableEncoder.php
│ │ └── SpecializableModifier.php
│ ├── EncodedImage.php
│ ├── Encoders/
│ │ ├── AutoEncoder.php
│ │ ├── AvifEncoder.php
│ │ ├── BmpEncoder.php
│ │ ├── FileExtensionEncoder.php
│ │ ├── FilePathEncoder.php
│ │ ├── GifEncoder.php
│ │ ├── HeicEncoder.php
│ │ ├── Jpeg2000Encoder.php
│ │ ├── JpegEncoder.php
│ │ ├── MediaTypeEncoder.php
│ │ ├── PngEncoder.php
│ │ ├── TiffEncoder.php
│ │ └── WebpEncoder.php
│ ├── Exceptions/
│ │ ├── AnimationException.php
│ │ ├── ColorException.php
│ │ ├── DecoderException.php
│ │ ├── DriverException.php
│ │ ├── EncoderException.php
│ │ ├── FontException.php
│ │ ├── GeometryException.php
│ │ ├── InputException.php
│ │ ├── NotSupportedException.php
│ │ ├── NotWritableException.php
│ │ └── RuntimeException.php
│ ├── File.php
│ ├── FileExtension.php
│ ├── Format.php
│ ├── Geometry/
│ │ ├── Bezier.php
│ │ ├── Circle.php
│ │ ├── Ellipse.php
│ │ ├── Factories/
│ │ │ ├── BezierFactory.php
│ │ │ ├── CircleFactory.php
│ │ │ ├── Drawable.php
│ │ │ ├── EllipseFactory.php
│ │ │ ├── LineFactory.php
│ │ │ ├── PolygonFactory.php
│ │ │ └── RectangleFactory.php
│ │ ├── Line.php
│ │ ├── Pixel.php
│ │ ├── Point.php
│ │ ├── Polygon.php
│ │ ├── Rectangle.php
│ │ ├── Tools/
│ │ │ └── RectangleResizer.php
│ │ └── Traits/
│ │ ├── HasBackgroundColor.php
│ │ └── HasBorder.php
│ ├── Image.php
│ ├── ImageManager.php
│ ├── InputHandler.php
│ ├── Interfaces/
│ │ ├── AnalyzerInterface.php
│ │ ├── CollectionInterface.php
│ │ ├── ColorChannelInterface.php
│ │ ├── ColorInterface.php
│ │ ├── ColorProcessorInterface.php
│ │ ├── ColorspaceInterface.php
│ │ ├── CoreInterface.php
│ │ ├── DecoderInterface.php
│ │ ├── DrawableFactoryInterface.php
│ │ ├── DrawableInterface.php
│ │ ├── DriverInterface.php
│ │ ├── EncodedImageInterface.php
│ │ ├── EncoderInterface.php
│ │ ├── FileInterface.php
│ │ ├── FontInterface.php
│ │ ├── FontProcessorInterface.php
│ │ ├── FrameInterface.php
│ │ ├── ImageInterface.php
│ │ ├── ImageManagerInterface.php
│ │ ├── InputHandlerInterface.php
│ │ ├── ModifierInterface.php
│ │ ├── PointInterface.php
│ │ ├── ProfileInterface.php
│ │ ├── ResolutionInterface.php
│ │ ├── SizeInterface.php
│ │ ├── SpecializableInterface.php
│ │ └── SpecializedInterface.php
│ ├── MediaType.php
│ ├── ModifierStack.php
│ ├── Modifiers/
│ │ ├── AbstractDrawModifier.php
│ │ ├── AlignRotationModifier.php
│ │ ├── BlendTransparencyModifier.php
│ │ ├── BlurModifier.php
│ │ ├── BrightnessModifier.php
│ │ ├── ColorizeModifier.php
│ │ ├── ColorspaceModifier.php
│ │ ├── ContainModifier.php
│ │ ├── ContrastModifier.php
│ │ ├── CoverDownModifier.php
│ │ ├── CoverModifier.php
│ │ ├── CropModifier.php
│ │ ├── DrawBezierModifier.php
│ │ ├── DrawEllipseModifier.php
│ │ ├── DrawLineModifier.php
│ │ ├── DrawPixelModifier.php
│ │ ├── DrawPolygonModifier.php
│ │ ├── DrawRectangleModifier.php
│ │ ├── FillModifier.php
│ │ ├── FlipModifier.php
│ │ ├── FlopModifier.php
│ │ ├── GammaModifier.php
│ │ ├── GreyscaleModifier.php
│ │ ├── InvertModifier.php
│ │ ├── PadModifier.php
│ │ ├── PixelateModifier.php
│ │ ├── PlaceModifier.php
│ │ ├── ProfileModifier.php
│ │ ├── ProfileRemovalModifier.php
│ │ ├── QuantizeColorsModifier.php
│ │ ├── RemoveAnimationModifier.php
│ │ ├── ResizeCanvasModifier.php
│ │ ├── ResizeCanvasRelativeModifier.php
│ │ ├── ResizeDownModifier.php
│ │ ├── ResizeModifier.php
│ │ ├── ResolutionModifier.php
│ │ ├── RotateModifier.php
│ │ ├── ScaleDownModifier.php
│ │ ├── ScaleModifier.php
│ │ ├── SharpenModifier.php
│ │ ├── SliceAnimationModifier.php
│ │ ├── TextModifier.php
│ │ └── TrimModifier.php
│ ├── Origin.php
│ ├── Resolution.php
│ ├── Traits/
│ │ ├── CanBeDriverSpecialized.php
│ │ └── CanBuildFilePointer.php
│ └── Typography/
│ ├── Font.php
│ ├── FontFactory.php
│ ├── Line.php
│ └── TextBlock.php
└── tests/
├── BaseTestCase.php
├── Feature/
│ ├── Gd/
│ │ └── ConvertPngGif.php
│ └── Imagick/
│ ├── ConvertPngGif.php
│ └── CropResizePngTest.php
├── GdTestCase.php
├── ImagickTestCase.php
├── Traits/
│ ├── CanDetectProgressiveJpeg.php
│ └── CanInspectPngFormat.php
└── Unit/
├── CollectionTest.php
├── Colors/
│ ├── Cmyk/
│ │ ├── ChannelTest.php
│ │ ├── ColorTest.php
│ │ ├── ColorspaceTest.php
│ │ └── Decoders/
│ │ └── StringColorDecoderTest.php
│ ├── Hsl/
│ │ ├── ChannelTest.php
│ │ ├── Channels/
│ │ │ └── SaturationTest.php
│ │ ├── ColorTest.php
│ │ ├── ColorspaceTest.php
│ │ └── Decoders/
│ │ └── StringColorDecoderTest.php
│ ├── Hsv/
│ │ ├── ChannelTest.php
│ │ ├── Channels/
│ │ │ ├── SaturationTest.php
│ │ │ └── ValueTest.php
│ │ ├── ColorTest.php
│ │ ├── ColorspaceTest.php
│ │ └── Decoders/
│ │ └── StringColorDecoderTest.php
│ ├── ProfileTest.php
│ └── Rgb/
│ ├── ChannelTest.php
│ ├── Channels/
│ │ └── AlphaTest.php
│ ├── ColorTest.php
│ ├── ColorspaceTest.php
│ └── Decoders/
│ ├── HexColorDecoderTest.php
│ ├── HtmlColornameDecoderTest.php
│ └── StringColorDecoderTest.php
├── ConfigTest.php
├── Drivers/
│ ├── AbstractDecoderTest.php
│ ├── AbstractEncoderTest.php
│ ├── AbstractFontProcessorTest.php
│ ├── Gd/
│ │ ├── Analyzers/
│ │ │ ├── ColorspaceAnalyzerTest.php
│ │ │ ├── HeightAnalyzerTest.php
│ │ │ ├── PixelColorAnalyzerTest.php
│ │ │ ├── PixelColorsAnalyzerTest.php
│ │ │ ├── ResolutionAnalyzerTest.php
│ │ │ └── WidthAnalyzerTest.php
│ │ ├── ClonerTest.php
│ │ ├── ColorProcessorTest.php
│ │ ├── CoreTest.php
│ │ ├── Decoders/
│ │ │ ├── AbstractDecoderTest.php
│ │ │ ├── Base64ImageDecoderTest.php
│ │ │ ├── BinaryImageDecoderTest.php
│ │ │ ├── DataUriImageDecoderTest.php
│ │ │ ├── EncodedImageObjectDecoderTest.php
│ │ │ ├── FilePathImageDecoderTest.php
│ │ │ ├── FilePointerImageDecoderTest.php
│ │ │ ├── ImageObjectDecoderTest.php
│ │ │ ├── NativeObjectDecoderTest.php
│ │ │ └── SplFileInfoImageDecoderTest.php
│ │ ├── DriverTest.php
│ │ ├── Encoders/
│ │ │ ├── AvifEncoderTest.php
│ │ │ ├── BmpEncoderTest.php
│ │ │ ├── GifEncoderTest.php
│ │ │ ├── JpegEncoderTest.php
│ │ │ ├── PngEncoderTest.php
│ │ │ └── WebpEncoderTest.php
│ │ ├── FontProcessorTest.php
│ │ ├── FrameTest.php
│ │ ├── ImageTest.php
│ │ └── Modifiers/
│ │ ├── BlurModifierTest.php
│ │ ├── BrightnessModifierTest.php
│ │ ├── ColorizeModifierTest.php
│ │ ├── ContainModifierTest.php
│ │ ├── ContrastModifierTest.php
│ │ ├── CoverDownModifierTest.php
│ │ ├── CoverModifierTest.php
│ │ ├── CropModifierTest.php
│ │ ├── DrawBezierModifierTest.php
│ │ ├── DrawEllipseModifierTest.php
│ │ ├── DrawLineModifierTest.php
│ │ ├── DrawPixelModifierTest.php
│ │ ├── DrawPolygonModifierTest.php
│ │ ├── DrawRectangleModifierTest.php
│ │ ├── FillModifierTest.php
│ │ ├── FlipFlopModifierTest.php
│ │ ├── GammaModifierTest.php
│ │ ├── GreyscaleModifierTest.php
│ │ ├── InvertModifierTest.php
│ │ ├── PadModifierTest.php
│ │ ├── PixelateModifierTest.php
│ │ ├── PlaceModifierTest.php
│ │ ├── QuantizeColorsModifierTest.php
│ │ ├── RemoveAnimationModifierTest.php
│ │ ├── ResizeCanvasModifierTest.php
│ │ ├── ResizeCanvasRelativeModifierTest.php
│ │ ├── ResizeModifierTest.php
│ │ ├── ResolutionModifierTest.php
│ │ ├── RotateModifierTest.php
│ │ ├── SharpenModifierTest.php
│ │ ├── TextModifierTest.php
│ │ └── TrimModifierTest.php
│ ├── Imagick/
│ │ ├── Analyzers/
│ │ │ ├── ColorspaceAnalyzerTest.php
│ │ │ ├── HeightAnalyzerTest.php
│ │ │ ├── PixelColorAnalyzerTest.php
│ │ │ ├── PixelColorsAnalyzerTest.php
│ │ │ ├── ProfileAnalyzerTest.php
│ │ │ ├── ResolutionAnalyzerTest.php
│ │ │ └── WidthAnalyzerTest.php
│ │ ├── ColorProcessorTest.php
│ │ ├── CoreTest.php
│ │ ├── Decoders/
│ │ │ ├── Base64ImageDecoderTest.php
│ │ │ ├── BinaryImageDecoderTest.php
│ │ │ ├── DataUriImageDecoderTest.php
│ │ │ ├── EncodedImageObjectDecoderTest.php
│ │ │ ├── FilePathImageDecoderTest.php
│ │ │ ├── FilePointerImageDecoderTest.php
│ │ │ ├── ImageObjectDecoderTest.php
│ │ │ ├── NativeObjectDecoderTest.php
│ │ │ └── SplFileInfoImageDecoderTest.php
│ │ ├── DriverTest.php
│ │ ├── Encoders/
│ │ │ ├── AvifEncoderTest.php
│ │ │ ├── BmpEncoderTest.php
│ │ │ ├── GifEncoderTest.php
│ │ │ ├── HeicEncoderTest.php
│ │ │ ├── Jpeg2000EncoderTest.php
│ │ │ ├── JpegEncoderTest.php
│ │ │ ├── PngEncoderTest.php
│ │ │ ├── TiffEncoderTest.php
│ │ │ └── WebpEncoderTest.php
│ │ ├── FontProcessorTest.php
│ │ ├── FrameTest.php
│ │ ├── ImageTest.php
│ │ └── Modifiers/
│ │ ├── BlurModifierTest.php
│ │ ├── BrightnessModifierTest.php
│ │ ├── ColorizeModifierTest.php
│ │ ├── ContainModifierTest.php
│ │ ├── ContrastModifierTest.php
│ │ ├── CoverDownModifierTest.php
│ │ ├── CoverModifierTest.php
│ │ ├── CropModifierTest.php
│ │ ├── DrawBezierModifierTest.php
│ │ ├── DrawEllipseModifierTest.php
│ │ ├── DrawLineModifierTest.php
│ │ ├── DrawPixelModifierTest.php
│ │ ├── DrawPolygonModifierTest.php
│ │ ├── DrawRectangleModifierTest.php
│ │ ├── FillModifierTest.php
│ │ ├── FlipFlopModifierTest.php
│ │ ├── GammaModifierTest.php
│ │ ├── GreyscaleModifierTest.php
│ │ ├── InvertModifierTest.php
│ │ ├── PadModifierTest.php
│ │ ├── PixelateModifierTest.php
│ │ ├── PlaceModifierTest.php
│ │ ├── QuantizeColorsModifierTest.php
│ │ ├── RemoveAnimationModifierTest.php
│ │ ├── ResizeCanvasModifierTest.php
│ │ ├── ResizeCanvasRelativeModifierTest.php
│ │ ├── ResizeModifierTest.php
│ │ ├── ResolutionModifierTest.php
│ │ ├── RotateModifierTest.php
│ │ ├── SharpenModifierTest.php
│ │ ├── StripMetaModifierTest.php
│ │ ├── TextModifierTest.php
│ │ └── TrimModifierTest.php
│ ├── SpecializableAnalyzerTest.php
│ ├── SpecializableDecoderTest.php
│ └── SpecializableModifierTest.php
├── EncodedImageTest.php
├── Encoders/
│ ├── FileExtensionEncoderTest.php
│ └── MediaTypeEncoderTest.php
├── FileExtensionTest.php
├── FileTest.php
├── FormatTest.php
├── Geometry/
│ ├── BezierTest.php
│ ├── CircleTest.php
│ ├── EllipseTest.php
│ ├── Factories/
│ │ ├── BezierFactoryTest.php
│ │ ├── CircleFactoryTest.php
│ │ ├── DrawableTest.php
│ │ ├── EllipseFactoryTest.php
│ │ ├── LineFactoryTest.php
│ │ ├── PolygonFactoryTest.php
│ │ └── RectangleFactoryTest.php
│ ├── LineTest.php
│ ├── PixelTest.php
│ ├── PointTest.php
│ ├── PolygonTest.php
│ ├── RectangleResizerTest.php
│ ├── RectangleTest.php
│ └── Traits/
│ ├── HasBackgroundColorTest.php
│ └── HasBorderTest.php
├── ImageManagerTestGd.php
├── ImageManagerTestImagick.php
├── InputHandlerTest.php
├── MediaTypeTest.php
├── ModifierStackTest.php
├── Modifiers/
│ ├── ColorspaceModifierTest.php
│ ├── PadModifierTest.php
│ ├── RemoveAnimationModifierTest.php
│ └── TextModifierTest.php
├── OriginTest.php
├── ResolutionTest.php
└── Typography/
├── FontFactoryTest.php
├── FontTest.php
├── LineTest.php
└── TextBlockTest.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# editorconfig.org
root = true
[*.php]
indent_size = 4
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
================================================
FILE: .gitattributes
================================================
* text=auto
/.editorconfig export-ignore
/.github export-ignore
/.well-known export-ignore
/CONTRIBUTING.md export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpcs.xml.dist export-ignore
/phpunit.dist.xml export-ignore
/phpstan.dist.neon export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
================================================
FILE: .github/FUNDING.yml
================================================
github: [Intervention]
ko_fi: interventionphp
custom: https://paypal.me/interventionio
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
## Describe the bug
A clear and concise description of what the bug is.
## Code Example
Code example to reproduce the behavior.
## Expected behavior
A clear and concise description of what you expected to happen.
## Images
If applicable, add problematic images or screenshots to help explain your problem.
## Environment (please complete the following information):
- PHP Version:
- OS:
- Intervention Image Version:
- GD, Imagick or libvips:
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
## Describe the feature you'd like
A clear and concise description of what you want to happen.
## Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
================================================
FILE: .github/workflows/run-tests.yml
================================================
name: Tests
on: [ push, pull_request ]
jobs:
run:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
imagemagick: [ '6.9.13-25', '7.1.1-47' ]
name: PHP ${{ matrix.php }} - ImageMagick ${{ matrix.imagemagick }}
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, gd
coverage: none
- name: Prepare environment for Imagemagick
run: |
sudo apt remove -y imagemagick imagemagick-6-common libmagic-dev
sudo apt update --allow-releaseinfo-change
sudo apt update
sudo apt install -y libjpeg-dev libgif-dev libtiff-dev libpng-dev libwebp-dev libavif-dev libheif-dev libraqm-dev libmagickwand-dev
- name: Cache ImageMagick
uses: actions/cache@v4
id: cache-imagemagick
with:
path: /home/runner/im/imagemagick-${{ matrix.imagemagick }}
key: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }}-
- name: Check ImageMagick cache exists
uses: andstor/file-existence-action@v3
id: cache-imagemagick-exists
with:
files: /home/runner/im/imagemagick-${{ matrix.imagemagick }}
- name: Install ImageMagick
if: ( steps.cache-imagemagick.outputs.cache-hit != 'true' || steps.cache-imagemagick-exists.outputs.files_exists != 'true' )
run: |
curl -o /tmp/ImageMagick.tar.xz -sL https://imagemagick.org/archive/releases/ImageMagick-${{ matrix.imagemagick }}.tar.xz
(
cd /tmp || exit 1
tar xf ImageMagick.tar.xz
cd ImageMagick-${{ matrix.imagemagick }}
sudo ./configure --prefix=/home/runner/im/imagemagick-${{ matrix.imagemagick }}
sudo make -j$(nproc)
sudo make install
)
- name: Install Imagick PHP extension
run: |
git clone --depth=1 --single-branch --branch master https://github.com/Imagick/imagick /tmp/imagick
(
cd /tmp/imagick || exit 1
phpize
sudo ./configure --with-imagick=/home/runner/im/imagemagick-${{ matrix.imagemagick }}
sudo make -j$(nproc)
sudo make install
)
sudo bash -c 'echo "extension=imagick.so" >> /etc/php/${{ matrix.php }}/cli/php.ini'
php --ri imagick;
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction
- name: GD Version
run: php -r 'var_dump(gd_info());'
- name: Imagick Version
run: php -r 'var_dump(Imagick::getVersion());'
- name: Supported Imagick Formats
run: php -r 'var_dump(Imagick::queryFormats());'
- name: Execute tests
run: vendor/bin/phpunit --no-coverage
- name: Run analyzer
run: vendor/bin/phpstan
- name: Validate coding standards
run: vendor/bin/phpcs
================================================
FILE: .gitignore
================================================
build/
vendor/
/.phpunit.cache
composer.lock
phpunit.xml
phpcs.xml
phpstan.neon
================================================
FILE: .well-known/funding-manifest-urls
================================================
https://intervention.io/funding.json
https://image.intervention.io/funding.json
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Intervention Image
Thank you for your interest in contributing to the project.
You can read the full contribution guide on https://intervention.io/contributing/.
================================================
FILE: Dockerfile
================================================
FROM php:8.1-cli
# install dependencies
RUN apt update \
&& apt install -y \
libmagickwand-dev \
libwebp-dev \
libpng-dev \
libavif-dev \
git \
zip \
&& pecl install imagick \
&& pecl install xdebug \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-avif \
&& docker-php-ext-enable \
imagick \
xdebug \
&& docker-php-ext-install \
gd \
exif \
&& apt-get clean
# install composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
# install composer dependencies
COPY composer.json composer.lock ./
RUN composer install
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2013-present Oliver Vogel
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: composer.json
================================================
{
"name": "intervention/image",
"description": "PHP Image Processing",
"homepage": "https://image.intervention.io",
"keywords": [
"image",
"gd",
"imagick",
"watermark",
"thumbnail",
"resize"
],
"license": "MIT",
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@intervention.io",
"homepage": "https://intervention.io"
}
],
"require": {
"php": "^8.1",
"ext-mbstring": "*",
"intervention/gif": "^4.2"
},
"require-dev": {
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^2.1",
"squizlabs/php_codesniffer": "^4",
"slevomat/coding-standard": "~8.0"
},
"suggest": {
"ext-exif": "Recommended to be able to read EXIF data properly."
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Intervention\\Image\\Tests\\": "tests"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
================================================
FILE: docker-compose.yml
================================================
services:
tests:
build: ./
working_dir: /project
entrypoint: ["./vendor/bin/phpunit"]
volumes:
- ./:/project
coverage:
build: ./
working_dir: /project
entrypoint: ["./vendor/bin/phpunit", "--coverage-text"]
volumes:
- ./:/project
environment:
- XDEBUG_MODE=coverage
analysis:
build: ./
working_dir: /project
entrypoint: ["./vendor/bin/phpstan", "analyze", "--memory-limit=512M"]
volumes:
- ./:/project
standards:
build: ./
working_dir: /project
entrypoint: ["./vendor/bin/phpcs"]
volumes:
- ./:/project
================================================
FILE: phpcs.xml.dist
================================================
<?xml version="1.0"?>
<ruleset name="Intervention">
<file>src/</file>
<file>tests/</file>
<arg name="colors"/>
<arg value="p"/>
<rule ref="PSR12"/>
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="0" />
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"/>
<rule ref="SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed"/>
<rule ref="SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement"/>
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing"/>
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing"/>
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing"/>
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
<rule ref="SlevomatCodingStandard.Classes.ParentCallSpacing"/>
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"/>
<rule ref="SlevomatCodingStandard.Classes.RequireSelfReference"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
<properties>
<property name="methodGroups" type="array">
<element key="phpunit" value="setUp"/>
</property>
<property name="groups" type="array">
<element value="uses"/>
<element value="enum cases"/>
<element value="public constants"/>
<element value="constants"/>
<element value="public static properties, protected static properties, private static properties"/>
<element value="public properties, protected properties, private properties"/>
<element value="abstract methods"/>
<element value="constructor"/>
<element value="phpunit"/>
<element value="static constructors"/>
<element value="methods"/>
<element value="magic methods"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array">
<element key="src" value="Intervention\Image"/>
<element key="tests" value="Intervention\Image\Tests"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/>
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<rule ref="SlevomatCodingStandard.Strings.DisallowVariableParsing"/>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="spacesCountAroundEqualsSign" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat">
<properties>
<property name="withSpacesAroundOperators" value="no" />
<property name="nullPosition" value="first" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces"/>
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing">
<properties>
<property name="spacesCountAfterOperator" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBeforeFirstContent" value="0"/>
<property name="linesCountAfterLastContent" value="0"/>
<property name="linesCountBetweenDescriptionAndAnnotations" value="1"/>
<property name="linesCountBetweenAnnotationsGroups" value="1"/>
<property name="annotationsGroups" type="array">
<element value="
@ORM\,
@ODM\,
"/>
<element value="
@link,
@internal,
@deprecated,
@see,
@uses,
"/>
<element value="
@param,
@throws,
@return,
"/>
</property>
</properties>
</rule>
</ruleset>
================================================
FILE: phpstan.dist.neon
================================================
parameters:
level: 6
paths:
- src
reportUnmatchedIgnoredErrors: false
ignoreErrors:
-
identifier: unset.possiblyHookedProperty
exceptions:
check:
missingCheckedExceptionInThrows: true
uncheckedExceptionClasses:
- ImagickException
- ImagickDrawException
- ImagickPixelException
- Error
================================================
FILE: phpunit.dist.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticProperties="false"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
colors="true"
displayDetailsOnTestsThatTriggerNotices="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit Tests">
<directory suffix=".php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature Tests">
<directory suffix=".php">./tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
================================================
FILE: readme.md
================================================
# Intervention Image
## PHP Image Processing
[](https://packagist.org/packages/intervention/image)
[](https://github.com/Intervention/image/actions)
[](https://packagist.org/packages/intervention/image/stats)
[](https://ko-fi.com/interventionphp)
Intervention Image is a **PHP image processing library** that provides a simple
and expressive way to create, edit, and compose images. It comes with a universal
interface for the two most popular PHP image manipulation extensions. You can
choose between the GD library or Imagick as the base layer for all operations.
- Simple interface for common image editing tasks
- Interchangeable driver architecture
- Support for animated images
- Framework-agnostic
- PSR-12 compliant
## Installation
You can easily install this library using [Composer](https://getcomposer.org).
Simply request the package with the following command:
```bash
composer require intervention/image
```
## Getting Started
Learn the [basics](https://image.intervention.io/v3/basics/instantiation/) on
how to use Intervention Image and more with the [official
documentation](https://image.intervention.io/v3/).
## Code Examples
```php
use Intervention\Image\ImageManager;
// create image manager with desired driver
$manager = new ImageManager(
new Intervention\Image\Drivers\Gd\Driver()
);
// open an image file
$image = $manager->read('images/example.gif');
// resize image instance
$image->resize(height: 300);
// insert a watermark
$image->place('images/watermark.png');
// encode edited image
$encoded = $image->toJpg();
// save encoded image
$encoded->save('images/example.jpg');
```
## Requirements
Before you begin with the installation make sure that your server environment
supports the following requirements.
- PHP >= 8.1
- Mbstring PHP Extension
- Image Processing PHP Extension
## Supported Image Libraries
Depending on your environment Intervention Image lets you choose between
different image processing extensions.
- GD Library
- Imagick PHP extension
- [libvips](https://github.com/Intervention/image-driver-vips)
## Security
If you discover any security related issues, please email oliver@intervention.io directly.
## Authors
This library is developed and maintained by [Oliver Vogel](https://intervention.io)
Thanks to the community of [contributors](https://github.com/Intervention/image/graphs/contributors) who have helped to improve this project.
## License
Intervention Image is licensed under the [MIT License](LICENSE).
================================================
FILE: src/Analyzers/ColorspaceAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class ColorspaceAnalyzer extends SpecializableAnalyzer
{
//
}
================================================
FILE: src/Analyzers/HeightAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class HeightAnalyzer extends SpecializableAnalyzer
{
//
}
================================================
FILE: src/Analyzers/PixelColorAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class PixelColorAnalyzer extends SpecializableAnalyzer
{
public function __construct(
public int $x,
public int $y,
public int $frame_key = 0
) {
//
}
}
================================================
FILE: src/Analyzers/PixelColorsAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class PixelColorsAnalyzer extends SpecializableAnalyzer
{
public function __construct(
public int $x,
public int $y
) {
//
}
}
================================================
FILE: src/Analyzers/ProfileAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class ProfileAnalyzer extends SpecializableAnalyzer
{
//
}
================================================
FILE: src/Analyzers/ResolutionAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class ResolutionAnalyzer extends SpecializableAnalyzer
{
//
}
================================================
FILE: src/Analyzers/WidthAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Analyzers;
use Intervention\Image\Drivers\SpecializableAnalyzer;
class WidthAnalyzer extends SpecializableAnalyzer
{
//
}
================================================
FILE: src/Collection.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image;
use Intervention\Image\Interfaces\CollectionInterface;
use ArrayIterator;
use Countable;
use Traversable;
use IteratorAggregate;
/**
* @implements IteratorAggregate<int|string, mixed>
*/
class Collection implements CollectionInterface, IteratorAggregate, Countable
{
/**
* Create new collection object
*
* @param array<int|string, mixed> $items
* @return void
*/
public function __construct(protected array $items = [])
{
//
}
/**
* Static constructor
*
* @param array<int|string, mixed> $items
* @return self<int|string, mixed>
*/
public static function create(array $items = []): self
{
return new self($items);
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::has()
*/
public function has(int|string $key): bool
{
return array_key_exists($key, $this->items);
}
/**
* Returns Iterator
*
* @return Traversable<int|string, mixed>
*/
public function getIterator(): Traversable
{
return new ArrayIterator($this->items);
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::toArray()
*/
public function toArray(): array
{
return $this->items;
}
/**
* Count items in collection
*/
public function count(): int
{
return count($this->items);
}
/**
* Append new item to collection
*
* @return CollectionInterface<int|string, mixed>
*/
public function push(mixed $item): CollectionInterface
{
$this->items[] = $item;
return $this;
}
/**
* Return first item in collection
*/
public function first(): mixed
{
if ($item = reset($this->items)) {
return $item;
}
return null;
}
/**
* Returns last item in collection
*/
public function last(): mixed
{
if ($item = end($this->items)) {
return $item;
}
return null;
}
/**
* Return item at given position starting at 0
*/
public function getAtPosition(int $key = 0, mixed $default = null): mixed
{
if ($this->count() == 0) {
return $default;
}
$positions = array_values($this->items);
if (!array_key_exists($key, $positions)) {
return $default;
}
return $positions[$key];
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::get()
*/
public function get(int|string $query, mixed $default = null): mixed
{
if ($this->count() == 0) {
return $default;
}
if (is_int($query) && array_key_exists($query, $this->items)) {
return $this->items[$query];
}
if (is_string($query) && !str_contains($query, '.')) {
return array_key_exists($query, $this->items) ? $this->items[$query] : $default;
}
$query = explode('.', (string) $query);
$result = $default;
$items = $this->items;
foreach ($query as $key) {
if (!is_array($items) || !array_key_exists($key, $items)) {
$result = $default;
break;
}
$result = $items[$key];
$items = $result;
}
return $result;
}
/**
* Map each item of collection by given callback
*/
public function map(callable $callback): self
{
return new self(
array_map(
fn(mixed $item) => $callback($item),
$this->items,
)
);
}
/**
* Run callback on each item of the collection an remove it if it does not return true
*/
public function filter(callable $callback): self
{
return new self(
array_filter(
$this->items,
fn(mixed $item) => $callback($item),
)
);
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::empty()
*/
public function empty(): CollectionInterface
{
$this->items = [];
return $this;
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::slice()
*/
public function slice(int $offset, ?int $length = null): CollectionInterface
{
$this->items = array_slice($this->items, $offset, $length);
return $this;
}
}
================================================
FILE: src/Colors/AbstractColor.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
use ReflectionClass;
use Stringable;
abstract class AbstractColor implements ColorInterface, Stringable
{
/**
* Color channels
*
* @var array<ColorChannelInterface>
*/
protected array $channels;
/**
* {@inheritdoc}
*
* @see ColorInterface::channels()
*/
public function channels(): array
{
return $this->channels;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::channel()
*/
public function channel(string $classname): ColorChannelInterface
{
$channels = array_filter(
$this->channels(),
fn(ColorChannelInterface $channel): bool => $channel::class === $classname,
);
if (count($channels) == 0) {
throw new ColorException('Color channel ' . $classname . ' could not be found.');
}
return reset($channels);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::normalize()
*/
public function normalize(): array
{
return array_map(
fn(ColorChannelInterface $channel): float => $channel->normalize(),
$this->channels(),
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toArray()
*/
public function toArray(): array
{
return array_map(
fn(ColorChannelInterface $channel): int => $channel->value(),
$this->channels()
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::convertTo()
*/
public function convertTo(string|ColorspaceInterface $colorspace): ColorInterface
{
$colorspace = match (true) {
is_object($colorspace) => $colorspace,
default => new $colorspace(),
};
return $colorspace->importColor($this);
}
/**
* Show debug info for the current color
*
* @return array<string, int>
*/
public function __debugInfo(): array
{
return array_reduce($this->channels(), function (array $result, ColorChannelInterface $item) {
$key = strtolower((new ReflectionClass($item))->getShortName());
$result[$key] = $item->value();
return $result;
}, []);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::__toString()
*/
public function __toString(): string
{
return $this->toString();
}
}
================================================
FILE: src/Colors/AbstractColorChannel.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Stringable;
abstract class AbstractColorChannel implements ColorChannelInterface, Stringable
{
protected int $value;
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::__construct()
*/
public function __construct(?int $value = null, ?float $normalized = null)
{
$this->value = $this->validate(
match (true) {
is_null($value) && is_numeric($normalized) => intval(round($normalized * $this->max())),
is_numeric($value) && is_null($normalized) => $value,
default => throw new ColorException('Color channels must either have a value or a normalized value')
}
);
}
/**
* Alias of value()
*/
public function toInt(): int
{
return $this->value;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::value()
*/
public function value(): int
{
return $this->value;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::normalize()
*/
public function normalize(int $precision = 32): float
{
return round(($this->value() - $this->min()) / ($this->max() - $this->min()), $precision);
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::validate()
*/
public function validate(mixed $value): mixed
{
if ($value < $this->min() || $value > $this->max()) {
throw new ColorException('Color channel value must be in range ' . $this->min() . ' to ' . $this->max());
}
return $value;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::toString()
*/
public function toString(): string
{
return (string) $this->value();
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::__toString()
*/
public function __toString(): string
{
return $this->toString();
}
}
================================================
FILE: src/Colors/Cmyk/Channels/Cyan.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Cyan extends AbstractColorChannel
{
public function min(): int
{
return 0;
}
public function max(): int
{
return 100;
}
}
================================================
FILE: src/Colors/Cmyk/Channels/Key.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk\Channels;
class Key extends Cyan
{
//
}
================================================
FILE: src/Colors/Cmyk/Channels/Magenta.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk\Channels;
class Magenta extends Cyan
{
//
}
================================================
FILE: src/Colors/Cmyk/Channels/Yellow.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk\Channels;
class Yellow extends Cyan
{
//
}
================================================
FILE: src/Colors/Cmyk/Color.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk;
use Intervention\Image\Colors\AbstractColor;
use Intervention\Image\Colors\Cmyk\Channels\Cyan;
use Intervention\Image\Colors\Cmyk\Channels\Magenta;
use Intervention\Image\Colors\Cmyk\Channels\Yellow;
use Intervention\Image\Colors\Cmyk\Channels\Key;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\InputHandler;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Color extends AbstractColor
{
/**
* Create new instance
*
* @return void
*/
public function __construct(int $c, int $m, int $y, int $k)
{
/** @throws void */
$this->channels = [
new Cyan($c),
new Magenta($m),
new Yellow($y),
new Key($k),
];
}
/**
* {@inheritdoc}
*
* @see ColorInterface::create()
*/
public static function create(mixed $input): ColorInterface
{
return InputHandler::withDecoders([
Decoders\StringColorDecoder::class,
])->handle($input);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::colorspace()
*/
public function colorspace(): ColorspaceInterface
{
return new Colorspace();
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toHex()
*/
public function toHex(string $prefix = ''): string
{
return $this->convertTo(RgbColorspace::class)->toHex($prefix);
}
/**
* Return the CMYK cyan channel
*/
public function cyan(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Cyan::class);
}
/**
* Return the CMYK magenta channel
*/
public function magenta(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Magenta::class);
}
/**
* Return the CMYK yellow channel
*/
public function yellow(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Yellow::class);
}
/**
* Return the CMYK key channel
*/
public function key(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Key::class);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toString()
*/
public function toString(): string
{
return sprintf(
'cmyk(%d%%, %d%%, %d%%, %d%%)',
$this->cyan()->value(),
$this->magenta()->value(),
$this->yellow()->value(),
$this->key()->value()
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isGreyscale()
*/
public function isGreyscale(): bool
{
return 0 === array_sum([
$this->cyan()->value(),
$this->magenta()->value(),
$this->yellow()->value(),
]);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isTransparent()
*/
public function isTransparent(): bool
{
return false;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isClear()
*/
public function isClear(): bool
{
return false;
}
}
================================================
FILE: src/Colors/Cmyk/Colorspace.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk;
use Intervention\Image\Colors\Rgb\Color as RgbColor;
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
use Intervention\Image\Colors\Hsv\Color as HsvColor;
use Intervention\Image\Colors\Hsl\Color as HslColor;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Colorspace implements ColorspaceInterface
{
/**
* Channel class names of colorspace
*
* @var array<string>
*/
public static array $channels = [
Channels\Cyan::class,
Channels\Magenta::class,
Channels\Yellow::class,
Channels\Key::class
];
/**
* {@inheritdoc}
*
* @see ColorspaceInterface::createColor()
*/
public function colorFromNormalized(array $normalized): ColorInterface
{
return new Color(...array_map(
fn(string $classname, float $value_normalized) => (new $classname(normalized: $value_normalized))->value(),
self::$channels,
$normalized,
));
}
/**
* @throws ColorException
*/
public function importColor(ColorInterface $color): ColorInterface
{
return match ($color::class) {
RgbColor::class => $this->importRgbColor($color),
HsvColor::class => $this->importRgbColor($color->convertTo(RgbColorspace::class)),
HslColor::class => $this->importRgbColor($color->convertTo(RgbColorspace::class)),
default => $color,
};
}
/**
* @throws ColorException
*/
protected function importRgbColor(ColorInterface $color): CmykColor
{
if (!($color instanceof RgbColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
$c = (255 - $color->red()->value()) / 255.0 * 100;
$m = (255 - $color->green()->value()) / 255.0 * 100;
$y = (255 - $color->blue()->value()) / 255.0 * 100;
$k = intval(round(min([$c, $m, $y])));
$c = intval(round($c - $k));
$m = intval(round($m - $k));
$y = intval(round($y - $k));
return new CmykColor($c, $m, $y, $k);
}
}
================================================
FILE: src/Colors/Cmyk/Decoders/StringColorDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Cmyk\Decoders;
use Intervention\Image\Colors\Cmyk\Color;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class StringColorDecoder extends AbstractDecoder implements DecoderInterface
{
/**
* Decode CMYK color strings
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
$pattern = '/^cmyk\((?P<c>[0-9\.]+%?), ?(?P<m>[0-9\.]+%?), ?(?P<y>[0-9\.]+%?), ?(?P<k>[0-9\.]+%?)\)$/i';
if (preg_match($pattern, $input, $matches) != 1) {
throw new DecoderException('Unable to decode input');
}
$values = array_map(function (string $value): int {
return intval(round(floatval(trim(str_replace('%', '', $value)))));
}, [$matches['c'], $matches['m'], $matches['y'], $matches['k']]);
return new Color(...$values);
}
}
================================================
FILE: src/Colors/Hsl/Channels/Hue.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsl\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Hue extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 360;
}
}
================================================
FILE: src/Colors/Hsl/Channels/Luminance.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsl\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Luminance extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 100;
}
}
================================================
FILE: src/Colors/Hsl/Channels/Saturation.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsl\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Saturation extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 100;
}
}
================================================
FILE: src/Colors/Hsl/Color.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsl;
use Intervention\Image\Colors\AbstractColor;
use Intervention\Image\Colors\Hsl\Channels\Hue;
use Intervention\Image\Colors\Hsl\Channels\Luminance;
use Intervention\Image\Colors\Hsl\Channels\Saturation;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\InputHandler;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Color extends AbstractColor
{
/**
* Create new color object
*
* @return void
*/
public function __construct(int $h, int $s, int $l)
{
/** @throws void */
$this->channels = [
new Hue($h),
new Saturation($s),
new Luminance($l),
];
}
/**
* {@inheritdoc}
*
* @see ColorInterface::colorspace()
*/
public function colorspace(): ColorspaceInterface
{
return new Colorspace();
}
/**
* {@inheritdoc}
*
* @see ColorInterface::create()
*/
public static function create(mixed $input): ColorInterface
{
return InputHandler::withDecoders([
Decoders\StringColorDecoder::class,
])->handle($input);
}
/**
* Return the Hue channel
*/
public function hue(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Hue::class);
}
/**
* Return the Saturation channel
*/
public function saturation(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Saturation::class);
}
/**
* Return the Luminance channel
*/
public function luminance(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Luminance::class);
}
public function toHex(string $prefix = ''): string
{
return $this->convertTo(RgbColorspace::class)->toHex($prefix);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toString()
*/
public function toString(): string
{
return sprintf(
'hsl(%d, %d%%, %d%%)',
$this->hue()->value(),
$this->saturation()->value(),
$this->luminance()->value()
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isGreyscale()
*/
public function isGreyscale(): bool
{
return $this->saturation()->value() == 0;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isTransparent()
*/
public function isTransparent(): bool
{
return false;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isClear()
*/
public function isClear(): bool
{
return false;
}
}
================================================
FILE: src/Colors/Hsl/Colorspace.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsl;
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
use Intervention\Image\Colors\Rgb\Color as RgbColor;
use Intervention\Image\Colors\Hsv\Color as HsvColor;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Colorspace implements ColorspaceInterface
{
/**
* Channel class names of colorspace
*
* @var array<string>
*/
public static array $channels = [
Channels\Hue::class,
Channels\Saturation::class,
Channels\Luminance::class
];
/**
* {@inheritdoc}
*
* @see ColorspaceInterface::colorFromNormalized()
*/
public function colorFromNormalized(array $normalized): ColorInterface
{
return new Color(...array_map(
fn(string $classname, float $value_normalized) => (new $classname(normalized: $value_normalized))->value(),
self::$channels,
$normalized
));
}
/**
* @throws ColorException
*/
public function importColor(ColorInterface $color): ColorInterface
{
return match ($color::class) {
CmykColor::class => $this->importRgbColor($color->convertTo(RgbColorspace::class)),
RgbColor::class => $this->importRgbColor($color),
HsvColor::class => $this->importHsvColor($color),
default => $color,
};
}
/**
* @throws ColorException
*/
protected function importRgbColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof RgbColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
// normalized values of rgb channels
$values = array_map(
fn(ColorChannelInterface $channel): float => $channel->normalize(),
$color->channels(),
);
// take only RGB
$values = array_slice($values, 0, 3);
// calculate Luminance
$min = min(...$values);
$max = max(...$values);
$luminance = ($max + $min) / 2;
$delta = $max - $min;
// calculate saturation
$saturation = match (true) {
$delta == 0 => 0,
default => $delta / (1 - abs(2 * $luminance - 1)),
};
// calculate hue
[$r, $g, $b] = $values;
$hue = match (true) {
($delta == 0) => 0,
($max == $r) => 60 * fmod((($g - $b) / $delta), 6),
($max == $g) => 60 * ((($b - $r) / $delta) + 2),
($max == $b) => 60 * ((($r - $g) / $delta) + 4),
default => 0,
};
$hue = ($hue + 360) % 360; // normalize hue
return new Color(
intval(round($hue)),
intval(round($saturation * 100)),
intval(round($luminance * 100)),
);
}
/**
* @throws ColorException
*/
protected function importHsvColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof HsvColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
// normalized values of hsv channels
[$h, $s, $v] = array_map(
fn(ColorChannelInterface $channel): float => $channel->normalize(),
$color->channels(),
);
// calculate Luminance
$luminance = (2 - $s) * $v / 2;
// calculate Saturation
$saturation = match (true) {
$luminance == 0 => $s,
$luminance == 1 => 0,
$luminance < .5 => $s * $v / ($luminance * 2),
default => $s * $v / (2 - $luminance * 2),
};
return new Color(
intval(round($h * 360)),
intval(round($saturation * 100)),
intval(round($luminance * 100)),
);
}
}
================================================
FILE: src/Colors/Hsl/Decoders/StringColorDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsl\Decoders;
use Intervention\Image\Colors\Hsl\Color;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class StringColorDecoder extends AbstractDecoder implements DecoderInterface
{
/**
* Decode hsl color strings
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
$pattern = '/^hsl\((?P<h>[0-9\.]+), ?(?P<s>[0-9\.]+%?), ?(?P<l>[0-9\.]+%?)\)$/i';
if (preg_match($pattern, $input, $matches) != 1) {
throw new DecoderException('Unable to decode input');
}
$values = array_map(function (string $value): int {
return match (strpos($value, '%')) {
false => intval(trim($value)),
default => intval(trim(str_replace('%', '', $value))),
};
}, [$matches['h'], $matches['s'], $matches['l']]);
return new Color(...$values);
}
}
================================================
FILE: src/Colors/Hsv/Channels/Hue.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsv\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Hue extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 360;
}
}
================================================
FILE: src/Colors/Hsv/Channels/Saturation.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsv\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Saturation extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 100;
}
}
================================================
FILE: src/Colors/Hsv/Channels/Value.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsv\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Value extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 100;
}
}
================================================
FILE: src/Colors/Hsv/Color.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsv;
use Intervention\Image\Colors\AbstractColor;
use Intervention\Image\Colors\Hsv\Channels\Hue;
use Intervention\Image\Colors\Hsv\Channels\Saturation;
use Intervention\Image\Colors\Hsv\Channels\Value;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\InputHandler;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Color extends AbstractColor
{
/**
* Create new color object
*
* @return void
*/
public function __construct(int $h, int $s, int $v)
{
/** @throws void */
$this->channels = [
new Hue($h),
new Saturation($s),
new Value($v),
];
}
/**
* {@inheritdoc}
*
* @see ColorInterface::colorspace()
*/
public function colorspace(): ColorspaceInterface
{
return new Colorspace();
}
/**
* {@inheritdoc}
*
* @see ColorInterface::create()
*/
public static function create(mixed $input): ColorInterface
{
return InputHandler::withDecoders([
Decoders\StringColorDecoder::class,
])->handle($input);
}
/**
* Return the Hue channel
*/
public function hue(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Hue::class);
}
/**
* Return the Saturation channel
*/
public function saturation(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Saturation::class);
}
/**
* Return the Value channel
*/
public function value(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Value::class);
}
public function toHex(string $prefix = ''): string
{
return $this->convertTo(RgbColorspace::class)->toHex($prefix);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toString()
*/
public function toString(): string
{
return sprintf(
'hsv(%d, %d%%, %d%%)',
$this->hue()->value(),
$this->saturation()->value(),
$this->value()->value()
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isGreyscale()
*/
public function isGreyscale(): bool
{
return $this->saturation()->value() == 0;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isTransparent()
*/
public function isTransparent(): bool
{
return false;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isClear()
*/
public function isClear(): bool
{
return false;
}
}
================================================
FILE: src/Colors/Hsv/Colorspace.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsv;
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
use Intervention\Image\Colors\Rgb\Color as RgbColor;
use Intervention\Image\Colors\Hsl\Color as HslColor;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Colorspace implements ColorspaceInterface
{
/**
* Channel class names of colorspace
*
* @var array<string>
*/
public static array $channels = [
Channels\Hue::class,
Channels\Saturation::class,
Channels\Value::class
];
/**
* {@inheritdoc}
*
* @see ColorspaceInterface::colorFromNormalized()
*/
public function colorFromNormalized(array $normalized): ColorInterface
{
return new Color(...array_map(
fn(string $classname, float $value_normalized) => (new $classname(normalized: $value_normalized))->value(),
self::$channels,
$normalized
));
}
/**
* @throws ColorException
*/
public function importColor(ColorInterface $color): ColorInterface
{
return match ($color::class) {
CmykColor::class => $this->importRgbColor($color->convertTo(RgbColorspace::class)),
RgbColor::class => $this->importRgbColor($color),
HslColor::class => $this->importHslColor($color),
default => $color,
};
}
/**
* @throws ColorException
*/
protected function importRgbColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof RgbColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
// normalized values of rgb channels
$values = array_map(fn(ColorChannelInterface $channel): float => $channel->normalize(), $color->channels());
// take only RGB
$values = array_slice($values, 0, 3);
// calculate chroma
$min = min(...$values);
$max = max(...$values);
$chroma = $max - $min;
// calculate value
$v = 100 * $max;
if ($chroma == 0) {
// greyscale color
return new Color(0, 0, intval(round($v)));
}
// calculate saturation
$s = 100 * ($chroma / $max);
// calculate hue
[$r, $g, $b] = $values;
$h = match (true) {
($r == $min) => 3 - (($g - $b) / $chroma),
($b == $min) => 1 - (($r - $g) / $chroma),
default => 5 - (($b - $r) / $chroma),
} * 60;
return new Color(
intval(round($h)),
intval(round($s)),
intval(round($v))
);
}
/**
* @throws ColorException
*/
protected function importHslColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof HslColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
// normalized values of hsl channels
[$h, $s, $l] = array_map(
fn(ColorChannelInterface $channel): float => $channel->normalize(),
$color->channels()
);
$v = $l + $s * min($l, 1 - $l);
$s = ($v == 0) ? 0 : 2 * (1 - $l / $v);
return $this->colorFromNormalized([$h, $s, $v]);
}
}
================================================
FILE: src/Colors/Hsv/Decoders/StringColorDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Hsv\Decoders;
use Intervention\Image\Colors\Hsv\Color;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class StringColorDecoder extends AbstractDecoder implements DecoderInterface
{
/**
* Decode hsv/hsb color strings
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
$pattern = '/^hs(v|b)\((?P<h>[0-9\.]+), ?(?P<s>[0-9\.]+%?), ?(?P<v>[0-9\.]+%?)\)$/i';
if (preg_match($pattern, $input, $matches) != 1) {
throw new DecoderException('Unable to decode input');
}
$values = array_map(function (string $value): int {
return match (strpos($value, '%')) {
false => intval(trim($value)),
default => intval(trim(str_replace('%', '', $value))),
};
}, [$matches['h'], $matches['s'], $matches['v']]);
return new Color(...$values);
}
}
================================================
FILE: src/Colors/Profile.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors;
use Intervention\Image\File;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\ProfileInterface;
class Profile extends File implements ProfileInterface
{
/**
* Create profile object from path in file system
*
* @throws RuntimeException
*/
public static function fromPath(string $path): self
{
return new self(fopen($path, 'r'));
}
}
================================================
FILE: src/Colors/Rgb/Channels/Alpha.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Channels;
class Alpha extends Red
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::toString()
*/
public function toString(): string
{
return strval(round($this->normalize(), 6));
}
}
================================================
FILE: src/Colors/Rgb/Channels/Blue.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Channels;
class Blue extends Red
{
//
}
================================================
FILE: src/Colors/Rgb/Channels/Green.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Channels;
class Green extends Red
{
//
}
================================================
FILE: src/Colors/Rgb/Channels/Red.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Channels;
use Intervention\Image\Colors\AbstractColorChannel;
class Red extends AbstractColorChannel
{
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::min()
*/
public function min(): int
{
return 0;
}
/**
* {@inheritdoc}
*
* @see ColorChannelInterface::max()
*/
public function max(): int
{
return 255;
}
}
================================================
FILE: src/Colors/Rgb/Color.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb;
use Intervention\Image\Colors\AbstractColor;
use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Colors\Rgb\Channels\Alpha;
use Intervention\Image\InputHandler;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Color extends AbstractColor
{
/**
* Create new instance
*
* @return ColorInterface
*/
public function __construct(int $r, int $g, int $b, int $a = 255)
{
/** @throws void */
$this->channels = [
new Red($r),
new Green($g),
new Blue($b),
new Alpha($a),
];
}
/**
* {@inheritdoc}
*
* @see ColorInterface::colorspace()
*/
public function colorspace(): ColorspaceInterface
{
return new Colorspace();
}
/**
* {@inheritdoc}
*
* @see ColorInterface::create()
*/
public static function create(mixed $input): ColorInterface
{
return InputHandler::withDecoders([
Decoders\HexColorDecoder::class,
Decoders\StringColorDecoder::class,
Decoders\TransparentColorDecoder::class,
Decoders\HtmlColornameDecoder::class,
])->handle($input);
}
/**
* Return the RGB red color channel
*/
public function red(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Red::class);
}
/**
* Return the RGB green color channel
*/
public function green(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Green::class);
}
/**
* Return the RGB blue color channel
*/
public function blue(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Blue::class);
}
/**
* Return the colors alpha channel
*/
public function alpha(): ColorChannelInterface
{
/** @throws void */
return $this->channel(Alpha::class);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toHex()
*/
public function toHex(string $prefix = ''): string
{
if ($this->isTransparent()) {
return sprintf(
'%s%02x%02x%02x%02x',
$prefix,
$this->red()->value(),
$this->green()->value(),
$this->blue()->value(),
$this->alpha()->value()
);
}
return sprintf(
'%s%02x%02x%02x',
$prefix,
$this->red()->value(),
$this->green()->value(),
$this->blue()->value()
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::toString()
*/
public function toString(): string
{
if ($this->isTransparent()) {
return sprintf(
'rgba(%d, %d, %d, %.1F)',
$this->red()->value(),
$this->green()->value(),
$this->blue()->value(),
$this->alpha()->normalize(),
);
}
return sprintf(
'rgb(%d, %d, %d)',
$this->red()->value(),
$this->green()->value(),
$this->blue()->value()
);
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isGreyscale()
*/
public function isGreyscale(): bool
{
$values = [$this->red()->value(), $this->green()->value(), $this->blue()->value()];
return count(array_unique($values, SORT_REGULAR)) === 1;
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isTransparent()
*/
public function isTransparent(): bool
{
return $this->alpha()->value() < $this->alpha()->max();
}
/**
* {@inheritdoc}
*
* @see ColorInterface::isClear()
*/
public function isClear(): bool
{
return $this->alpha()->value() == 0;
}
}
================================================
FILE: src/Colors/Rgb/Colorspace.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb;
use Intervention\Image\Colors\Hsv\Color as HsvColor;
use Intervention\Image\Colors\Hsl\Color as HslColor;
use Intervention\Image\Colors\Cmyk\Color as CmykColor;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorChannelInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class Colorspace implements ColorspaceInterface
{
/**
* Channel class names of colorspace
*
* @var array<string>
*/
public static array $channels = [
Channels\Red::class,
Channels\Green::class,
Channels\Blue::class,
Channels\Alpha::class
];
/**
* {@inheritdoc}
*
* @see ColorspaceInterface::colorFromNormalized()
*/
public function colorFromNormalized(array $normalized): ColorInterface
{
return new Color(...array_map(
fn($classname, float $value_normalized) => (new $classname(normalized: $value_normalized))->value(),
self::$channels,
$normalized,
));
}
/**
* @throws ColorException
*/
public function importColor(ColorInterface $color): ColorInterface
{
return match ($color::class) {
CmykColor::class => $this->importCmykColor($color),
HsvColor::class => $this->importHsvColor($color),
HslColor::class => $this->importHslColor($color),
default => $color,
};
}
/**
* @throws ColorException
*/
protected function importCmykColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof CmykColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
return new Color(
(int) (255 * (1 - $color->cyan()->normalize()) * (1 - $color->key()->normalize())),
(int) (255 * (1 - $color->magenta()->normalize()) * (1 - $color->key()->normalize())),
(int) (255 * (1 - $color->yellow()->normalize()) * (1 - $color->key()->normalize())),
);
}
/**
* @throws ColorException
*/
protected function importHsvColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof HsvColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
$chroma = $color->value()->normalize() * $color->saturation()->normalize();
$hue = $color->hue()->normalize() * 6;
$x = $chroma * (1 - abs(fmod($hue, 2) - 1));
// connect channel values
$values = match (true) {
$hue < 1 => [$chroma, $x, 0],
$hue < 2 => [$x, $chroma, 0],
$hue < 3 => [0, $chroma, $x],
$hue < 4 => [0, $x, $chroma],
$hue < 5 => [$x, 0, $chroma],
default => [$chroma, 0, $x],
};
// add to each value
$values = array_map(fn(float|int $value): float => $value + $color->value()->normalize() - $chroma, $values);
$values[] = 1; // append alpha channel value
return $this->colorFromNormalized($values);
}
/**
* @throws ColorException
*/
protected function importHslColor(ColorInterface $color): ColorInterface
{
if (!($color instanceof HslColor)) {
throw new ColorException('Unabled to import color of type ' . $color::class . '.');
}
// normalized values of hsl channels
[$h, $s, $l] = array_map(
fn(ColorChannelInterface $channel): float => $channel->normalize(),
$color->channels()
);
$c = (1 - abs(2 * $l - 1)) * $s;
$x = $c * (1 - abs(fmod($h * 6, 2) - 1));
$m = $l - $c / 2;
$values = match (true) {
$h < 1 / 6 => [$c, $x, 0],
$h < 2 / 6 => [$x, $c, 0],
$h < 3 / 6 => [0, $c, $x],
$h < 4 / 6 => [0, $x, $c],
$h < 5 / 6 => [$x, 0, $c],
default => [$c, 0, $x],
};
$values = array_map(fn(float|int $value): float => $value + $m, $values);
$values[] = 1; // append alpha channel value
return $this->colorFromNormalized($values);
}
}
================================================
FILE: src/Colors/Rgb/Decoders/HexColorDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Decoders;
use Intervention\Image\Colors\Rgb\Color;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class HexColorDecoder extends AbstractDecoder implements DecoderInterface
{
/**
* Decode hexadecimal rgb colors with and without transparency
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
$pattern = '/^#?(?P<hex>[a-f\d]{3}(?:[a-f\d]?|(?:[a-f\d]{3}(?:[a-f\d]{2})?)?)\b)$/i';
if (preg_match($pattern, $input, $matches) != 1) {
throw new DecoderException('Unable to decode input');
}
$values = match (strlen($matches['hex'])) {
3, 4 => str_split($matches['hex']),
6, 8 => str_split($matches['hex'], 2),
default => throw new DecoderException('Unable to decode input'),
};
$values = array_map(function (string $value): float|int {
return match (strlen($value)) {
1 => hexdec($value . $value),
2 => hexdec($value),
default => throw new DecoderException('Unable to decode input'),
};
}, $values);
return new Color(...$values);
}
}
================================================
FILE: src/Colors/Rgb/Decoders/HtmlColornameDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Decoders;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class HtmlColornameDecoder extends HexColorDecoder implements DecoderInterface
{
/**
* Available color names and their corresponding hex codes
*
* @var array<string, string>
*/
protected static array $names = [
'lightsalmon' => '#ffa07a',
'salmon' => '#fa8072',
'darksalmon' => '#e9967a',
'lightcoral' => '#f08080',
'indianred' => '#cd5c5c',
'crimson' => '#dc143c',
'firebrick' => '#b22222',
'red' => '#ff0000',
'darkred' => '#8b0000',
'coral' => '#ff7f50',
'tomato' => '#ff6347',
'orangered' => '#ff4500',
'gold' => '#ffd700',
'orange' => '#ffa500',
'darkorange' => '#ff8c00',
'lightyellow' => '#ffffe0',
'lemonchiffon' => '#fffacd',
'lightgoldenrodyellow' => '#fafad2',
'papayawhip' => '#ffefd5',
'moccasin' => '#ffe4b5',
'peachpuff' => '#ffdab9',
'palegoldenrod' => '#eee8aa',
'khaki' => '#f0e68c',
'darkkhaki' => '#bdb76b',
'yellow' => '#ffff00',
'lawngreen' => '#7cfc00',
'chartreuse' => '#7fff00',
'limegreen' => '#32cd32',
'lime' => '#00ff00',
'forestgreen' => '#228b22',
'green' => '#008000',
'darkgreen' => '#006400',
'greenyellow' => '#adff2f',
'yellowgreen' => '#9acd32',
'springgreen' => '#00ff7f',
'mediumspringgreen' => '#00fa9a',
'lightgreen' => '#90ee90',
'palegreen' => '#98fb98',
'darkseagreen' => '#8fbc8f',
'mediumseagre' => 'en #3cb371',
'seagreen' => '#2e8b57',
'olive' => '#808000',
'darkolivegreen' => '#556b2f',
'olivedrab' => '#6b8e23',
'lightcyan' => '#e0ffff',
'cyan' => '#00ffff',
'aqua' => '#00ffff',
'aquamarine' => '#7fffd4',
'mediumaquamarine' => '#66cdaa',
'paleturquoise' => '#afeeee',
'turquoise' => '#40e0d0',
'mediumturquoise' => '#48d1cc',
'darkturquoise' => '#00ced1',
'lightseagreen' => '#20b2aa',
'cadetblue' => '#5f9ea0',
'darkcyan' => '#008b8b',
'teal' => '#008080',
'powderblue' => '#b0e0e6',
'lightblue' => '#add8e6',
'lightskyblue' => '#87cefa',
'skyblue' => '#87ceeb',
'deepskyblue' => '#00bfff',
'lightsteelblue' => '#b0c4de',
'dodgerblue' => '#1e90ff',
'cornflowerblue' => '#6495ed',
'steelblue' => '#4682b4',
'royalblue' => '#4169e1',
'blue' => '#0000ff',
'mediumblue' => '#0000cd',
'darkblue' => '#00008b',
'navy' => '#000080',
'midnightblue' => '#191970',
'mediumslateblue' => '#7b68ee',
'slateblue' => '#6a5acd',
'darkslateblue' => '#483d8b',
'lavender' => '#e6e6fa',
'thistle' => '#d8bfd8',
'plum' => '#dda0dd',
'violet' => '#ee82ee',
'orchid' => '#da70d6',
'fuchsia' => '#ff00ff',
'magenta' => '#ff00ff',
'mediumorchid' => '#ba55d3',
'mediumpurple' => '#9370db',
'blueviolet' => '#8a2be2',
'darkviolet' => '#9400d3',
'darkorchid' => '#9932cc',
'darkmagenta' => '#8b008b',
'purple' => '#800080',
'indigo' => '#4b0082',
'pink' => '#ffc0cb',
'lightpink' => '#ffb6c1',
'hotpink' => '#ff69b4',
'deeppink' => '#ff1493',
'palevioletred' => '#db7093',
'mediumvioletred' => '#c71585',
'white' => '#ffffff',
'snow' => '#fffafa',
'honeydew' => '#f0fff0',
'mintcream' => '#f5fffa',
'azure' => '#f0ffff',
'aliceblue' => '#f0f8ff',
'ghostwhite' => '#f8f8ff',
'whitesmoke' => '#f5f5f5',
'seashell' => '#fff5ee',
'beige' => '#f5f5dc',
'oldlace' => '#fdf5e6',
'floralwhite' => '#fffaf0',
'ivory' => '#fffff0',
'antiquewhite' => '#faebd7',
'linen' => '#faf0e6',
'lavenderblush' => '#fff0f5',
'mistyrose' => '#ffe4e1',
'gainsboro' => '#dcdcdc',
'lightgray' => '#d3d3d3',
'silver' => '#c0c0c0',
'darkgray' => '#a9a9a9',
'gray' => '#808080',
'dimgray' => '#696969',
'lightslategray' => '#778899',
'slategray' => '#708090',
'darkslategray' => '#2f4f4f',
'black' => '#000000',
'cornsilk' => '#fff8dc',
'blanchedalmond' => '#ffebcd',
'bisque' => '#ffe4c4',
'navajowhite' => '#ffdead',
'wheat' => '#f5deb3',
'burlywood' => '#deb887',
'tan' => '#d2b48c',
'rosybrown' => '#bc8f8f',
'sandybrown' => '#f4a460',
'goldenrod' => '#daa520',
'peru' => '#cd853f',
'chocolate' => '#d2691e',
'saddlebrown' => '#8b4513',
'sienna' => '#a0522d',
'brown' => '#a52a2a',
'maroon' => '#800000',
];
/**
* Decode html color names
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
if (!array_key_exists(strtolower($input), static::$names)) {
throw new DecoderException('Unable to decode input');
}
return parent::decode(static::$names[strtolower($input)]);
}
}
================================================
FILE: src/Colors/Rgb/Decoders/StringColorDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Decoders;
use Intervention\Image\Colors\Rgb\Color;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class StringColorDecoder extends AbstractDecoder implements DecoderInterface
{
/**
* Decode rgb color strings
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
$pattern = '/^s?rgba?\((?P<r>[0-9\.]+%?), ?(?P<g>[0-9\.]+%?), ?(?P<b>[0-9\.]+%?)' .
'(?:, ?(?P<a>(?:1)|(?:1\.0*)|(?:0)|(?:0?\.\d+%?)|(?:\d{1,3}%)))?\)$/i';
if (preg_match($pattern, $input, $matches) != 1) {
throw new DecoderException('Unable to decode input');
}
// rgb values
$values = array_map(function (string $value): int {
return match (strpos($value, '%')) {
false => intval(trim($value)),
default => intval(round(floatval(trim(str_replace('%', '', $value))) / 100 * 255)),
};
}, [$matches['r'], $matches['g'], $matches['b']]);
// alpha value
if (array_key_exists('a', $matches)) {
$values[] = match (true) {
strpos($matches['a'], '%') => round(intval(trim(str_replace('%', '', $matches['a']))) / 2.55),
default => intval(round(floatval(trim($matches['a'])) * 255)),
};
}
return new Color(...$values);
}
}
================================================
FILE: src/Colors/Rgb/Decoders/TransparentColorDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Colors\Rgb\Decoders;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ColorInterface;
class TransparentColorDecoder extends HexColorDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
if (strtolower($input) !== 'transparent') {
throw new DecoderException('Unable to decode input');
}
return parent::decode('#ffffff00');
}
}
================================================
FILE: src/Config.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image;
use Intervention\Image\Exceptions\InputException;
class Config
{
/**
* Create config object instance
*
* @return void
*/
public function __construct(
public bool $autoOrientation = true,
public bool $decodeAnimation = true,
public mixed $blendingColor = 'ffffff',
public bool $strip = false,
) {
//
}
/**
* Set values of given config options
*
* @throws InputException
*/
public function setOptions(mixed ...$options): self
{
foreach ($this->prepareOptions($options) as $name => $value) {
if (!property_exists($this, $name)) {
throw new InputException('Property ' . $name . ' does not exists for ' . $this::class . '.');
}
$this->{$name} = $value;
}
return $this;
}
/**
* This method makes it possible to call self::setOptions() with a single
* array instead of named parameters
*
* @param array<mixed> $options
* @return array<string, mixed>
*/
private function prepareOptions(array $options): array
{
if ($options === []) {
return $options;
}
if (count($options) > 1) {
return $options;
}
if (!array_key_exists(0, $options)) {
return $options;
}
if (!is_array($options[0])) {
return $options;
}
return $options[0];
}
}
================================================
FILE: src/Decoders/Base64ImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class Base64ImageDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/BinaryImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class BinaryImageDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/ColorObjectDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ImageInterface;
class ColorObjectDecoder extends AbstractDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_a($input, ColorInterface::class)) {
throw new DecoderException('Unable to decode input');
}
return $input;
}
}
================================================
FILE: src/Decoders/DataUriImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class DataUriImageDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/EncodedImageObjectDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class EncodedImageObjectDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/FilePathImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class FilePathImageDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/FilePointerImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class FilePointerImageDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/ImageObjectDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\AbstractDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ColorInterface;
class ImageObjectDecoder extends AbstractDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_a($input, ImageInterface::class)) {
throw new DecoderException('Unable to decode input');
}
return $input;
}
}
================================================
FILE: src/Decoders/NativeObjectDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class NativeObjectDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Decoders/SplFileInfoImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
class SplFileInfoImageDecoder extends SpecializableDecoder
{
//
}
================================================
FILE: src/Drivers/AbstractDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers;
use Exception;
use Intervention\Image\Collection;
use Intervention\Image\Interfaces\CollectionInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Traits\CanBuildFilePointer;
abstract class AbstractDecoder implements DecoderInterface
{
use CanBuildFilePointer;
/**
* 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');
}
/**
* Determine if given input is a path to an existing regular file
*/
protected function isFile(mixed $input): bool
{
if (!is_string($input)) {
return false;
}
if (strlen($input) > PHP_MAXPATHLEN) {
return false;
}
try {
if (!@is_file($input)) {
return false;
}
} catch (Exception) {
return false;
}
return true;
}
/**
* Extract and return EXIF data from given input which can be binary image
* data or a file path.
*
* @return CollectionInterface<string, mixed>
*/
protected function extractExifData(string $path_or_data): CollectionInterface
{
if (!function_exists('exif_read_data')) {
return new Collection();
}
try {
$source = match (true) {
$this->isFile($path_or_data) => $path_or_data, // path
default => $this->buildFilePointer($path_or_data), // data
};
// extract exif data
$data = @exif_read_data($source, null, true);
if (is_resource($source)) {
fclose($source);
}
} catch (Exception) {
$data = [];
}
return new Collection(is_array($data) ? $data : []);
}
/**
* Determine if given input is base64 encoded data
*/
protected function isValidBase64(mixed $input): bool
{
if (!is_string($input)) {
return false;
}
return base64_encode(base64_decode($input)) === str_replace(["\n", "\r"], '', $input);
}
/**
* Parse data uri
*/
protected function parseDataUri(mixed $input): object
{
$pattern = "/^data:(?P<mediatype>\w+\/[-+.\w]+)?" .
"(?P<parameters>(;[-\w]+=[-\w]+)*)(?P<base64>;base64)?,(?P<data>.*)/";
$result = preg_match($pattern, (string) $input, $matches);
return new class ($matches, $result)
{
/**
* @param array<mixed> $matches
* @return void
*/
public function __construct(private array $matches, private int|false $result)
{
//
}
public function isValid(): bool
{
return (bool) $this->result;
}
public function mediaType(): ?string
{
if (isset($this->matches['mediatype']) && !empty($this->matches['mediatype'])) {
return $this->matches['mediatype'];
}
return null;
}
public function hasMediaType(): bool
{
return !empty($this->mediaType());
}
public function isBase64Encoded(): bool
{
return isset($this->matches['base64']) && $this->matches['base64'] === ';base64';
}
public function data(): ?string
{
if (isset($this->matches['data']) && !empty($this->matches['data'])) {
return $this->matches['data'];
}
return null;
}
};
}
}
================================================
FILE: src/Drivers/AbstractDriver.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers;
use Intervention\Image\Config;
use Intervention\Image\Exceptions\DriverException;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\InputHandler;
use Intervention\Image\Interfaces\AnalyzerInterface;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\DriverInterface;
use Intervention\Image\Interfaces\EncoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ModifierInterface;
use Intervention\Image\Interfaces\SpecializableInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use ReflectionClass;
abstract class AbstractDriver implements DriverInterface
{
/**
* Driver options
*/
protected Config $config;
/**
* @throws DriverException
* @return void
*/
public function __construct()
{
$this->config = new Config();
$this->checkHealth();
}
/**
* {@inheritdoc}
*
* @see DriverInterface::config()
*/
public function config(): Config
{
return $this->config;
}
/**
* {@inheritdoc}
*
* @see DriverInterface::handleInput()
*/
public function handleInput(mixed $input, array $decoders = []): ImageInterface|ColorInterface
{
return InputHandler::withDecoders($decoders, $this)->handle($input);
}
/**
* {@inheritdoc}
*
* @see DriverInterface::specialize()
*/
public function specialize(
ModifierInterface|AnalyzerInterface|EncoderInterface|DecoderInterface $object
): ModifierInterface|AnalyzerInterface|EncoderInterface|DecoderInterface {
// return object directly if no specializing is possible
if (!($object instanceof SpecializableInterface)) {
return $object;
}
// return directly and only attach driver if object is already specialized
if ($object instanceof SpecializedInterface) {
$object->setDriver($this);
return $object;
}
// resolve classname for specializable object
$specialized_classname = implode("\\", [
(new ReflectionClass($this))->getNamespaceName(), // driver's namespace
match (true) {
$object instanceof ModifierInterface => 'Modifiers',
$object instanceof AnalyzerInterface => 'Analyzers',
$object instanceof EncoderInterface => 'Encoders',
$object instanceof DecoderInterface => 'Decoders',
},
$object_shortname = (new ReflectionClass($object))->getShortName(),
]);
// fail if driver specialized classname does not exists
if (!class_exists($specialized_classname)) {
throw new NotSupportedException(
"Class '" . $object_shortname . "' is not supported by " . $this->id() . " driver."
);
}
// create a driver specialized object with the specializable properties of generic object
$specialized = new $specialized_classname(...$object->specializable());
// attach driver
return $specialized->setDriver($this);
}
/**
* {@inheritdoc}
*
* @see DriverInterface::specializeMultiple()
*
* @throws NotSupportedException
* @throws DriverException
*/
public function specializeMultiple(array $objects): array
{
return array_map(
function (string|object $object): ModifierInterface|AnalyzerInterface|EncoderInterface|DecoderInterface {
return $this->specialize(
match (true) {
is_string($object) => new $object(),
is_object($object) => $object,
}
);
},
$objects
);
}
}
================================================
FILE: src/Drivers/AbstractEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers;
use Intervention\Image\EncodedImage;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\EncodedImageInterface;
use Intervention\Image\Interfaces\EncoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Traits\CanBuildFilePointer;
abstract class AbstractEncoder implements EncoderInterface
{
use CanBuildFilePointer;
public const DEFAULT_QUALITY = 75;
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImageInterface
{
return $image->encode($this);
}
/**
* Build new file pointer, run callback with it and return result as encoded image
*
* @throws RuntimeException
*/
protected function createEncodedImage(callable $callback, ?string $mediaType = null): EncodedImage
{
$pointer = $this->buildFilePointer();
$callback($pointer);
return is_string($mediaType) ? new EncodedImage($pointer, $mediaType) : new EncodedImage($pointer);
}
}
================================================
FILE: src/Drivers/AbstractFontProcessor.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers;
use Intervention\Image\Exceptions\FontException;
use Intervention\Image\Geometry\Point;
use Intervention\Image\Geometry\Rectangle;
use Intervention\Image\Interfaces\FontInterface;
use Intervention\Image\Interfaces\FontProcessorInterface;
use Intervention\Image\Interfaces\PointInterface;
use Intervention\Image\Typography\Line;
use Intervention\Image\Typography\TextBlock;
abstract class AbstractFontProcessor implements FontProcessorInterface
{
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::textBlock()
*/
public function textBlock(string $text, FontInterface $font, PointInterface $position): TextBlock
{
$lines = $this->wrapTextBlock(new TextBlock($text), $font);
$pivot = $this->buildPivot($lines, $font, $position);
$leading = $this->leading($font);
$blockWidth = $this->boxSize((string) $lines->longestLine(), $font)->width();
$x = $pivot->x();
$y = $font->hasFilename() ? $pivot->y() + $this->capHeight($font) : $pivot->y();
$xAdjustment = 0;
// adjust line positions according to alignment
foreach ($lines as $line) {
$lineBoxSize = $this->boxSize((string) $line, $font);
$lineWidth = $lineBoxSize->width() + $lineBoxSize->pivot()->x();
$xAdjustment = $font->alignment() === 'left' ? 0 : $blockWidth - $lineWidth;
$xAdjustment = $font->alignment() === 'right' ? intval(round($xAdjustment)) : $xAdjustment;
$xAdjustment = $font->alignment() === 'center' ? intval(round($xAdjustment / 2)) : $xAdjustment;
$position = new Point($x + $xAdjustment, $y);
$position->rotate($font->angle(), $pivot);
$line->setPosition($position);
$y += $leading;
}
return $lines;
}
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::nativeFontSize()
*/
public function nativeFontSize(FontInterface $font): float
{
return $font->size();
}
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::typographicalSize()
*/
public function typographicalSize(FontInterface $font): int
{
return $this->boxSize('Hy', $font)->height();
}
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::capHeight()
*/
public function capHeight(FontInterface $font): int
{
return $this->boxSize('T', $font)->height();
}
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::leading()
*/
public function leading(FontInterface $font): int
{
return intval(round($this->typographicalSize($font) * $font->lineHeight()));
}
/**
* Reformat a text block by wrapping each line before the given maximum width
*
* @throws FontException
*/
protected function wrapTextBlock(TextBlock $block, FontInterface $font): TextBlock
{
$newLines = [];
foreach ($block as $line) {
foreach ($this->wrapLine($line, $font) as $newLine) {
$newLines[] = $newLine;
}
}
return $block->setLines($newLines);
}
/**
* Check if a line exceeds the given maximum width and wrap it if necessary.
* The output will be an array of formatted lines that are all within the
* maximum width.
*
* @throws FontException
* @return array<Line>
*/
protected function wrapLine(Line $line, FontInterface $font): array
{
// no wrap width - no wrapping
if (is_null($font->wrapWidth())) {
return [$line];
}
$wrapped = [];
$formattedLine = new Line();
foreach ($line as $word) {
// calculate width of newly formatted line
$lineWidth = $this->boxSize(match ($formattedLine->count()) {
0 => $word,
default => $formattedLine . ' ' . $word,
}, $font)->width();
// decide if word fits on current line or a new line must be created
if ($line->count() === 1 || $lineWidth <= $font->wrapWidth()) {
$formattedLine->add($word);
} else {
if ($formattedLine->count() !== 0) {
$wrapped[] = $formattedLine;
}
$formattedLine = new Line($word);
}
}
$wrapped[] = $formattedLine;
return $wrapped;
}
/**
* Build pivot point of textblock according to the font settings and based on given position
*
* @throws FontException
*/
protected function buildPivot(TextBlock $block, FontInterface $font, PointInterface $position): PointInterface
{
// bounding box
$box = new Rectangle(
$this->boxSize((string) $block->longestLine(), $font)->width(),
$this->leading($font) * ($block->count() - 1) + $this->capHeight($font)
);
// set position
$box->setPivot($position);
// alignment
$box->align($font->alignment());
$box->valign($font->valignment());
$box->rotate($font->angle());
return $box->last();
}
}
================================================
FILE: src/Drivers/AbstractFrame.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers;
use Intervention\Image\Interfaces\FrameInterface;
abstract class AbstractFrame implements FrameInterface
{
/**
* Show debug info for the current image
*
* @return array<string, mixed>
*/
public function __debugInfo(): array
{
return [
'delay' => $this->delay(),
'left' => $this->offsetLeft(),
'top' => $this->offsetTop(),
'dispose' => $this->dispose(),
];
}
}
================================================
FILE: src/Drivers/Gd/Analyzers/ColorspaceAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Analyzers;
use Intervention\Image\Analyzers\ColorspaceAnalyzer as GenericColorspaceAnalyzer;
use Intervention\Image\Colors\Rgb\Colorspace;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class ColorspaceAnalyzer extends GenericColorspaceAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return new Colorspace();
}
}
================================================
FILE: src/Drivers/Gd/Analyzers/HeightAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Analyzers;
use Intervention\Image\Analyzers\HeightAnalyzer as GenericHeightAnalyzer;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class HeightAnalyzer extends GenericHeightAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return imagesy($image->core()->native());
}
}
================================================
FILE: src/Drivers/Gd/Analyzers/PixelColorAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Analyzers;
use GdImage;
use Intervention\Image\Analyzers\PixelColorAnalyzer as GenericPixelColorAnalyzer;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Exceptions\GeometryException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class PixelColorAnalyzer extends GenericPixelColorAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return $this->colorAt(
$image->colorspace(),
$image->core()->frame($this->frame_key)->native()
);
}
/**
* @throws GeometryException
* @throws ColorException
*/
protected function colorAt(ColorspaceInterface $colorspace, GdImage $gd): ColorInterface
{
$index = @imagecolorat($gd, $this->x, $this->y);
if (!imageistruecolor($gd)) {
$index = imagecolorsforindex($gd, $index);
}
if ($index === false) {
throw new GeometryException(
'The specified position is not in the valid image area.'
);
}
return $this->driver()->colorProcessor($colorspace)->nativeToColor($index);
}
}
================================================
FILE: src/Drivers/Gd/Analyzers/PixelColorsAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Analyzers;
use Intervention\Image\Collection;
use Intervention\Image\Interfaces\ImageInterface;
class PixelColorsAnalyzer extends PixelColorAnalyzer
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
$colors = new Collection();
$colorspace = $image->colorspace();
foreach ($image as $frame) {
$colors->push(
parent::colorAt($colorspace, $frame->native())
);
}
return $colors;
}
}
================================================
FILE: src/Drivers/Gd/Analyzers/ResolutionAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Analyzers;
use Intervention\Image\Analyzers\ResolutionAnalyzer as GenericResolutionAnalyzer;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Resolution;
class ResolutionAnalyzer extends GenericResolutionAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return new Resolution(...imageresolution($image->core()->native()));
}
}
================================================
FILE: src/Drivers/Gd/Analyzers/WidthAnalyzer.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Analyzers;
use Intervention\Image\Analyzers\WidthAnalyzer as GenericWidthAnalyzer;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class WidthAnalyzer extends GenericWidthAnalyzer implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see AnalyzerInterface::analyze()
*/
public function analyze(ImageInterface $image): mixed
{
return imagesx($image->core()->native());
}
}
================================================
FILE: src/Drivers/Gd/Cloner.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd;
use GdImage;
use Intervention\Image\Colors\Rgb\Channels\Alpha;
use Intervention\Image\Colors\Rgb\Color;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Geometry\Rectangle;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\SizeInterface;
class Cloner
{
/**
* Create a clone of the given GdImage
*
* @throws ColorException
*/
public static function clone(GdImage $gd): GdImage
{
// create empty canvas with same size
$clone = static::cloneEmpty($gd);
// transfer actual image to clone
imagecopy($clone, $gd, 0, 0, 0, 0, imagesx($gd), imagesy($gd));
return $clone;
}
/**
* Create an "empty" clone of the given GdImage
*
* This only retains the basic data without transferring the actual image.
* It is optionally possible to change the size of the result and set a
* background color.
*
* @throws ColorException
*/
public static function cloneEmpty(
GdImage $gd,
?SizeInterface $size = null,
ColorInterface $background = new Color(255, 255, 255, 0)
): GdImage {
// define size
$size = $size ?: new Rectangle(imagesx($gd), imagesy($gd));
// create new gd image with same size or new given size
$clone = imagecreatetruecolor($size->width(), $size->height());
// copy resolution to clone
$resolution = imageresolution($gd);
if (is_array($resolution) && array_key_exists(0, $resolution) && array_key_exists(1, $resolution)) {
imageresolution($clone, $resolution[0], $resolution[1]);
}
// fill with background
$processor = new ColorProcessor();
imagefill($clone, 0, 0, $processor->colorToNative($background));
imagealphablending($clone, true);
imagesavealpha($clone, true);
// set background image as transparent if alpha channel value if color is below .5
// comes into effect when the end format only supports binary transparency (like GIF)
if ($background->channel(Alpha::class)->value() < 128) {
imagecolortransparent($clone, $processor->colorToNative($background));
}
return $clone;
}
/**
* Create a clone of an GdImage that is positioned on the specified background color.
* Possible transparent areas are mixed with this color.
*
* @throws ColorException
*/
public static function cloneBlended(GdImage $gd, ColorInterface $background): GdImage
{
// create empty canvas with same size
$clone = static::cloneEmpty($gd, background: $background);
// transfer actual image to clone
imagecopy($clone, $gd, 0, 0, 0, 0, imagesx($gd), imagesy($gd));
return $clone;
}
}
================================================
FILE: src/Drivers/Gd/ColorProcessor.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd;
use Intervention\Image\Colors\Rgb\Channels\Alpha;
use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Colors\Rgb\Color;
use Intervention\Image\Colors\Rgb\Colorspace;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorProcessorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
class ColorProcessor implements ColorProcessorInterface
{
/**
* Create new color processor object
*
* @return void
*/
public function __construct(protected ColorspaceInterface $colorspace = new Colorspace())
{
//
}
/**
* {@inheritdoc}
*
* @see ColorProcessorInterface::colorToNative()
*/
public function colorToNative(ColorInterface $color): int
{
// convert color to colorspace
$color = $color->convertTo($this->colorspace);
// gd only supports rgb so the channels can be accessed directly
$r = $color->channel(Red::class)->value();
$g = $color->channel(Green::class)->value();
$b = $color->channel(Blue::class)->value();
$a = $color->channel(Alpha::class)->value();
// convert alpha value to gd alpha
// ([opaque]255-0[transparent]) to ([opaque]0-127[transparent])
$a = (int) $this->convertRange($a, 0, 255, 127, 0);
return ($a << 24) + ($r << 16) + ($g << 8) + $b;
}
/**
* {@inheritdoc}
*
* @see ColorProcessorInterface::nativeToColor()
*/
public function nativeToColor(mixed $value): ColorInterface
{
if (!is_int($value) && !is_array($value)) {
throw new ColorException('GD driver can only decode colors in integer and array format.');
}
if (is_array($value)) {
// array conversion
if (!$this->isValidArrayColor($value)) {
throw new ColorException(
'GD driver can only decode array color format array{red: int, green: int, blue: int, alpha: int}.',
);
}
$r = $value['red'];
$g = $value['green'];
$b = $value['blue'];
$a = $value['alpha'];
} else {
// integer conversion
$a = ($value >> 24) & 0xFF;
$r = ($value >> 16) & 0xFF;
$g = ($value >> 8) & 0xFF;
$b = $value & 0xFF;
}
// convert gd apha integer to intervention alpha integer
// ([opaque]0-127[transparent]) to ([opaque]255-0[transparent])
$a = (int) static::convertRange($a, 127, 0, 0, 255);
return new Color($r, $g, $b, $a);
}
/**
* Convert input in range (min) to (max) to the corresponding value
* in target range (targetMin) to (targetMax).
*/
protected function convertRange(
float|int $input,
float|int $min,
float|int $max,
float|int $targetMin,
float|int $targetMax
): float|int {
return ceil(((($input - $min) * ($targetMax - $targetMin)) / ($max - $min)) + $targetMin);
}
/**
* Check if given array is valid color format
* array{red: int, green: int, blue: int, alpha: int}
* i.e. result of imagecolorsforindex()
*
* @param array<mixed> $color
*/
private function isValidArrayColor(array $color): bool
{
if (!array_key_exists('red', $color)) {
return false;
}
if (!array_key_exists('green', $color)) {
return false;
}
if (!array_key_exists('blue', $color)) {
return false;
}
if (!array_key_exists('alpha', $color)) {
return false;
}
if (!is_int($color['red'])) {
return false;
}
if (!is_int($color['green'])) {
return false;
}
if (!is_int($color['blue'])) {
return false;
}
if (!is_int($color['alpha'])) {
return false;
}
return true;
}
}
================================================
FILE: src/Drivers/Gd/Core.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd;
use Intervention\Image\Collection;
use Intervention\Image\Exceptions\AnimationException;
use Intervention\Image\Interfaces\CoreInterface;
use Intervention\Image\Interfaces\FrameInterface;
class Core extends Collection implements CoreInterface
{
protected int $loops = 0;
/**
* {@inheritdoc}
*
* @see CoreInterface::add()
*/
public function add(FrameInterface $frame): CoreInterface
{
$this->push($frame);
return $this;
}
/**
* {@inheritdoc}
*
* @see CoreInterface::native()
*/
public function native(): mixed
{
return $this->first()->native();
}
/**
* {@inheritdoc}
*
* @see CoreInterface::setNative()
*/
public function setNative(mixed $native): self
{
$this->empty()->push(new Frame($native));
return $this;
}
/**
* {@inheritdoc}
*
* @see CoreInterface::frame()
*/
public function frame(int $position): FrameInterface
{
$frame = $this->getAtPosition($position);
if (!($frame instanceof FrameInterface)) {
throw new AnimationException('Frame #' . $position . ' could not be found in the image.');
}
return $frame;
}
/**
* {@inheritdoc}
*
* @see CoreInterface::loops()
*/
public function loops(): int
{
return $this->loops;
}
/**
* {@inheritdoc}
*
* @see CoreInterface::setLoops()
*/
public function setLoops(int $loops): self
{
$this->loops = $loops;
return $this;
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::first()
*/
public function first(): FrameInterface
{
return parent::first();
}
/**
* {@inheritdoc}
*
* @see CollectionInterface::last()
*/
public function last(): FrameInterface
{
return parent::last();
}
/**
* Clone instance
*/
public function __clone(): void
{
foreach ($this->items as $key => $frame) {
$this->items[$key] = clone $frame;
}
}
}
================================================
FILE: src/Drivers/Gd/Decoders/AbstractDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\Drivers\SpecializableDecoder;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\MediaType;
use ValueError;
abstract class AbstractDecoder extends SpecializableDecoder implements SpecializedInterface
{
/**
* Return media (mime) type of the file at given file path
*
* @throws DecoderException
* @throws NotSupportedException
*/
protected function getMediaTypeByFilePath(string $filepath): MediaType
{
if (function_exists('finfo_file') && function_exists('finfo_open')) {
$mediaType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $filepath);
if (is_string($mediaType)) {
try {
return MediaType::from($mediaType);
} catch (ValueError) {
throw new NotSupportedException('Unsupported media type (MIME) ' . $mediaType . '.');
}
}
}
$info = @getimagesize($filepath);
if (!is_array($info)) {
throw new DecoderException('Unable to detect media (MIME) from data in file path.');
}
try {
return MediaType::from($info['mime']);
} catch (ValueError) {
throw new NotSupportedException('Unsupported media type (MIME) ' . $info['mime'] . '.');
}
}
/**
* Return media (mime) type of the given image data
*
* @throws DecoderException
* @throws NotSupportedException
*/
protected function getMediaTypeByBinary(string $data): MediaType
{
if (function_exists('finfo_buffer') && function_exists('finfo_open')) {
$mediaType = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data);
if (is_string($mediaType)) {
try {
return MediaType::from($mediaType);
} catch (ValueError) {
throw new NotSupportedException('Unsupported media type (MIME) ' . $mediaType . '.');
}
}
}
$info = @getimagesizefromstring($data);
if (!is_array($info)) {
throw new DecoderException('Unable to detect media (MIME) from binary data.');
}
try {
return MediaType::from($info['mime']);
} catch (ValueError) {
throw new NotSupportedException('Unsupported media type (MIME) ' . $info['mime'] . '.');
}
}
}
================================================
FILE: src/Drivers/Gd/Decoders/Base64ImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class Base64ImageDecoder extends BinaryImageDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!$this->isValidBase64($input)) {
throw new DecoderException('Unable to decode input');
}
return parent::decode(base64_decode((string) $input));
}
}
================================================
FILE: src/Drivers/Gd/Decoders/BinaryImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Format;
use Intervention\Image\Modifiers\AlignRotationModifier;
class BinaryImageDecoder extends NativeObjectDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
return match ($this->isGifFormat($input)) {
true => $this->decodeGif($input),
default => $this->decodeBinary($input),
};
}
/**
* Decode image from given binary data
*
* @throws RuntimeException
*/
private function decodeBinary(string $input): ImageInterface
{
$gd = @imagecreatefromstring($input);
if ($gd === false) {
throw new DecoderException('Unable to decode input');
}
// create image instance
$image = parent::decode($gd);
// get media type
$mediaType = $this->getMediaTypeByBinary($input);
// extract & set exif data for appropriate formats
if (in_array($mediaType->format(), [Format::JPEG, Format::TIFF])) {
$image->setExif($this->extractExifData($input));
}
// set mediaType on origin
$image->origin()->setMediaType($mediaType);
// adjust image orientation
if ($this->driver()->config()->autoOrientation) {
$image->modify(new AlignRotationModifier());
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Decoders/DataUriImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class DataUriImageDecoder extends BinaryImageDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_string($input)) {
throw new DecoderException('Unable to decode input');
}
$uri = $this->parseDataUri($input);
if (!$uri->isValid()) {
throw new DecoderException('Unable to decode input');
}
if ($uri->isBase64Encoded()) {
return parent::decode(base64_decode($uri->data()));
}
return parent::decode(urldecode($uri->data()));
}
}
================================================
FILE: src/Drivers/Gd/Decoders/EncodedImageObjectDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\EncodedImage;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ColorInterface;
class EncodedImageObjectDecoder extends BinaryImageDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_a($input, EncodedImage::class)) {
throw new DecoderException('Unable to decode input');
}
return parent::decode($input->toString());
}
}
================================================
FILE: src/Drivers/Gd/Decoders/FilePathImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Format;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Modifiers\AlignRotationModifier;
class FilePathImageDecoder extends NativeObjectDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!$this->isFile($input)) {
throw new DecoderException('Unable to decode input');
}
// detect media (mime) type
$mediaType = $this->getMediaTypeByFilePath($input);
$image = match ($mediaType->format()) {
// gif files might be animated and therefore cannot
// be handled by the standard GD decoder.
Format::GIF => $this->decodeGif($input),
default => parent::decode(match ($mediaType->format()) {
Format::JPEG => @imagecreatefromjpeg($input),
Format::WEBP => @imagecreatefromwebp($input),
Format::PNG => @imagecreatefrompng($input),
Format::AVIF => @imagecreatefromavif($input),
Format::BMP => @imagecreatefrombmp($input),
default => throw new DecoderException('Unable to decode input'),
}),
};
// set file path & mediaType on origin
$image->origin()->setFilePath($input);
$image->origin()->setMediaType($mediaType);
// extract exif for the appropriate formats
if ($mediaType->format() === Format::JPEG) {
$image->setExif($this->extractExifData($input));
}
// adjust image orientation
if ($this->driver()->config()->autoOrientation) {
$image->modify(new AlignRotationModifier());
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Decoders/FilePointerImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ImageInterface;
class FilePointerImageDecoder extends BinaryImageDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_resource($input) || !in_array(get_resource_type($input), ['file', 'stream'])) {
throw new DecoderException('Unable to decode input');
}
$contents = '';
@rewind($input);
while (!feof($input)) {
$contents .= fread($input, 1024);
}
return parent::decode($contents);
}
}
================================================
FILE: src/Drivers/Gd/Decoders/NativeObjectDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use Exception;
use GdImage;
use Intervention\Gif\Decoder as GifDecoder;
use Intervention\Gif\Splitter as GifSplitter;
use Intervention\Image\Drivers\Gd\Core;
use Intervention\Image\Drivers\Gd\Frame;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Image;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ImageInterface;
class NativeObjectDecoder extends AbstractDecoder
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_object($input)) {
throw new DecoderException('Unable to decode input');
}
if (!($input instanceof GdImage)) {
throw new DecoderException('Unable to decode input');
}
if (!imageistruecolor($input)) {
imagepalettetotruecolor($input);
}
imagesavealpha($input, true);
// build image instance
return new Image(
$this->driver(),
new Core([
new Frame($input)
])
);
}
/**
* Decode image from given GIF source which can be either a file path or binary data
*
* Depending on the configuration, this is taken over by the native GD function
* or, if animations are required, by our own extended decoder.
*
* @throws RuntimeException
*/
protected function decodeGif(mixed $input): ImageInterface
{
// create non-animated image depending on config
if (!$this->driver()->config()->decodeAnimation) {
$native = match (true) {
$this->isGifFormat($input) => @imagecreatefromstring($input),
default => @imagecreatefromgif($input),
};
if ($native === false) {
throw new DecoderException('Unable to decode input.');
}
$image = self::decode($native);
$image->origin()->setMediaType('image/gif');
return $image;
}
try {
// create empty core
$core = new Core();
$gif = GifDecoder::decode($input);
$splitter = GifSplitter::create($gif)->split();
$delays = $splitter->getDelays();
// set loops on core
if ($loops = $gif->getMainApplicationExtension()?->getLoops()) {
$core->setLoops($loops);
}
// add GDImage instances to core
foreach ($splitter->coalesceToResources() as $key => $native) {
$core->push(
new Frame($native, $delays[$key] / 100)
);
}
} catch (Exception $e) {
throw new DecoderException($e->getMessage(), $e->getCode(), $e);
}
// create (possibly) animated image
$image = new Image($this->driver(), $core);
// set media type
$image->origin()->setMediaType('image/gif');
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Decoders/SplFileInfoImageDecoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Decoders;
use SplFileInfo;
use Intervention\Image\Exceptions\DecoderException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\DecoderInterface;
use Intervention\Image\Interfaces\ImageInterface;
class SplFileInfoImageDecoder extends FilePathImageDecoder implements DecoderInterface
{
/**
* {@inheritdoc}
*
* @see DecoderInterface::decode()
*/
public function decode(mixed $input): ImageInterface|ColorInterface
{
if (!is_a($input, SplFileInfo::class)) {
throw new DecoderException('Unable to decode input');
}
return parent::decode($input->getRealPath());
}
}
================================================
FILE: src/Drivers/Gd/Driver.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd;
use Intervention\Image\Drivers\AbstractDriver;
use Intervention\Image\Exceptions\DriverException;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Format;
use Intervention\Image\FileExtension;
use Intervention\Image\Image;
use Intervention\Image\Interfaces\ColorProcessorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
use Intervention\Image\Interfaces\DriverInterface;
use Intervention\Image\Interfaces\FontProcessorInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\MediaType;
class Driver extends AbstractDriver
{
/**
* {@inheritdoc}
*
* @see DriverInterface::id()
*/
public function id(): string
{
return 'GD';
}
/**
* {@inheritdoc}
*
* @see DriverInterface::checkHealth()
*
* @codeCoverageIgnore
*/
public function checkHealth(): void
{
if (!extension_loaded('gd') || !function_exists('gd_info')) {
throw new DriverException(
'GD PHP extension must be installed to use this driver.'
);
}
}
/**
* {@inheritdoc}
*
* @see DriverInterface::createImage()
*/
public function createImage(int $width, int $height): ImageInterface
{
// build new transparent GDImage
$data = imagecreatetruecolor($width, $height);
imagesavealpha($data, true);
$background = imagecolorallocatealpha($data, 255, 255, 255, 127);
imagealphablending($data, false);
imagefill($data, 0, 0, $background);
imagecolortransparent($data, $background);
return new Image(
$this,
new Core([
new Frame($data)
])
);
}
/**
* {@inheritdoc}
*
* @see DriverInterface::createAnimation()
*
* @throws RuntimeException
*/
public function createAnimation(callable $init): ImageInterface
{
$animation = new class ($this)
{
public function __construct(
protected DriverInterface $driver,
public Core $core = new Core()
) {
//
}
/**
* @throws RuntimeException
*/
public function add(mixed $source, float $delay = 1): self
{
$this->core->add(
$this->driver->handleInput($source)->core()->first()->setDelay($delay)
);
return $this;
}
/**
* @throws RuntimeException
*/
public function __invoke(): ImageInterface
{
return new Image(
$this->driver,
$this->core
);
}
};
$init($animation);
return call_user_func($animation);
}
/**
* {@inheritdoc}
*
* @see DriverInterface::colorProcessor()
*/
public function colorProcessor(ColorspaceInterface $colorspace): ColorProcessorInterface
{
return new ColorProcessor($colorspace);
}
/**
* {@inheritdoc}
*
* @see DriverInterface::fontProcessor()
*/
public function fontProcessor(): FontProcessorInterface
{
return new FontProcessor();
}
/**
* {@inheritdoc}
*
* @see DriverInterface::supports()
*/
public function supports(string|Format|FileExtension|MediaType $identifier): bool
{
return match (Format::tryCreate($identifier)) {
Format::JPEG => boolval(imagetypes() & IMG_JPEG),
Format::WEBP => boolval(imagetypes() & IMG_WEBP),
Format::GIF => boolval(imagetypes() & IMG_GIF),
Format::PNG => boolval(imagetypes() & IMG_PNG),
Format::AVIF => boolval(imagetypes() & IMG_AVIF),
Format::BMP => boolval(imagetypes() & IMG_BMP),
default => false,
};
}
/**
* Return version of GD library
*/
public static function version(): string
{
return gd_info()['GD Version'];
}
}
================================================
FILE: src/Drivers/Gd/Encoders/AvifEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\AvifEncoder as GenericAvifEncoder;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class AvifEncoder extends GenericAvifEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
return $this->createEncodedImage(function ($pointer) use ($image): void {
imageavif($image->core()->native(), $pointer, $this->quality);
}, 'image/avif');
}
}
================================================
FILE: src/Drivers/Gd/Encoders/BmpEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\BmpEncoder as GenericBmpEncoder;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class BmpEncoder extends GenericBmpEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
return $this->createEncodedImage(function ($pointer) use ($image): void {
imagebmp($image->core()->native(), $pointer, false);
}, 'image/bmp');
}
}
================================================
FILE: src/Drivers/Gd/Encoders/GifEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use Exception;
use Intervention\Gif\Builder as GifBuilder;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\GifEncoder as GenericGifEncoder;
use Intervention\Image\Exceptions\EncoderException;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class GifEncoder extends GenericGifEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
if ($image->isAnimated()) {
return $this->encodeAnimated($image);
}
$gd = Cloner::clone($image->core()->native());
return $this->createEncodedImage(function ($pointer) use ($gd): void {
imageinterlace($gd, $this->interlaced);
imagegif($gd, $pointer);
}, 'image/gif');
}
/**
* @throws RuntimeException
*/
protected function encodeAnimated(ImageInterface $image): EncodedImage
{
try {
$builder = GifBuilder::canvas(
$image->width(),
$image->height()
);
foreach ($image as $frame) {
$builder->addFrame(
source: $this->encode($frame->toImage($image->driver()))->toFilePointer(),
delay: $frame->delay(),
interlaced: $this->interlaced
);
}
$builder->setLoops($image->loops());
return new EncodedImage($builder->encode(), 'image/gif');
} catch (Exception $e) {
throw new EncoderException($e->getMessage(), $e->getCode(), $e);
}
}
}
================================================
FILE: src/Drivers/Gd/Encoders/JpegEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\Encoders\JpegEncoder as GenericJpegEncoder;
use Intervention\Image\EncodedImage;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class JpegEncoder extends GenericJpegEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$blendingColor = $this->driver()->handleInput(
$this->driver()->config()->blendingColor
);
$output = Cloner::cloneBlended(
$image->core()->native(),
background: $blendingColor
);
return $this->createEncodedImage(function ($pointer) use ($output): void {
imageinterlace($output, $this->progressive);
imagejpeg($output, $pointer, $this->quality);
}, 'image/jpeg');
}
}
================================================
FILE: src/Drivers/Gd/Encoders/PngEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use GdImage;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\PngEncoder as GenericPngEncoder;
use Intervention\Image\Exceptions\AnimationException;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class PngEncoder extends GenericPngEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$output = $this->prepareOutput($image);
return $this->createEncodedImage(function ($pointer) use ($output): void {
imageinterlace($output, $this->interlaced);
imagepng($output, $pointer, -1);
}, 'image/png');
}
/**
* Prepare given image instance for PNG format output according to encoder settings
*
* @throws RuntimeException
* @throws ColorException
* @throws AnimationException
*/
private function prepareOutput(ImageInterface $image): GdImage
{
if ($this->indexed) {
$output = clone $image;
$output->reduceColors(255);
return $output->core()->native();
}
return Cloner::clone($image->core()->native());
}
}
================================================
FILE: src/Drivers/Gd/Encoders/WebpEncoder.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\WebpEncoder as GenericWebpEncoder;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
class WebpEncoder extends GenericWebpEncoder implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see EncoderInterface::encode()
*/
public function encode(ImageInterface $image): EncodedImage
{
$quality = $this->quality === 100 && defined('IMG_WEBP_LOSSLESS') ? IMG_WEBP_LOSSLESS : $this->quality;
return $this->createEncodedImage(function ($pointer) use ($image, $quality): void {
imagewebp($image->core()->native(), $pointer, $quality);
}, 'image/webp');
}
}
================================================
FILE: src/Drivers/Gd/FontProcessor.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd;
use Intervention\Image\Drivers\AbstractFontProcessor;
use Intervention\Image\Exceptions\FontException;
use Intervention\Image\Geometry\Point;
use Intervention\Image\Geometry\Rectangle;
use Intervention\Image\Interfaces\FontInterface;
use Intervention\Image\Interfaces\SizeInterface;
class FontProcessor extends AbstractFontProcessor
{
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::boxSize()
*/
public function boxSize(string $text, FontInterface $font): SizeInterface
{
// if the font has no ttf file the box size is calculated
// with gd's internal font system: integer values from 1-5
if (!$font->hasFilename()) {
// calculate box size from gd font
$box = new Rectangle(0, 0);
$chars = mb_strlen($text);
if ($chars > 0) {
$box->setWidth(
$chars * $this->gdCharacterWidth((int) $font->filename())
);
$box->setHeight(
$this->gdCharacterHeight((int) $font->filename())
);
}
return $box;
}
// build full path to font file to make sure to pass absolute path to imageftbbox()
// because of issues with different GD version behaving differently when passing
// relative paths to imageftbbox()
$fontPath = realpath($font->filename());
if ($fontPath === false) {
throw new FontException('Font file ' . $font->filename() . ' does not exist.');
}
// calculate box size from ttf font file with angle 0
$box = imageftbbox(
size: $this->nativeFontSize($font),
angle: 0,
font_filename: $fontPath,
string: $text,
);
if ($box === false) {
throw new FontException('Unable to calculate box size of font ' . $font->filename() . '.');
}
// build size from points
return new Rectangle(
width: intval(abs($box[6] - $box[4])), // difference of upper-left-x and upper-right-x
height: intval(abs($box[7] - $box[1])), // difference if upper-left-y and lower-left-y
pivot: new Point($box[6], $box[7]), // position of upper-left corner
);
}
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::nativeFontSize()
*/
public function nativeFontSize(FontInterface $font): float
{
return floatval(round($font->size() * .76, 6));
}
/**
* {@inheritdoc}
*
* @see FontProcessorInterface::leading()
*/
public function leading(FontInterface $font): int
{
return (int) round(parent::leading($font) * .8);
}
/**
* Return width of a single character
*/
protected function gdCharacterWidth(int $gdfont): int
{
return $gdfont + 4;
}
/**
* Return height of a single character
*/
protected function gdCharacterHeight(int $gdfont): int
{
return match ($gdfont) {
2, 3 => 14,
4, 5 => 16,
default => 8,
};
}
}
================================================
FILE: src/Drivers/Gd/Frame.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd;
use GdImage;
use Intervention\Image\Drivers\AbstractFrame;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Exceptions\InputException;
use Intervention\Image\Geometry\Rectangle;
use Intervention\Image\Image;
use Intervention\Image\Interfaces\DriverInterface;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SizeInterface;
class Frame extends AbstractFrame implements FrameInterface
{
/**
* Create new frame instance
*
* @return void
*/
public function __construct(
protected GdImage $native,
protected float $delay = 0,
protected int $dispose = 1,
protected int $offset_left = 0,
protected int $offset_top = 0
) {
//
}
/**
* {@inheritdoc}
*
* @see FrameInterface::toImage()
*/
public function toImage(DriverInterface $driver): ImageInterface
{
return new Image($driver, new Core([$this]));
}
/**
* {@inheritdoc}
*
* @see FrameInterface::setNative()
*/
public function setNative(mixed $native): FrameInterface
{
$this->native = $native;
return $this;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::native()
*/
public function native(): GdImage
{
return $this->native;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::size()
*/
public function size(): SizeInterface
{
return new Rectangle(imagesx($this->native), imagesy($this->native));
}
/**
* {@inheritdoc}
*
* @see FrameInterface::delay()
*/
public function delay(): float
{
return $this->delay;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::setDelay()
*/
public function setDelay(float $delay): FrameInterface
{
$this->delay = $delay;
return $this;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::dispose()
*/
public function dispose(): int
{
return $this->dispose;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::setDispose()
*
* @throws InputException
*/
public function setDispose(int $dispose): FrameInterface
{
if (!in_array($dispose, [0, 1, 2, 3])) {
throw new InputException('Value for argument $dispose must be 0, 1, 2 or 3.');
}
$this->dispose = $dispose;
return $this;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::setOffset()
*/
public function setOffset(int $left, int $top): FrameInterface
{
$this->offset_left = $left;
$this->offset_top = $top;
return $this;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::offsetLeft()
*/
public function offsetLeft(): int
{
return $this->offset_left;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::setOffsetLeft()
*/
public function setOffsetLeft(int $offset): FrameInterface
{
$this->offset_left = $offset;
return $this;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::offsetTop()
*/
public function offsetTop(): int
{
return $this->offset_top;
}
/**
* {@inheritdoc}
*
* @see FrameInterface::setOffsetTop()
*/
public function setOffsetTop(int $offset): FrameInterface
{
$this->offset_top = $offset;
return $this;
}
/**
* This workaround helps cloning GdImages which is currently not possible.
*
* @throws ColorException
*/
public function __clone(): void
{
$this->native = Cloner::clone($this->native);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/AlignRotationModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\AlignRotationModifier as GenericAlignRotationModifier;
class AlignRotationModifier extends GenericAlignRotationModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$image = match ($image->exif('IFD0.Orientation')) {
2 => $image->flop(),
3 => $image->rotate(180),
4 => $image->rotate(180)->flop(),
5 => $image->rotate(270)->flop(),
6 => $image->rotate(270),
7 => $image->rotate(90)->flop(),
8 => $image->rotate(90),
default => $image
};
return $this->markAligned($image);
}
/**
* Set exif data of image to top-left orientation, marking the image as
* aligned and making sure the rotation correction process is not
* performed again.
*/
private function markAligned(ImageInterface $image): ImageInterface
{
$exif = $image->exif()->map(function ($item) {
if (is_array($item) && array_key_exists('Orientation', $item)) {
$item['Orientation'] = 1;
return $item;
}
return $item;
});
return $image->setExif($exif);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\BlendTransparencyModifier as GenericBlendTransparencyModifier;
class BlendTransparencyModifier extends GenericBlendTransparencyModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$blendingColor = $this->blendingColor($this->driver());
foreach ($image as $frame) {
// create new canvas with blending color as background
$modified = Cloner::cloneBlended(
$frame->native(),
background: $blendingColor
);
// set new gd image
$frame->setNative($modified);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/BlurModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\BlurModifier as GenericBlurModifier;
class BlurModifier extends GenericBlurModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
for ($i = 0; $i < $this->amount; $i++) {
imagefilter($frame->native(), IMG_FILTER_GAUSSIAN_BLUR);
}
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/BrightnessModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\BrightnessModifier as GenericBrightnessModifier;
class BrightnessModifier extends GenericBrightnessModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imagefilter($frame->native(), IMG_FILTER_BRIGHTNESS, intval($this->level * 2.55));
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/ColorizeModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\ColorizeModifier as GenericColorizeModifier;
class ColorizeModifier extends GenericColorizeModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
// normalize colorize levels
$red = (int) round($this->red * 2.55);
$green = (int) round($this->green * 2.55);
$blue = (int) round($this->blue * 2.55);
foreach ($image as $frame) {
imagefilter($frame->native(), IMG_FILTER_COLORIZE, $red, $green, $blue);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/ColorspaceModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Colors\Rgb\Colorspace as RgbColorspace;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\ColorspaceModifier as GenericColorspaceModifier;
class ColorspaceModifier extends GenericColorspaceModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
if (!($this->targetColorspace() instanceof RgbColorspace)) {
throw new NotSupportedException(
'Only RGB colorspace is supported by GD driver.'
);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/ContainModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SizeInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\ContainModifier as GenericContainModifier;
class ContainModifier extends GenericContainModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$crop = $this->getCropSize($image);
$resize = $this->getResizeSize($image);
$background = $this->driver()->handleInput($this->background);
$blendingColor = $this->driver()->handleInput(
$this->driver()->config()->blendingColor
);
foreach ($image as $frame) {
$this->modify($frame, $crop, $resize, $background, $blendingColor);
}
return $image;
}
/**
* @throws ColorException
*/
protected function modify(
FrameInterface $frame,
SizeInterface $crop,
SizeInterface $resize,
ColorInterface $background,
ColorInterface $blendingColor
): void {
// create new gd image
$modified = Cloner::cloneEmpty($frame->native(), $resize, $background);
// make image area transparent to keep transparency
// even if background-color is set
$transparent = imagecolorallocatealpha(
$modified,
$blendingColor->channel(Red::class)->value(),
$blendingColor->channel(Green::class)->value(),
$blendingColor->channel(Blue::class)->value(),
127,
);
imagealphablending($modified, false); // do not blend / just overwrite
imagecolortransparent($modified, $transparent);
imagefilledrectangle(
$modified,
$crop->pivot()->x(),
$crop->pivot()->y(),
$crop->pivot()->x() + $crop->width() - 1,
$crop->pivot()->y() + $crop->height() - 1,
$transparent
);
// copy image from original with blending alpha
imagealphablending($modified, true);
imagecopyresampled(
$modified,
$frame->native(),
$crop->pivot()->x(),
$crop->pivot()->y(),
0,
0,
$crop->width(),
$crop->height(),
$frame->size()->width(),
$frame->size()->height()
);
// set new content as resource
$frame->setNative($modified);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/ContrastModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\ContrastModifier as GenericContrastModifier;
class ContrastModifier extends GenericContrastModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imagefilter($frame->native(), IMG_FILTER_CONTRAST, ($this->level * -1));
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/CoverDownModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Exceptions\GeometryException;
use Intervention\Image\Interfaces\SizeInterface;
class CoverDownModifier extends CoverModifier
{
/**
* @throws GeometryException
*/
public function getResizeSize(SizeInterface $size): SizeInterface
{
return $size->resizeDown($this->width, $this->height);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/CoverModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SizeInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\CoverModifier as GenericCoverModifier;
class CoverModifier extends GenericCoverModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$crop = $this->getCropSize($image);
$resize = $this->getResizeSize($crop);
foreach ($image as $frame) {
$this->modifyFrame($frame, $crop, $resize);
}
return $image;
}
/**
* @throws ColorException
*/
protected function modifyFrame(FrameInterface $frame, SizeInterface $crop, SizeInterface $resize): void
{
// create new image
$modified = Cloner::cloneEmpty($frame->native(), $resize);
// copy content from resource
imagecopyresampled(
$modified,
$frame->native(),
0,
0,
$crop->pivot()->x(),
$crop->pivot()->y(),
$resize->width(),
$resize->height(),
$crop->width(),
$crop->height()
);
// set new content as resource
$frame->setNative($modified);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/CropModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SizeInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\CropModifier as GenericCropModifier;
class CropModifier extends GenericCropModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$originalSize = $image->size();
$crop = $this->crop($image);
$background = $this->driver()->handleInput($this->background);
foreach ($image as $frame) {
$this->cropFrame($frame, $originalSize, $crop, $background);
}
return $image;
}
/**
* @throws ColorException
*/
protected function cropFrame(
FrameInterface $frame,
SizeInterface $originalSize,
SizeInterface $resizeTo,
ColorInterface $background
): void {
// create new image with transparent background
$modified = Cloner::cloneEmpty($frame->native(), $resizeTo, $background);
// define offset
$offset_x = $resizeTo->pivot()->x() + $this->offset_x;
$offset_y = $resizeTo->pivot()->y() + $this->offset_y;
// define target width & height
$targetWidth = min($resizeTo->width(), $originalSize->width());
$targetHeight = min($resizeTo->height(), $originalSize->height());
$targetWidth = $targetWidth < $originalSize->width() ? $targetWidth + $offset_x : $targetWidth;
$targetHeight = $targetHeight < $originalSize->height() ? $targetHeight + $offset_y : $targetHeight;
// don't alpha blend for copy operation to keep transparent areas of original image
imagealphablending($modified, false);
// copy content from resource
imagecopyresampled(
$modified,
$frame->native(),
$offset_x * -1,
$offset_y * -1,
0,
0,
$targetWidth,
$targetHeight,
$targetWidth,
$targetHeight
);
// set new content as resource
$frame->setNative($modified);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/DrawBezierModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use RuntimeException;
use Intervention\Image\Exceptions\GeometryException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\DrawBezierModifier as GenericDrawBezierModifier;
class DrawBezierModifier extends GenericDrawBezierModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*
* @throws RuntimeException
* @throws GeometryException
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
if ($this->drawable->count() !== 3 && $this->drawable->count() !== 4) {
throw new GeometryException('You must specify either 3 or 4 points to create a bezier curve');
}
[$polygon, $polygon_border_segments] = $this->calculateBezierPoints();
if ($this->drawable->hasBackgroundColor() || $this->drawable->hasBorder()) {
imagealphablending($frame->native(), true);
imageantialias($frame->native(), true);
}
if ($this->drawable->hasBackgroundColor()) {
$background_color = $this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->backgroundColor()
);
imagesetthickness($frame->native(), 0);
imagefilledpolygon(
$frame->native(),
$polygon,
$background_color
);
}
if ($this->drawable->hasBorder() && $this->drawable->borderSize() > 0) {
$border_color = $this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->borderColor()
);
if ($this->drawable->borderSize() === 1) {
imagesetthickness($frame->native(), $this->drawable->borderSize());
$count = count($polygon);
for ($i = 0; $i < $count; $i += 2) {
if (array_key_exists($i + 2, $polygon) && array_key_exists($i + 3, $polygon)) {
imageline(
$frame->native(),
$polygon[$i],
$polygon[$i + 1],
$polygon[$i + 2],
$polygon[$i + 3],
$border_color
);
}
}
} else {
$polygon_border_segments_total = count($polygon_border_segments);
for ($i = 0; $i < $polygon_border_segments_total; $i += 1) {
imagefilledpolygon(
$frame->native(),
$polygon_border_segments[$i],
$border_color
);
}
}
}
}
return $image;
}
/**
* Calculate interpolation points for quadratic beziers using the Bernstein polynomial form
*
* @return array{'x': float, 'y': float}
*/
private function calculateQuadraticBezierInterpolationPoint(float $t = 0.05): array
{
$remainder = 1 - $t;
$control_point_1_multiplier = $remainder * $remainder;
$control_point_2_multiplier = $remainder * $t * 2;
$control_point_3_multiplier = $t * $t;
$x = (
$this->drawable->first()->x() * $control_point_1_multiplier +
$this->drawable->second()->x() * $control_point_2_multiplier +
$this->drawable->last()->x() * $control_point_3_multiplier
);
$y = (
$this->drawable->first()->y() * $control_point_1_multiplier +
$this->drawable->second()->y() * $control_point_2_multiplier +
$this->drawable->last()->y() * $control_point_3_multiplier
);
return ['x' => $x, 'y' => $y];
}
/**
* Calculate interpolation points for cubic beziers using the Bernstein polynomial form
*
* @return array{'x': float, 'y': float}
*/
private function calculateCubicBezierInterpolationPoint(float $t = 0.05): array
{
$remainder = 1 - $t;
$t_squared = $t * $t;
$remainder_squared = $remainder * $remainder;
$control_point_1_multiplier = $remainder_squared * $remainder;
$control_point_2_multiplier = $remainder_squared * $t * 3;
$control_point_3_multiplier = $t_squared * $remainder * 3;
$control_point_4_multiplier = $t_squared * $t;
$x = (
$this->drawable->first()->x() * $control_point_1_multiplier +
$this->drawable->second()->x() * $control_point_2_multiplier +
$this->drawable->third()->x() * $control_point_3_multiplier +
$this->drawable->last()->x() * $control_point_4_multiplier
);
$y = (
$this->drawable->first()->y() * $control_point_1_multiplier +
$this->drawable->second()->y() * $control_point_2_multiplier +
$this->drawable->third()->y() * $control_point_3_multiplier +
$this->drawable->last()->y() * $control_point_4_multiplier
);
return ['x' => $x, 'y' => $y];
}
/**
* Calculate the points needed to draw a quadratic or cubic bezier with optional border/stroke
*
* @throws GeometryException
* @return array{0: array<mixed>, 1: array<mixed>}
*/
private function calculateBezierPoints(): array
{
if ($this->drawable->count() !== 3 && $this->drawable->count() !== 4) {
throw new GeometryException('You must specify either 3 or 4 points to create a bezier curve');
}
$polygon = [];
$inner_polygon = [];
$outer_polygon = [];
$polygon_border_segments = [];
// define ratio t; equivalent to 5 percent distance along edge
$t = 0.05;
$polygon[] = $this->drawable->first()->x();
$polygon[] = $this->drawable->first()->y();
for ($i = $t; $i < 1; $i += $t) {
if ($this->drawable->count() === 3) {
$ip = $this->calculateQuadraticBezierInterpolationPoint($i);
} elseif ($this->drawable->count() === 4) {
$ip = $this->calculateCubicBezierInterpolationPoint($i);
}
$polygon[] = (int) $ip['x'];
$polygon[] = (int) $ip['y'];
}
$polygon[] = $this->drawable->last()->x();
$polygon[] = $this->drawable->last()->y();
if ($this->drawable->hasBorder() && $this->drawable->borderSize() > 1) {
// create the border/stroke effect by calculating two new curves with offset positions
// from the main polygon and then connecting the inner/outer curves to create separate
// 4-point polygon segments
$polygon_total_points = count($polygon);
$offset = ($this->drawable->borderSize() / 2);
for ($i = 0; $i < $polygon_total_points; $i += 2) {
if (array_key_exists($i + 2, $polygon) && array_key_exists($i + 3, $polygon)) {
$dx = $polygon[$i + 2] - $polygon[$i];
$dy = $polygon[$i + 3] - $polygon[$i + 1];
$dxy_sqrt = ($dx * $dx + $dy * $dy) ** 0.5;
// inner polygon
$scale = $offset / $dxy_sqrt;
$ox = -$dy * $scale;
$oy = $dx * $scale;
$inner_polygon[] = $ox + $polygon[$i];
$inner_polygon[] = $oy + $polygon[$i + 1];
$inner_polygon[] = $ox + $polygon[$i + 2];
$inner_polygon[] = $oy + $polygon[$i + 3];
// outer polygon
$scale = -$offset / $dxy_sqrt;
$ox = -$dy * $scale;
$oy = $dx * $scale;
$outer_polygon[] = $ox + $polygon[$i];
$outer_polygon[] = $oy + $polygon[$i + 1];
$outer_polygon[] = $ox + $polygon[$i + 2];
$outer_polygon[] = $oy + $polygon[$i + 3];
}
}
$inner_polygon_total_points = count($inner_polygon);
for ($i = 0; $i < $inner_polygon_total_points; $i += 2) {
if (array_key_exists($i + 2, $inner_polygon) && array_key_exists($i + 3, $inner_polygon)) {
$polygon_border_segments[] = [
$inner_polygon[$i],
$inner_polygon[$i + 1],
$outer_polygon[$i],
$outer_polygon[$i + 1],
$outer_polygon[$i + 2],
$outer_polygon[$i + 3],
$inner_polygon[$i + 2],
$inner_polygon[$i + 3],
];
}
}
}
return [$polygon, $polygon_border_segments];
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/DrawEllipseModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\DrawEllipseModifier as GenericDrawEllipseModifier;
class DrawEllipseModifier extends GenericDrawEllipseModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*
* @throws RuntimeException
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
if ($this->drawable->hasBorder()) {
imagealphablending($frame->native(), true);
// slightly smaller ellipse to keep 1px bordered edges clean
if ($this->drawable->hasBackgroundColor()) {
imagefilledellipse(
$frame->native(),
$this->drawable()->position()->x(),
$this->drawable->position()->y(),
$this->drawable->width() - 1,
$this->drawable->height() - 1,
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->backgroundColor()
)
);
}
// gd's imageellipse ignores imagesetthickness
// so i use imagearc with 360 degrees instead.
imagesetthickness(
$frame->native(),
$this->drawable->borderSize(),
);
imagearc(
$frame->native(),
$this->drawable()->position()->x(),
$this->drawable()->position()->y(),
$this->drawable->width(),
$this->drawable->height(),
0,
360,
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->borderColor()
)
);
} else {
imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), 0);
imagefilledellipse(
$frame->native(),
$this->drawable()->position()->x(),
$this->drawable()->position()->y(),
$this->drawable->width(),
$this->drawable->height(),
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->backgroundColor()
)
);
}
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/DrawLineModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\DrawLineModifier as GenericDrawLineModifier;
class DrawLineModifier extends GenericDrawLineModifier implements SpecializedInterface
{
/**
* @throws RuntimeException
*/
public function apply(ImageInterface $image): ImageInterface
{
$color = $this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->backgroundColor()
);
foreach ($image as $frame) {
imagealphablending($frame->native(), true);
imageantialias($frame->native(), true);
imagesetthickness($frame->native(), $this->drawable->width());
imageline(
$frame->native(),
$this->drawable->start()->x(),
$this->drawable->start()->y(),
$this->drawable->end()->x(),
$this->drawable->end()->y(),
$color
);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/DrawPixelModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\DrawPixelModifier as GenericDrawPixelModifier;
class DrawPixelModifier extends GenericDrawPixelModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$color = $this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->driver()->handleInput($this->color)
);
foreach ($image as $frame) {
imagealphablending($frame->native(), true);
imagesetpixel(
$frame->native(),
$this->position->x(),
$this->position->y(),
$color
);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/DrawPolygonModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\DrawPolygonModifier as ModifiersDrawPolygonModifier;
class DrawPolygonModifier extends ModifiersDrawPolygonModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*
* @throws RuntimeException
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
if ($this->drawable->hasBackgroundColor()) {
imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), 0);
imagefilledpolygon(
$frame->native(),
$this->drawable->toArray(),
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->backgroundColor()
)
);
}
if ($this->drawable->hasBorder()) {
imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), $this->drawable->borderSize());
imagepolygon(
$frame->native(),
$this->drawable->toArray(),
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->borderColor()
)
);
}
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/DrawRectangleModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use RuntimeException;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\DrawRectangleModifier as GenericDrawRectangleModifier;
class DrawRectangleModifier extends GenericDrawRectangleModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*
* @throws RuntimeException
*/
public function apply(ImageInterface $image): ImageInterface
{
$position = $this->drawable->position();
foreach ($image as $frame) {
// draw background
if ($this->drawable->hasBackgroundColor()) {
imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), 0);
imagefilledrectangle(
$frame->native(),
$position->x(),
$position->y(),
$position->x() + $this->drawable->width(),
$position->y() + $this->drawable->height(),
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->backgroundColor()
)
);
}
// draw border
if ($this->drawable->hasBorder()) {
imagealphablending($frame->native(), true);
imagesetthickness($frame->native(), $this->drawable->borderSize());
imagerectangle(
$frame->native(),
$position->x(),
$position->y(),
$position->x() + $this->drawable->width(),
$position->y() + $this->drawable->height(),
$this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->borderColor()
)
);
}
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/FillModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\FillModifier as GenericFillModifier;
class FillModifier extends GenericFillModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$color = $this->color($image);
foreach ($image as $frame) {
if ($this->hasPosition()) {
$this->floodFillWithColor($frame, $color);
} else {
$this->fillAllWithColor($frame, $color);
}
}
return $image;
}
/**
* @throws RuntimeException
*/
private function color(ImageInterface $image): int
{
return $this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->driver()->handleInput($this->color)
);
}
private function floodFillWithColor(FrameInterface $frame, int $color): void
{
imagefill(
$frame->native(),
$this->position->x(),
$this->position->y(),
$color
);
}
private function fillAllWithColor(FrameInterface $frame, int $color): void
{
imagealphablending($frame->native(), true);
imagefilledrectangle(
$frame->native(),
0,
0,
$frame->size()->width() - 1,
$frame->size()->height() - 1,
$color
);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/FlipModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\FlipModifier as GenericFlipModifier;
class FlipModifier extends GenericFlipModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imageflip($frame->native(), IMG_FLIP_VERTICAL);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/FlopModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\FlopModifier as GenericFlopModifier;
class FlopModifier extends GenericFlopModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imageflip($frame->native(), IMG_FLIP_HORIZONTAL);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/GammaModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\GammaModifier as GenericGammaModifier;
class GammaModifier extends GenericGammaModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imagegammacorrect($frame->native(), 1, $this->gamma);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/GreyscaleModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\GreyscaleModifier as GenericGreyscaleModifier;
class GreyscaleModifier extends GenericGreyscaleModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imagefilter($frame->native(), IMG_FILTER_GRAYSCALE);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/InvertModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\InvertModifier as GenericInvertModifier;
class InvertModifier extends GenericInvertModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imagefilter($frame->native(), IMG_FILTER_NEGATE);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/PadModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SizeInterface;
class PadModifier extends ContainModifier
{
public function getCropSize(ImageInterface $image): SizeInterface
{
return $image->size()
->containMax(
$this->width,
$this->height
)
->alignPivotTo(
$this->getResizeSize($image),
$this->position
);
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/PixelateModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\PixelateModifier as GenericPixelateModifier;
class PixelateModifier extends GenericPixelateModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
foreach ($image as $frame) {
imagefilter($frame->native(), IMG_FILTER_PIXELATE, $this->size, true);
}
return $image;
}
}
================================================
FILE: src/Drivers/Gd/Modifiers/PlaceModifier.php
================================================
<?php
declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Modifiers;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\PointInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\Modifiers\PlaceModifier as GenericPlaceModifier;
class PlaceModifier extends GenericPlaceModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$watermark = $this->driver()->handleInput($this->element);
$position = $this->getPosition($image, $watermark);
foreach ($image as $frame) {
imagealphablending($frame->native(), true);
if ($this->opacity === 100) {
$this->placeOpaque($frame, $watermark, $position);
} else {
$this->placeTransparent($frame, $watermark, $position);
}
}
return $image;
}
/**
* Insert watermark with 100% opacity
*
* @throws RuntimeException
*/
private function placeOpaque(FrameInterface $frame, ImageInterface $watermark, PointInterface $position): void
{
imagecopy(
$frame->native(),
$watermark->core()->native(),
$position->x(),
$position->y(),
0,
0,
$watermark->width(),
$watermark->height()
);
}
/**
* Insert watermark transparent with current opacity
*
* Unfortunately, the original PHP function imagecopymerge does not work reliably.
* For example, any transparency of the image to be inserted is not applied correctly.
* For this reason, a new GDImage is created into which the original image is inserted
* in the first step and the watermark is inserted with 100% opacity in the second
* step. This combination is then transferred to the original image again with the
* respective opacity.
*
* Please note: Unfortunately, there is still an edge case, when a transparent image
* is placed on a transparent background, the "double" transparent areas appear opaque!
*
* @throws RuntimeException
*/
private function placeTransparent(FrameInterface $frame, ImageInterface $watermark, PointInterface $position
gitextract_zeq9zksh/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows/
│ └── run-tests.yml
├── .gitignore
├── .well-known/
│ └── funding-manifest-urls
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── composer.json
├── docker-compose.yml
├── phpcs.xml.dist
├── phpstan.dist.neon
├── phpunit.dist.xml
├── readme.md
├── src/
│ ├── Analyzers/
│ │ ├── ColorspaceAnalyzer.php
│ │ ├── HeightAnalyzer.php
│ │ ├── PixelColorAnalyzer.php
│ │ ├── PixelColorsAnalyzer.php
│ │ ├── ProfileAnalyzer.php
│ │ ├── ResolutionAnalyzer.php
│ │ └── WidthAnalyzer.php
│ ├── Collection.php
│ ├── Colors/
│ │ ├── AbstractColor.php
│ │ ├── AbstractColorChannel.php
│ │ ├── Cmyk/
│ │ │ ├── Channels/
│ │ │ │ ├── Cyan.php
│ │ │ │ ├── Key.php
│ │ │ │ ├── Magenta.php
│ │ │ │ └── Yellow.php
│ │ │ ├── Color.php
│ │ │ ├── Colorspace.php
│ │ │ └── Decoders/
│ │ │ └── StringColorDecoder.php
│ │ ├── Hsl/
│ │ │ ├── Channels/
│ │ │ │ ├── Hue.php
│ │ │ │ ├── Luminance.php
│ │ │ │ └── Saturation.php
│ │ │ ├── Color.php
│ │ │ ├── Colorspace.php
│ │ │ └── Decoders/
│ │ │ └── StringColorDecoder.php
│ │ ├── Hsv/
│ │ │ ├── Channels/
│ │ │ │ ├── Hue.php
│ │ │ │ ├── Saturation.php
│ │ │ │ └── Value.php
│ │ │ ├── Color.php
│ │ │ ├── Colorspace.php
│ │ │ └── Decoders/
│ │ │ └── StringColorDecoder.php
│ │ ├── Profile.php
│ │ └── Rgb/
│ │ ├── Channels/
│ │ │ ├── Alpha.php
│ │ │ ├── Blue.php
│ │ │ ├── Green.php
│ │ │ └── Red.php
│ │ ├── Color.php
│ │ ├── Colorspace.php
│ │ └── Decoders/
│ │ ├── HexColorDecoder.php
│ │ ├── HtmlColornameDecoder.php
│ │ ├── StringColorDecoder.php
│ │ └── TransparentColorDecoder.php
│ ├── Config.php
│ ├── Decoders/
│ │ ├── Base64ImageDecoder.php
│ │ ├── BinaryImageDecoder.php
│ │ ├── ColorObjectDecoder.php
│ │ ├── DataUriImageDecoder.php
│ │ ├── EncodedImageObjectDecoder.php
│ │ ├── FilePathImageDecoder.php
│ │ ├── FilePointerImageDecoder.php
│ │ ├── ImageObjectDecoder.php
│ │ ├── NativeObjectDecoder.php
│ │ └── SplFileInfoImageDecoder.php
│ ├── Drivers/
│ │ ├── AbstractDecoder.php
│ │ ├── AbstractDriver.php
│ │ ├── AbstractEncoder.php
│ │ ├── AbstractFontProcessor.php
│ │ ├── AbstractFrame.php
│ │ ├── Gd/
│ │ │ ├── Analyzers/
│ │ │ │ ├── ColorspaceAnalyzer.php
│ │ │ │ ├── HeightAnalyzer.php
│ │ │ │ ├── PixelColorAnalyzer.php
│ │ │ │ ├── PixelColorsAnalyzer.php
│ │ │ │ ├── ResolutionAnalyzer.php
│ │ │ │ └── WidthAnalyzer.php
│ │ │ ├── Cloner.php
│ │ │ ├── ColorProcessor.php
│ │ │ ├── Core.php
│ │ │ ├── Decoders/
│ │ │ │ ├── AbstractDecoder.php
│ │ │ │ ├── Base64ImageDecoder.php
│ │ │ │ ├── BinaryImageDecoder.php
│ │ │ │ ├── DataUriImageDecoder.php
│ │ │ │ ├── EncodedImageObjectDecoder.php
│ │ │ │ ├── FilePathImageDecoder.php
│ │ │ │ ├── FilePointerImageDecoder.php
│ │ │ │ ├── NativeObjectDecoder.php
│ │ │ │ └── SplFileInfoImageDecoder.php
│ │ │ ├── Driver.php
│ │ │ ├── Encoders/
│ │ │ │ ├── AvifEncoder.php
│ │ │ │ ├── BmpEncoder.php
│ │ │ │ ├── GifEncoder.php
│ │ │ │ ├── JpegEncoder.php
│ │ │ │ ├── PngEncoder.php
│ │ │ │ └── WebpEncoder.php
│ │ │ ├── FontProcessor.php
│ │ │ ├── Frame.php
│ │ │ └── Modifiers/
│ │ │ ├── AlignRotationModifier.php
│ │ │ ├── BlendTransparencyModifier.php
│ │ │ ├── BlurModifier.php
│ │ │ ├── BrightnessModifier.php
│ │ │ ├── ColorizeModifier.php
│ │ │ ├── ColorspaceModifier.php
│ │ │ ├── ContainModifier.php
│ │ │ ├── ContrastModifier.php
│ │ │ ├── CoverDownModifier.php
│ │ │ ├── CoverModifier.php
│ │ │ ├── CropModifier.php
│ │ │ ├── DrawBezierModifier.php
│ │ │ ├── DrawEllipseModifier.php
│ │ │ ├── DrawLineModifier.php
│ │ │ ├── DrawPixelModifier.php
│ │ │ ├── DrawPolygonModifier.php
│ │ │ ├── DrawRectangleModifier.php
│ │ │ ├── FillModifier.php
│ │ │ ├── FlipModifier.php
│ │ │ ├── FlopModifier.php
│ │ │ ├── GammaModifier.php
│ │ │ ├── GreyscaleModifier.php
│ │ │ ├── InvertModifier.php
│ │ │ ├── PadModifier.php
│ │ │ ├── PixelateModifier.php
│ │ │ ├── PlaceModifier.php
│ │ │ ├── ProfileModifier.php
│ │ │ ├── ProfileRemovalModifier.php
│ │ │ ├── QuantizeColorsModifier.php
│ │ │ ├── RemoveAnimationModifier.php
│ │ │ ├── ResizeCanvasModifier.php
│ │ │ ├── ResizeCanvasRelativeModifier.php
│ │ │ ├── ResizeDownModifier.php
│ │ │ ├── ResizeModifier.php
│ │ │ ├── ResolutionModifier.php
│ │ │ ├── RotateModifier.php
│ │ │ ├── ScaleDownModifier.php
│ │ │ ├── ScaleModifier.php
│ │ │ ├── SharpenModifier.php
│ │ │ ├── SliceAnimationModifier.php
│ │ │ ├── TextModifier.php
│ │ │ └── TrimModifier.php
│ │ ├── Imagick/
│ │ │ ├── Analyzers/
│ │ │ │ ├── ColorspaceAnalyzer.php
│ │ │ │ ├── HeightAnalyzer.php
│ │ │ │ ├── PixelColorAnalyzer.php
│ │ │ │ ├── PixelColorsAnalyzer.php
│ │ │ │ ├── ProfileAnalyzer.php
│ │ │ │ ├── ResolutionAnalyzer.php
│ │ │ │ └── WidthAnalyzer.php
│ │ │ ├── ColorProcessor.php
│ │ │ ├── Core.php
│ │ │ ├── Decoders/
│ │ │ │ ├── Base64ImageDecoder.php
│ │ │ │ ├── BinaryImageDecoder.php
│ │ │ │ ├── DataUriImageDecoder.php
│ │ │ │ ├── EncodedImageObjectDecoder.php
│ │ │ │ ├── FilePathImageDecoder.php
│ │ │ │ ├── FilePointerImageDecoder.php
│ │ │ │ ├── NativeObjectDecoder.php
│ │ │ │ └── SplFileInfoImageDecoder.php
│ │ │ ├── Driver.php
│ │ │ ├── Encoders/
│ │ │ │ ├── AvifEncoder.php
│ │ │ │ ├── BmpEncoder.php
│ │ │ │ ├── GifEncoder.php
│ │ │ │ ├── HeicEncoder.php
│ │ │ │ ├── Jpeg2000Encoder.php
│ │ │ │ ├── JpegEncoder.php
│ │ │ │ ├── PngEncoder.php
│ │ │ │ ├── TiffEncoder.php
│ │ │ │ └── WebpEncoder.php
│ │ │ ├── FontProcessor.php
│ │ │ ├── Frame.php
│ │ │ └── Modifiers/
│ │ │ ├── AlignRotationModifier.php
│ │ │ ├── BlendTransparencyModifier.php
│ │ │ ├── BlurModifier.php
│ │ │ ├── BrightnessModifier.php
│ │ │ ├── ColorizeModifier.php
│ │ │ ├── ColorspaceModifier.php
│ │ │ ├── ContainModifier.php
│ │ │ ├── ContrastModifier.php
│ │ │ ├── CoverDownModifier.php
│ │ │ ├── CoverModifier.php
│ │ │ ├── CropModifier.php
│ │ │ ├── DrawBezierModifier.php
│ │ │ ├── DrawEllipseModifier.php
│ │ │ ├── DrawLineModifier.php
│ │ │ ├── DrawPixelModifier.php
│ │ │ ├── DrawPolygonModifier.php
│ │ │ ├── DrawRectangleModifier.php
│ │ │ ├── FillModifier.php
│ │ │ ├── FlipModifier.php
│ │ │ ├── FlopModifier.php
│ │ │ ├── GammaModifier.php
│ │ │ ├── GreyscaleModifier.php
│ │ │ ├── InvertModifier.php
│ │ │ ├── PadModifier.php
│ │ │ ├── PixelateModifier.php
│ │ │ ├── PlaceModifier.php
│ │ │ ├── ProfileModifier.php
│ │ │ ├── ProfileRemovalModifier.php
│ │ │ ├── QuantizeColorsModifier.php
│ │ │ ├── RemoveAnimationModifier.php
│ │ │ ├── ResizeCanvasModifier.php
│ │ │ ├── ResizeCanvasRelativeModifier.php
│ │ │ ├── ResizeDownModifier.php
│ │ │ ├── ResizeModifier.php
│ │ │ ├── ResolutionModifier.php
│ │ │ ├── RotateModifier.php
│ │ │ ├── ScaleDownModifier.php
│ │ │ ├── ScaleModifier.php
│ │ │ ├── SharpenModifier.php
│ │ │ ├── SliceAnimationModifier.php
│ │ │ ├── StripMetaModifier.php
│ │ │ ├── TextModifier.php
│ │ │ └── TrimModifier.php
│ │ ├── Specializable.php
│ │ ├── SpecializableAnalyzer.php
│ │ ├── SpecializableDecoder.php
│ │ ├── SpecializableEncoder.php
│ │ └── SpecializableModifier.php
│ ├── EncodedImage.php
│ ├── Encoders/
│ │ ├── AutoEncoder.php
│ │ ├── AvifEncoder.php
│ │ ├── BmpEncoder.php
│ │ ├── FileExtensionEncoder.php
│ │ ├── FilePathEncoder.php
│ │ ├── GifEncoder.php
│ │ ├── HeicEncoder.php
│ │ ├── Jpeg2000Encoder.php
│ │ ├── JpegEncoder.php
│ │ ├── MediaTypeEncoder.php
│ │ ├── PngEncoder.php
│ │ ├── TiffEncoder.php
│ │ └── WebpEncoder.php
│ ├── Exceptions/
│ │ ├── AnimationException.php
│ │ ├── ColorException.php
│ │ ├── DecoderException.php
│ │ ├── DriverException.php
│ │ ├── EncoderException.php
│ │ ├── FontException.php
│ │ ├── GeometryException.php
│ │ ├── InputException.php
│ │ ├── NotSupportedException.php
│ │ ├── NotWritableException.php
│ │ └── RuntimeException.php
│ ├── File.php
│ ├── FileExtension.php
│ ├── Format.php
│ ├── Geometry/
│ │ ├── Bezier.php
│ │ ├── Circle.php
│ │ ├── Ellipse.php
│ │ ├── Factories/
│ │ │ ├── BezierFactory.php
│ │ │ ├── CircleFactory.php
│ │ │ ├── Drawable.php
│ │ │ ├── EllipseFactory.php
│ │ │ ├── LineFactory.php
│ │ │ ├── PolygonFactory.php
│ │ │ └── RectangleFactory.php
│ │ ├── Line.php
│ │ ├── Pixel.php
│ │ ├── Point.php
│ │ ├── Polygon.php
│ │ ├── Rectangle.php
│ │ ├── Tools/
│ │ │ └── RectangleResizer.php
│ │ └── Traits/
│ │ ├── HasBackgroundColor.php
│ │ └── HasBorder.php
│ ├── Image.php
│ ├── ImageManager.php
│ ├── InputHandler.php
│ ├── Interfaces/
│ │ ├── AnalyzerInterface.php
│ │ ├── CollectionInterface.php
│ │ ├── ColorChannelInterface.php
│ │ ├── ColorInterface.php
│ │ ├── ColorProcessorInterface.php
│ │ ├── ColorspaceInterface.php
│ │ ├── CoreInterface.php
│ │ ├── DecoderInterface.php
│ │ ├── DrawableFactoryInterface.php
│ │ ├── DrawableInterface.php
│ │ ├── DriverInterface.php
│ │ ├── EncodedImageInterface.php
│ │ ├── EncoderInterface.php
│ │ ├── FileInterface.php
│ │ ├── FontInterface.php
│ │ ├── FontProcessorInterface.php
│ │ ├── FrameInterface.php
│ │ ├── ImageInterface.php
│ │ ├── ImageManagerInterface.php
│ │ ├── InputHandlerInterface.php
│ │ ├── ModifierInterface.php
│ │ ├── PointInterface.php
│ │ ├── ProfileInterface.php
│ │ ├── ResolutionInterface.php
│ │ ├── SizeInterface.php
│ │ ├── SpecializableInterface.php
│ │ └── SpecializedInterface.php
│ ├── MediaType.php
│ ├── ModifierStack.php
│ ├── Modifiers/
│ │ ├── AbstractDrawModifier.php
│ │ ├── AlignRotationModifier.php
│ │ ├── BlendTransparencyModifier.php
│ │ ├── BlurModifier.php
│ │ ├── BrightnessModifier.php
│ │ ├── ColorizeModifier.php
│ │ ├── ColorspaceModifier.php
│ │ ├── ContainModifier.php
│ │ ├── ContrastModifier.php
│ │ ├── CoverDownModifier.php
│ │ ├── CoverModifier.php
│ │ ├── CropModifier.php
│ │ ├── DrawBezierModifier.php
│ │ ├── DrawEllipseModifier.php
│ │ ├── DrawLineModifier.php
│ │ ├── DrawPixelModifier.php
│ │ ├── DrawPolygonModifier.php
│ │ ├── DrawRectangleModifier.php
│ │ ├── FillModifier.php
│ │ ├── FlipModifier.php
│ │ ├── FlopModifier.php
│ │ ├── GammaModifier.php
│ │ ├── GreyscaleModifier.php
│ │ ├── InvertModifier.php
│ │ ├── PadModifier.php
│ │ ├── PixelateModifier.php
│ │ ├── PlaceModifier.php
│ │ ├── ProfileModifier.php
│ │ ├── ProfileRemovalModifier.php
│ │ ├── QuantizeColorsModifier.php
│ │ ├── RemoveAnimationModifier.php
│ │ ├── ResizeCanvasModifier.php
│ │ ├── ResizeCanvasRelativeModifier.php
│ │ ├── ResizeDownModifier.php
│ │ ├── ResizeModifier.php
│ │ ├── ResolutionModifier.php
│ │ ├── RotateModifier.php
│ │ ├── ScaleDownModifier.php
│ │ ├── ScaleModifier.php
│ │ ├── SharpenModifier.php
│ │ ├── SliceAnimationModifier.php
│ │ ├── TextModifier.php
│ │ └── TrimModifier.php
│ ├── Origin.php
│ ├── Resolution.php
│ ├── Traits/
│ │ ├── CanBeDriverSpecialized.php
│ │ └── CanBuildFilePointer.php
│ └── Typography/
│ ├── Font.php
│ ├── FontFactory.php
│ ├── Line.php
│ └── TextBlock.php
└── tests/
├── BaseTestCase.php
├── Feature/
│ ├── Gd/
│ │ └── ConvertPngGif.php
│ └── Imagick/
│ ├── ConvertPngGif.php
│ └── CropResizePngTest.php
├── GdTestCase.php
├── ImagickTestCase.php
├── Traits/
│ ├── CanDetectProgressiveJpeg.php
│ └── CanInspectPngFormat.php
└── Unit/
├── CollectionTest.php
├── Colors/
│ ├── Cmyk/
│ │ ├── ChannelTest.php
│ │ ├── ColorTest.php
│ │ ├── ColorspaceTest.php
│ │ └── Decoders/
│ │ └── StringColorDecoderTest.php
│ ├── Hsl/
│ │ ├── ChannelTest.php
│ │ ├── Channels/
│ │ │ └── SaturationTest.php
│ │ ├── ColorTest.php
│ │ ├── ColorspaceTest.php
│ │ └── Decoders/
│ │ └── StringColorDecoderTest.php
│ ├── Hsv/
│ │ ├── ChannelTest.php
│ │ ├── Channels/
│ │ │ ├── SaturationTest.php
│ │ │ └── ValueTest.php
│ │ ├── ColorTest.php
│ │ ├── ColorspaceTest.php
│ │ └── Decoders/
│ │ └── StringColorDecoderTest.php
│ ├── ProfileTest.php
│ └── Rgb/
│ ├── ChannelTest.php
│ ├── Channels/
│ │ └── AlphaTest.php
│ ├── ColorTest.php
│ ├── ColorspaceTest.php
│ └── Decoders/
│ ├── HexColorDecoderTest.php
│ ├── HtmlColornameDecoderTest.php
│ └── StringColorDecoderTest.php
├── ConfigTest.php
├── Drivers/
│ ├── AbstractDecoderTest.php
│ ├── AbstractEncoderTest.php
│ ├── AbstractFontProcessorTest.php
│ ├── Gd/
│ │ ├── Analyzers/
│ │ │ ├── ColorspaceAnalyzerTest.php
│ │ │ ├── HeightAnalyzerTest.php
│ │ │ ├── PixelColorAnalyzerTest.php
│ │ │ ├── PixelColorsAnalyzerTest.php
│ │ │ ├── ResolutionAnalyzerTest.php
│ │ │ └── WidthAnalyzerTest.php
│ │ ├── ClonerTest.php
│ │ ├── ColorProcessorTest.php
│ │ ├── CoreTest.php
│ │ ├── Decoders/
│ │ │ ├── AbstractDecoderTest.php
│ │ │ ├── Base64ImageDecoderTest.php
│ │ │ ├── BinaryImageDecoderTest.php
│ │ │ ├── DataUriImageDecoderTest.php
│ │ │ ├── EncodedImageObjectDecoderTest.php
│ │ │ ├── FilePathImageDecoderTest.php
│ │ │ ├── FilePointerImageDecoderTest.php
│ │ │ ├── ImageObjectDecoderTest.php
│ │ │ ├── NativeObjectDecoderTest.php
│ │ │ └── SplFileInfoImageDecoderTest.php
│ │ ├── DriverTest.php
│ │ ├── Encoders/
│ │ │ ├── AvifEncoderTest.php
│ │ │ ├── BmpEncoderTest.php
│ │ │ ├── GifEncoderTest.php
│ │ │ ├── JpegEncoderTest.php
│ │ │ ├── PngEncoderTest.php
│ │ │ └── WebpEncoderTest.php
│ │ ├── FontProcessorTest.php
│ │ ├── FrameTest.php
│ │ ├── ImageTest.php
│ │ └── Modifiers/
│ │ ├── BlurModifierTest.php
│ │ ├── BrightnessModifierTest.php
│ │ ├── ColorizeModifierTest.php
│ │ ├── ContainModifierTest.php
│ │ ├── ContrastModifierTest.php
│ │ ├── CoverDownModifierTest.php
│ │ ├── CoverModifierTest.php
│ │ ├── CropModifierTest.php
│ │ ├── DrawBezierModifierTest.php
│ │ ├── DrawEllipseModifierTest.php
│ │ ├── DrawLineModifierTest.php
│ │ ├── DrawPixelModifierTest.php
│ │ ├── DrawPolygonModifierTest.php
│ │ ├── DrawRectangleModifierTest.php
│ │ ├── FillModifierTest.php
│ │ ├── FlipFlopModifierTest.php
│ │ ├── GammaModifierTest.php
│ │ ├── GreyscaleModifierTest.php
│ │ ├── InvertModifierTest.php
│ │ ├── PadModifierTest.php
│ │ ├── PixelateModifierTest.php
│ │ ├── PlaceModifierTest.php
│ │ ├── QuantizeColorsModifierTest.php
│ │ ├── RemoveAnimationModifierTest.php
│ │ ├── ResizeCanvasModifierTest.php
│ │ ├── ResizeCanvasRelativeModifierTest.php
│ │ ├── ResizeModifierTest.php
│ │ ├── ResolutionModifierTest.php
│ │ ├── RotateModifierTest.php
│ │ ├── SharpenModifierTest.php
│ │ ├── TextModifierTest.php
│ │ └── TrimModifierTest.php
│ ├── Imagick/
│ │ ├── Analyzers/
│ │ │ ├── ColorspaceAnalyzerTest.php
│ │ │ ├── HeightAnalyzerTest.php
│ │ │ ├── PixelColorAnalyzerTest.php
│ │ │ ├── PixelColorsAnalyzerTest.php
│ │ │ ├── ProfileAnalyzerTest.php
│ │ │ ├── ResolutionAnalyzerTest.php
│ │ │ └── WidthAnalyzerTest.php
│ │ ├── ColorProcessorTest.php
│ │ ├── CoreTest.php
│ │ ├── Decoders/
│ │ │ ├── Base64ImageDecoderTest.php
│ │ │ ├── BinaryImageDecoderTest.php
│ │ │ ├── DataUriImageDecoderTest.php
│ │ │ ├── EncodedImageObjectDecoderTest.php
│ │ │ ├── FilePathImageDecoderTest.php
│ │ │ ├── FilePointerImageDecoderTest.php
│ │ │ ├── ImageObjectDecoderTest.php
│ │ │ ├── NativeObjectDecoderTest.php
│ │ │ └── SplFileInfoImageDecoderTest.php
│ │ ├── DriverTest.php
│ │ ├── Encoders/
│ │ │ ├── AvifEncoderTest.php
│ │ │ ├── BmpEncoderTest.php
│ │ │ ├── GifEncoderTest.php
│ │ │ ├── HeicEncoderTest.php
│ │ │ ├── Jpeg2000EncoderTest.php
│ │ │ ├── JpegEncoderTest.php
│ │ │ ├── PngEncoderTest.php
│ │ │ ├── TiffEncoderTest.php
│ │ │ └── WebpEncoderTest.php
│ │ ├── FontProcessorTest.php
│ │ ├── FrameTest.php
│ │ ├── ImageTest.php
│ │ └── Modifiers/
│ │ ├── BlurModifierTest.php
│ │ ├── BrightnessModifierTest.php
│ │ ├── ColorizeModifierTest.php
│ │ ├── ContainModifierTest.php
│ │ ├── ContrastModifierTest.php
│ │ ├── CoverDownModifierTest.php
│ │ ├── CoverModifierTest.php
│ │ ├── CropModifierTest.php
│ │ ├── DrawBezierModifierTest.php
│ │ ├── DrawEllipseModifierTest.php
│ │ ├── DrawLineModifierTest.php
│ │ ├── DrawPixelModifierTest.php
│ │ ├── DrawPolygonModifierTest.php
│ │ ├── DrawRectangleModifierTest.php
│ │ ├── FillModifierTest.php
│ │ ├── FlipFlopModifierTest.php
│ │ ├── GammaModifierTest.php
│ │ ├── GreyscaleModifierTest.php
│ │ ├── InvertModifierTest.php
│ │ ├── PadModifierTest.php
│ │ ├── PixelateModifierTest.php
│ │ ├── PlaceModifierTest.php
│ │ ├── QuantizeColorsModifierTest.php
│ │ ├── RemoveAnimationModifierTest.php
│ │ ├── ResizeCanvasModifierTest.php
│ │ ├── ResizeCanvasRelativeModifierTest.php
│ │ ├── ResizeModifierTest.php
│ │ ├── ResolutionModifierTest.php
│ │ ├── RotateModifierTest.php
│ │ ├── SharpenModifierTest.php
│ │ ├── StripMetaModifierTest.php
│ │ ├── TextModifierTest.php
│ │ └── TrimModifierTest.php
│ ├── SpecializableAnalyzerTest.php
│ ├── SpecializableDecoderTest.php
│ └── SpecializableModifierTest.php
├── EncodedImageTest.php
├── Encoders/
│ ├── FileExtensionEncoderTest.php
│ └── MediaTypeEncoderTest.php
├── FileExtensionTest.php
├── FileTest.php
├── FormatTest.php
├── Geometry/
│ ├── BezierTest.php
│ ├── CircleTest.php
│ ├── EllipseTest.php
│ ├── Factories/
│ │ ├── BezierFactoryTest.php
│ │ ├── CircleFactoryTest.php
│ │ ├── DrawableTest.php
│ │ ├── EllipseFactoryTest.php
│ │ ├── LineFactoryTest.php
│ │ ├── PolygonFactoryTest.php
│ │ └── RectangleFactoryTest.php
│ ├── LineTest.php
│ ├── PixelTest.php
│ ├── PointTest.php
│ ├── PolygonTest.php
│ ├── RectangleResizerTest.php
│ ├── RectangleTest.php
│ └── Traits/
│ ├── HasBackgroundColorTest.php
│ └── HasBorderTest.php
├── ImageManagerTestGd.php
├── ImageManagerTestImagick.php
├── InputHandlerTest.php
├── MediaTypeTest.php
├── ModifierStackTest.php
├── Modifiers/
│ ├── ColorspaceModifierTest.php
│ ├── PadModifierTest.php
│ ├── RemoveAnimationModifierTest.php
│ └── TextModifierTest.php
├── OriginTest.php
├── ResolutionTest.php
└── Typography/
├── FontFactoryTest.php
├── FontTest.php
├── LineTest.php
└── TextBlockTest.php
Showing preview only (238K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2541 symbols across 534 files)
FILE: src/Analyzers/ColorspaceAnalyzer.php
class ColorspaceAnalyzer (line 9) | class ColorspaceAnalyzer extends SpecializableAnalyzer
FILE: src/Analyzers/HeightAnalyzer.php
class HeightAnalyzer (line 9) | class HeightAnalyzer extends SpecializableAnalyzer
FILE: src/Analyzers/PixelColorAnalyzer.php
class PixelColorAnalyzer (line 9) | class PixelColorAnalyzer extends SpecializableAnalyzer
method __construct (line 11) | public function __construct(
FILE: src/Analyzers/PixelColorsAnalyzer.php
class PixelColorsAnalyzer (line 9) | class PixelColorsAnalyzer extends SpecializableAnalyzer
method __construct (line 11) | public function __construct(
FILE: src/Analyzers/ProfileAnalyzer.php
class ProfileAnalyzer (line 9) | class ProfileAnalyzer extends SpecializableAnalyzer
FILE: src/Analyzers/ResolutionAnalyzer.php
class ResolutionAnalyzer (line 9) | class ResolutionAnalyzer extends SpecializableAnalyzer
FILE: src/Analyzers/WidthAnalyzer.php
class WidthAnalyzer (line 9) | class WidthAnalyzer extends SpecializableAnalyzer
FILE: src/Collection.php
class Collection (line 16) | class Collection implements CollectionInterface, IteratorAggregate, Coun...
method __construct (line 24) | public function __construct(protected array $items = [])
method create (line 35) | public static function create(array $items = []): self
method has (line 45) | public function has(int|string $key): bool
method getIterator (line 55) | public function getIterator(): Traversable
method toArray (line 65) | public function toArray(): array
method count (line 73) | public function count(): int
method push (line 83) | public function push(mixed $item): CollectionInterface
method first (line 93) | public function first(): mixed
method last (line 105) | public function last(): mixed
method getAtPosition (line 117) | public function getAtPosition(int $key = 0, mixed $default = null): mixed
method get (line 136) | public function get(int|string $query, mixed $default = null): mixed
method map (line 170) | public function map(callable $callback): self
method filter (line 184) | public function filter(callable $callback): self
method empty (line 199) | public function empty(): CollectionInterface
method slice (line 211) | public function slice(int $offset, ?int $length = null): CollectionInt...
FILE: src/Colors/AbstractColor.php
class AbstractColor (line 14) | abstract class AbstractColor implements ColorInterface, Stringable
method channels (line 28) | public function channels(): array
method channel (line 38) | public function channel(string $classname): ColorChannelInterface
method normalize (line 57) | public function normalize(): array
method toArray (line 70) | public function toArray(): array
method convertTo (line 83) | public function convertTo(string|ColorspaceInterface $colorspace): Col...
method __debugInfo (line 98) | public function __debugInfo(): array
method __toString (line 112) | public function __toString(): string
FILE: src/Colors/AbstractColorChannel.php
class AbstractColorChannel (line 11) | abstract class AbstractColorChannel implements ColorChannelInterface, St...
method __construct (line 20) | public function __construct(?int $value = null, ?float $normalized = n...
method toInt (line 34) | public function toInt(): int
method value (line 44) | public function value(): int
method normalize (line 54) | public function normalize(int $precision = 32): float
method validate (line 64) | public function validate(mixed $value): mixed
method toString (line 78) | public function toString(): string
method __toString (line 88) | public function __toString(): string
FILE: src/Colors/Cmyk/Channels/Cyan.php
class Cyan (line 9) | class Cyan extends AbstractColorChannel
method min (line 11) | public function min(): int
method max (line 16) | public function max(): int
FILE: src/Colors/Cmyk/Channels/Key.php
class Key (line 7) | class Key extends Cyan
FILE: src/Colors/Cmyk/Channels/Magenta.php
class Magenta (line 7) | class Magenta extends Cyan
FILE: src/Colors/Cmyk/Channels/Yellow.php
class Yellow (line 7) | class Yellow extends Cyan
FILE: src/Colors/Cmyk/Color.php
class Color (line 18) | class Color extends AbstractColor
method __construct (line 25) | public function __construct(int $c, int $m, int $y, int $k)
method create (line 41) | public static function create(mixed $input): ColorInterface
method colorspace (line 53) | public function colorspace(): ColorspaceInterface
method toHex (line 63) | public function toHex(string $prefix = ''): string
method cyan (line 71) | public function cyan(): ColorChannelInterface
method magenta (line 80) | public function magenta(): ColorChannelInterface
method yellow (line 89) | public function yellow(): ColorChannelInterface
method key (line 98) | public function key(): ColorChannelInterface
method toString (line 109) | public function toString(): string
method isGreyscale (line 125) | public function isGreyscale(): bool
method isTransparent (line 139) | public function isTransparent(): bool
method isClear (line 149) | public function isClear(): bool
FILE: src/Colors/Cmyk/Colorspace.php
class Colorspace (line 16) | class Colorspace implements ColorspaceInterface
method colorFromNormalized (line 35) | public function colorFromNormalized(array $normalized): ColorInterface
method importColor (line 47) | public function importColor(ColorInterface $color): ColorInterface
method importRgbColor (line 60) | protected function importRgbColor(ColorInterface $color): CmykColor
FILE: src/Colors/Cmyk/Decoders/StringColorDecoder.php
class StringColorDecoder (line 14) | class StringColorDecoder extends AbstractDecoder implements DecoderInter...
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Colors/Hsl/Channels/Hue.php
class Hue (line 9) | class Hue extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Hsl/Channels/Luminance.php
class Luminance (line 9) | class Luminance extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Hsl/Channels/Saturation.php
class Saturation (line 9) | class Saturation extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Hsl/Color.php
class Color (line 17) | class Color extends AbstractColor
method __construct (line 24) | public function __construct(int $h, int $s, int $l)
method colorspace (line 39) | public function colorspace(): ColorspaceInterface
method create (line 49) | public static function create(mixed $input): ColorInterface
method hue (line 59) | public function hue(): ColorChannelInterface
method saturation (line 68) | public function saturation(): ColorChannelInterface
method luminance (line 77) | public function luminance(): ColorChannelInterface
method toHex (line 83) | public function toHex(string $prefix = ''): string
method toString (line 93) | public function toString(): string
method isGreyscale (line 108) | public function isGreyscale(): bool
method isTransparent (line 118) | public function isTransparent(): bool
method isClear (line 128) | public function isClear(): bool
FILE: src/Colors/Hsl/Colorspace.php
class Colorspace (line 16) | class Colorspace implements ColorspaceInterface
method colorFromNormalized (line 34) | public function colorFromNormalized(array $normalized): ColorInterface
method importColor (line 46) | public function importColor(ColorInterface $color): ColorInterface
method importRgbColor (line 59) | protected function importRgbColor(ColorInterface $color): ColorInterface
method importHsvColor (line 108) | protected function importHsvColor(ColorInterface $color): ColorInterface
FILE: src/Colors/Hsl/Decoders/StringColorDecoder.php
class StringColorDecoder (line 14) | class StringColorDecoder extends AbstractDecoder implements DecoderInter...
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Colors/Hsv/Channels/Hue.php
class Hue (line 9) | class Hue extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Hsv/Channels/Saturation.php
class Saturation (line 9) | class Saturation extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Hsv/Channels/Value.php
class Value (line 9) | class Value extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Hsv/Color.php
class Color (line 17) | class Color extends AbstractColor
method __construct (line 24) | public function __construct(int $h, int $s, int $v)
method colorspace (line 39) | public function colorspace(): ColorspaceInterface
method create (line 49) | public static function create(mixed $input): ColorInterface
method hue (line 59) | public function hue(): ColorChannelInterface
method saturation (line 68) | public function saturation(): ColorChannelInterface
method value (line 77) | public function value(): ColorChannelInterface
method toHex (line 83) | public function toHex(string $prefix = ''): string
method toString (line 93) | public function toString(): string
method isGreyscale (line 108) | public function isGreyscale(): bool
method isTransparent (line 118) | public function isTransparent(): bool
method isClear (line 128) | public function isClear(): bool
FILE: src/Colors/Hsv/Colorspace.php
class Colorspace (line 16) | class Colorspace implements ColorspaceInterface
method colorFromNormalized (line 34) | public function colorFromNormalized(array $normalized): ColorInterface
method importColor (line 46) | public function importColor(ColorInterface $color): ColorInterface
method importRgbColor (line 59) | protected function importRgbColor(ColorInterface $color): ColorInterface
method importHslColor (line 105) | protected function importHslColor(ColorInterface $color): ColorInterface
FILE: src/Colors/Hsv/Decoders/StringColorDecoder.php
class StringColorDecoder (line 14) | class StringColorDecoder extends AbstractDecoder implements DecoderInter...
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Colors/Profile.php
class Profile (line 11) | class Profile extends File implements ProfileInterface
method fromPath (line 18) | public static function fromPath(string $path): self
FILE: src/Colors/Rgb/Channels/Alpha.php
class Alpha (line 7) | class Alpha extends Red
method toString (line 14) | public function toString(): string
FILE: src/Colors/Rgb/Channels/Blue.php
class Blue (line 7) | class Blue extends Red
FILE: src/Colors/Rgb/Channels/Green.php
class Green (line 7) | class Green extends Red
FILE: src/Colors/Rgb/Channels/Red.php
class Red (line 9) | class Red extends AbstractColorChannel
method min (line 16) | public function min(): int
method max (line 26) | public function max(): int
FILE: src/Colors/Rgb/Color.php
class Color (line 17) | class Color extends AbstractColor
method __construct (line 24) | public function __construct(int $r, int $g, int $b, int $a = 255)
method colorspace (line 40) | public function colorspace(): ColorspaceInterface
method create (line 50) | public static function create(mixed $input): ColorInterface
method red (line 63) | public function red(): ColorChannelInterface
method green (line 72) | public function green(): ColorChannelInterface
method blue (line 81) | public function blue(): ColorChannelInterface
method alpha (line 90) | public function alpha(): ColorChannelInterface
method toHex (line 101) | public function toHex(string $prefix = ''): string
method toString (line 128) | public function toString(): string
method isGreyscale (line 153) | public function isGreyscale(): bool
method isTransparent (line 165) | public function isTransparent(): bool
method isClear (line 175) | public function isClear(): bool
FILE: src/Colors/Rgb/Colorspace.php
class Colorspace (line 15) | class Colorspace implements ColorspaceInterface
method colorFromNormalized (line 34) | public function colorFromNormalized(array $normalized): ColorInterface
method importColor (line 46) | public function importColor(ColorInterface $color): ColorInterface
method importCmykColor (line 59) | protected function importCmykColor(ColorInterface $color): ColorInterface
method importHsvColor (line 75) | protected function importHsvColor(ColorInterface $color): ColorInterface
method importHslColor (line 105) | protected function importHslColor(ColorInterface $color): ColorInterface
FILE: src/Colors/Rgb/Decoders/HexColorDecoder.php
class HexColorDecoder (line 14) | class HexColorDecoder extends AbstractDecoder implements DecoderInterface
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Colors/Rgb/Decoders/HtmlColornameDecoder.php
class HtmlColornameDecoder (line 12) | class HtmlColornameDecoder extends HexColorDecoder implements DecoderInt...
method decode (line 164) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Colors/Rgb/Decoders/StringColorDecoder.php
class StringColorDecoder (line 14) | class StringColorDecoder extends AbstractDecoder implements DecoderInter...
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Colors/Rgb/Decoders/TransparentColorDecoder.php
class TransparentColorDecoder (line 11) | class TransparentColorDecoder extends HexColorDecoder
method decode (line 18) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Config.php
class Config (line 9) | class Config
method __construct (line 16) | public function __construct(
method setOptions (line 30) | public function setOptions(mixed ...$options): self
method prepareOptions (line 50) | private function prepareOptions(array $options): array
FILE: src/Decoders/Base64ImageDecoder.php
class Base64ImageDecoder (line 9) | class Base64ImageDecoder extends SpecializableDecoder
FILE: src/Decoders/BinaryImageDecoder.php
class BinaryImageDecoder (line 9) | class BinaryImageDecoder extends SpecializableDecoder
FILE: src/Decoders/ColorObjectDecoder.php
class ColorObjectDecoder (line 12) | class ColorObjectDecoder extends AbstractDecoder
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Decoders/DataUriImageDecoder.php
class DataUriImageDecoder (line 9) | class DataUriImageDecoder extends SpecializableDecoder
FILE: src/Decoders/EncodedImageObjectDecoder.php
class EncodedImageObjectDecoder (line 9) | class EncodedImageObjectDecoder extends SpecializableDecoder
FILE: src/Decoders/FilePathImageDecoder.php
class FilePathImageDecoder (line 9) | class FilePathImageDecoder extends SpecializableDecoder
FILE: src/Decoders/FilePointerImageDecoder.php
class FilePointerImageDecoder (line 9) | class FilePointerImageDecoder extends SpecializableDecoder
FILE: src/Decoders/ImageObjectDecoder.php
class ImageObjectDecoder (line 12) | class ImageObjectDecoder extends AbstractDecoder
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Decoders/NativeObjectDecoder.php
class NativeObjectDecoder (line 9) | class NativeObjectDecoder extends SpecializableDecoder
FILE: src/Decoders/SplFileInfoImageDecoder.php
class SplFileInfoImageDecoder (line 9) | class SplFileInfoImageDecoder extends SpecializableDecoder
FILE: src/Drivers/AbstractDecoder.php
class AbstractDecoder (line 13) | abstract class AbstractDecoder implements DecoderInterface
method isGifFormat (line 20) | protected function isGifFormat(string $input): bool
method isFile (line 28) | protected function isFile(mixed $input): bool
method extractExifData (line 55) | protected function extractExifData(string $path_or_data): CollectionIn...
method isValidBase64 (line 82) | protected function isValidBase64(mixed $input): bool
method parseDataUri (line 94) | protected function parseDataUri(mixed $input): object
FILE: src/Drivers/AbstractDriver.php
class AbstractDriver (line 22) | abstract class AbstractDriver implements DriverInterface
method __construct (line 33) | public function __construct()
method config (line 44) | public function config(): Config
method handleInput (line 54) | public function handleInput(mixed $input, array $decoders = []): Image...
method specialize (line 64) | public function specialize(
method specializeMultiple (line 113) | public function specializeMultiple(array $objects): array
FILE: src/Drivers/AbstractEncoder.php
class AbstractEncoder (line 14) | abstract class AbstractEncoder implements EncoderInterface
method encode (line 25) | public function encode(ImageInterface $image): EncodedImageInterface
method createEncodedImage (line 35) | protected function createEncodedImage(callable $callback, ?string $med...
FILE: src/Drivers/AbstractFontProcessor.php
class AbstractFontProcessor (line 16) | abstract class AbstractFontProcessor implements FontProcessorInterface
method textBlock (line 23) | public function textBlock(string $text, FontInterface $font, PointInte...
method nativeFontSize (line 56) | public function nativeFontSize(FontInterface $font): float
method typographicalSize (line 66) | public function typographicalSize(FontInterface $font): int
method capHeight (line 76) | public function capHeight(FontInterface $font): int
method leading (line 86) | public function leading(FontInterface $font): int
method wrapTextBlock (line 96) | protected function wrapTextBlock(TextBlock $block, FontInterface $font...
method wrapLine (line 116) | protected function wrapLine(Line $line, FontInterface $font): array
method buildPivot (line 154) | protected function buildPivot(TextBlock $block, FontInterface $font, P...
FILE: src/Drivers/AbstractFrame.php
class AbstractFrame (line 9) | abstract class AbstractFrame implements FrameInterface
method __debugInfo (line 16) | public function __debugInfo(): array
FILE: src/Drivers/Gd/Analyzers/ColorspaceAnalyzer.php
class ColorspaceAnalyzer (line 12) | class ColorspaceAnalyzer extends GenericColorspaceAnalyzer implements Sp...
method analyze (line 19) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Gd/Analyzers/HeightAnalyzer.php
class HeightAnalyzer (line 11) | class HeightAnalyzer extends GenericHeightAnalyzer implements Specialize...
method analyze (line 18) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Gd/Analyzers/PixelColorAnalyzer.php
class PixelColorAnalyzer (line 16) | class PixelColorAnalyzer extends GenericPixelColorAnalyzer implements Sp...
method analyze (line 23) | public function analyze(ImageInterface $image): mixed
method colorAt (line 35) | protected function colorAt(ColorspaceInterface $colorspace, GdImage $g...
FILE: src/Drivers/Gd/Analyzers/PixelColorsAnalyzer.php
class PixelColorsAnalyzer (line 10) | class PixelColorsAnalyzer extends PixelColorAnalyzer
method analyze (line 17) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Gd/Analyzers/ResolutionAnalyzer.php
class ResolutionAnalyzer (line 12) | class ResolutionAnalyzer extends GenericResolutionAnalyzer implements Sp...
method analyze (line 19) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Gd/Analyzers/WidthAnalyzer.php
class WidthAnalyzer (line 11) | class WidthAnalyzer extends GenericWidthAnalyzer implements SpecializedI...
method analyze (line 18) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Gd/Cloner.php
class Cloner (line 15) | class Cloner
method clone (line 22) | public static function clone(GdImage $gd): GdImage
method cloneEmpty (line 42) | public static function cloneEmpty(
method cloneBlended (line 80) | public static function cloneBlended(GdImage $gd, ColorInterface $backg...
FILE: src/Drivers/Gd/ColorProcessor.php
class ColorProcessor (line 18) | class ColorProcessor implements ColorProcessorInterface
method __construct (line 25) | public function __construct(protected ColorspaceInterface $colorspace ...
method colorToNative (line 35) | public function colorToNative(ColorInterface $color): int
method nativeToColor (line 58) | public function nativeToColor(mixed $value): ColorInterface
method convertRange (line 95) | protected function convertRange(
method isValidArrayColor (line 112) | private function isValidArrayColor(array $color): bool
FILE: src/Drivers/Gd/Core.php
class Core (line 12) | class Core extends Collection implements CoreInterface
method add (line 21) | public function add(FrameInterface $frame): CoreInterface
method native (line 33) | public function native(): mixed
method setNative (line 43) | public function setNative(mixed $native): self
method frame (line 55) | public function frame(int $position): FrameInterface
method loops (line 71) | public function loops(): int
method setLoops (line 81) | public function setLoops(int $loops): self
method first (line 93) | public function first(): FrameInterface
method last (line 103) | public function last(): FrameInterface
method __clone (line 111) | public function __clone(): void
FILE: src/Drivers/Gd/Decoders/AbstractDecoder.php
class AbstractDecoder (line 14) | abstract class AbstractDecoder extends SpecializableDecoder implements S...
method getMediaTypeByFilePath (line 22) | protected function getMediaTypeByFilePath(string $filepath): MediaType
method getMediaTypeByBinary (line 54) | protected function getMediaTypeByBinary(string $data): MediaType
FILE: src/Drivers/Gd/Decoders/Base64ImageDecoder.php
class Base64ImageDecoder (line 12) | class Base64ImageDecoder extends BinaryImageDecoder implements DecoderIn...
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Gd/Decoders/BinaryImageDecoder.php
class BinaryImageDecoder (line 15) | class BinaryImageDecoder extends NativeObjectDecoder implements DecoderI...
method decode (line 22) | public function decode(mixed $input): ImageInterface|ColorInterface
method decodeBinary (line 39) | private function decodeBinary(string $input): ImageInterface
FILE: src/Drivers/Gd/Decoders/DataUriImageDecoder.php
class DataUriImageDecoder (line 12) | class DataUriImageDecoder extends BinaryImageDecoder implements DecoderI...
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Gd/Decoders/EncodedImageObjectDecoder.php
class EncodedImageObjectDecoder (line 12) | class EncodedImageObjectDecoder extends BinaryImageDecoder
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Gd/Decoders/FilePathImageDecoder.php
class FilePathImageDecoder (line 14) | class FilePathImageDecoder extends NativeObjectDecoder implements Decode...
method decode (line 21) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Gd/Decoders/FilePointerImageDecoder.php
class FilePointerImageDecoder (line 11) | class FilePointerImageDecoder extends BinaryImageDecoder
method decode (line 18) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Gd/Decoders/NativeObjectDecoder.php
class NativeObjectDecoder (line 19) | class NativeObjectDecoder extends AbstractDecoder
method decode (line 26) | public function decode(mixed $input): ImageInterface|ColorInterface
method decodeGif (line 59) | protected function decodeGif(mixed $input): ImageInterface
FILE: src/Drivers/Gd/Decoders/SplFileInfoImageDecoder.php
class SplFileInfoImageDecoder (line 13) | class SplFileInfoImageDecoder extends FilePathImageDecoder implements De...
method decode (line 20) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Gd/Driver.php
class Driver (line 20) | class Driver extends AbstractDriver
method id (line 27) | public function id(): string
method checkHealth (line 39) | public function checkHealth(): void
method createImage (line 53) | public function createImage(int $width, int $height): ImageInterface
method createAnimation (line 78) | public function createAnimation(callable $init): ImageInterface
method colorProcessor (line 123) | public function colorProcessor(ColorspaceInterface $colorspace): Color...
method fontProcessor (line 133) | public function fontProcessor(): FontProcessorInterface
method supports (line 143) | public function supports(string|Format|FileExtension|MediaType $identi...
method version (line 159) | public static function version(): string
FILE: src/Drivers/Gd/Encoders/AvifEncoder.php
class AvifEncoder (line 12) | class AvifEncoder extends GenericAvifEncoder implements SpecializedInter...
method encode (line 19) | public function encode(ImageInterface $image): EncodedImage
FILE: src/Drivers/Gd/Encoders/BmpEncoder.php
class BmpEncoder (line 12) | class BmpEncoder extends GenericBmpEncoder implements SpecializedInterface
method encode (line 19) | public function encode(ImageInterface $image): EncodedImage
FILE: src/Drivers/Gd/Encoders/GifEncoder.php
class GifEncoder (line 17) | class GifEncoder extends GenericGifEncoder implements SpecializedInterface
method encode (line 24) | public function encode(ImageInterface $image): EncodedImage
method encodeAnimated (line 41) | protected function encodeAnimated(ImageInterface $image): EncodedImage
FILE: src/Drivers/Gd/Encoders/JpegEncoder.php
class JpegEncoder (line 13) | class JpegEncoder extends GenericJpegEncoder implements SpecializedInter...
method encode (line 20) | public function encode(ImageInterface $image): EncodedImage
FILE: src/Drivers/Gd/Encoders/PngEncoder.php
class PngEncoder (line 17) | class PngEncoder extends GenericPngEncoder implements SpecializedInterface
method encode (line 24) | public function encode(ImageInterface $image): EncodedImage
method prepareOutput (line 41) | private function prepareOutput(ImageInterface $image): GdImage
FILE: src/Drivers/Gd/Encoders/WebpEncoder.php
class WebpEncoder (line 12) | class WebpEncoder extends GenericWebpEncoder implements SpecializedInter...
method encode (line 19) | public function encode(ImageInterface $image): EncodedImage
FILE: src/Drivers/Gd/FontProcessor.php
class FontProcessor (line 14) | class FontProcessor extends AbstractFontProcessor
method boxSize (line 21) | public function boxSize(string $text, FontInterface $font): SizeInterface
method nativeFontSize (line 73) | public function nativeFontSize(FontInterface $font): float
method leading (line 83) | public function leading(FontInterface $font): int
method gdCharacterWidth (line 91) | protected function gdCharacterWidth(int $gdfont): int
method gdCharacterHeight (line 99) | protected function gdCharacterHeight(int $gdfont): int
FILE: src/Drivers/Gd/Frame.php
class Frame (line 18) | class Frame extends AbstractFrame implements FrameInterface
method __construct (line 25) | public function __construct(
method toImage (line 40) | public function toImage(DriverInterface $driver): ImageInterface
method setNative (line 50) | public function setNative(mixed $native): FrameInterface
method native (line 62) | public function native(): GdImage
method size (line 72) | public function size(): SizeInterface
method delay (line 82) | public function delay(): float
method setDelay (line 92) | public function setDelay(float $delay): FrameInterface
method dispose (line 104) | public function dispose(): int
method setDispose (line 116) | public function setDispose(int $dispose): FrameInterface
method setOffset (line 132) | public function setOffset(int $left, int $top): FrameInterface
method offsetLeft (line 145) | public function offsetLeft(): int
method setOffsetLeft (line 155) | public function setOffsetLeft(int $offset): FrameInterface
method offsetTop (line 167) | public function offsetTop(): int
method setOffsetTop (line 177) | public function setOffsetTop(int $offset): FrameInterface
method __clone (line 189) | public function __clone(): void
FILE: src/Drivers/Gd/Modifiers/AlignRotationModifier.php
class AlignRotationModifier (line 11) | class AlignRotationModifier extends GenericAlignRotationModifier impleme...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
method markAligned (line 39) | private function markAligned(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php
class BlendTransparencyModifier (line 12) | class BlendTransparencyModifier extends GenericBlendTransparencyModifier...
method apply (line 19) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/BlurModifier.php
class BlurModifier (line 11) | class BlurModifier extends GenericBlurModifier implements SpecializedInt...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/BrightnessModifier.php
class BrightnessModifier (line 11) | class BrightnessModifier extends GenericBrightnessModifier implements Sp...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/ColorizeModifier.php
class ColorizeModifier (line 11) | class ColorizeModifier extends GenericColorizeModifier implements Specia...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/ColorspaceModifier.php
class ColorspaceModifier (line 13) | class ColorspaceModifier extends GenericColorspaceModifier implements Sp...
method apply (line 20) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/ContainModifier.php
class ContainModifier (line 19) | class ContainModifier extends GenericContainModifier implements Speciali...
method apply (line 26) | public function apply(ImageInterface $image): ImageInterface
method modify (line 45) | protected function modify(
FILE: src/Drivers/Gd/Modifiers/ContrastModifier.php
class ContrastModifier (line 11) | class ContrastModifier extends GenericContrastModifier implements Specia...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/CoverDownModifier.php
class CoverDownModifier (line 10) | class CoverDownModifier extends CoverModifier
method getResizeSize (line 15) | public function getResizeSize(SizeInterface $size): SizeInterface
FILE: src/Drivers/Gd/Modifiers/CoverModifier.php
class CoverModifier (line 15) | class CoverModifier extends GenericCoverModifier implements SpecializedI...
method apply (line 22) | public function apply(ImageInterface $image): ImageInterface
method modifyFrame (line 37) | protected function modifyFrame(FrameInterface $frame, SizeInterface $c...
FILE: src/Drivers/Gd/Modifiers/CropModifier.php
class CropModifier (line 16) | class CropModifier extends GenericCropModifier implements SpecializedInt...
method apply (line 23) | public function apply(ImageInterface $image): ImageInterface
method cropFrame (line 39) | protected function cropFrame(
FILE: src/Drivers/Gd/Modifiers/DrawBezierModifier.php
class DrawBezierModifier (line 13) | class DrawBezierModifier extends GenericDrawBezierModifier implements Sp...
method apply (line 23) | public function apply(ImageInterface $image): ImageInterface
method calculateQuadraticBezierInterpolationPoint (line 93) | private function calculateQuadraticBezierInterpolationPoint(float $t =...
method calculateCubicBezierInterpolationPoint (line 119) | private function calculateCubicBezierInterpolationPoint(float $t = 0.0...
method calculateBezierPoints (line 151) | private function calculateBezierPoints(): array
FILE: src/Drivers/Gd/Modifiers/DrawEllipseModifier.php
class DrawEllipseModifier (line 12) | class DrawEllipseModifier extends GenericDrawEllipseModifier implements ...
method apply (line 21) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/DrawLineModifier.php
class DrawLineModifier (line 12) | class DrawLineModifier extends GenericDrawLineModifier implements Specia...
method apply (line 17) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/DrawPixelModifier.php
class DrawPixelModifier (line 11) | class DrawPixelModifier extends GenericDrawPixelModifier implements Spec...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/DrawPolygonModifier.php
class DrawPolygonModifier (line 12) | class DrawPolygonModifier extends ModifiersDrawPolygonModifier implement...
method apply (line 21) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/DrawRectangleModifier.php
class DrawRectangleModifier (line 12) | class DrawRectangleModifier extends GenericDrawRectangleModifier impleme...
method apply (line 21) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/FillModifier.php
class FillModifier (line 13) | class FillModifier extends GenericFillModifier implements SpecializedInt...
method apply (line 20) | public function apply(ImageInterface $image): ImageInterface
method color (line 38) | private function color(ImageInterface $image): int
method floodFillWithColor (line 45) | private function floodFillWithColor(FrameInterface $frame, int $color)...
method fillAllWithColor (line 55) | private function fillAllWithColor(FrameInterface $frame, int $color): ...
FILE: src/Drivers/Gd/Modifiers/FlipModifier.php
class FlipModifier (line 11) | class FlipModifier extends GenericFlipModifier implements SpecializedInt...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/FlopModifier.php
class FlopModifier (line 11) | class FlopModifier extends GenericFlopModifier implements SpecializedInt...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/GammaModifier.php
class GammaModifier (line 11) | class GammaModifier extends GenericGammaModifier implements SpecializedI...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/GreyscaleModifier.php
class GreyscaleModifier (line 11) | class GreyscaleModifier extends GenericGreyscaleModifier implements Spec...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/InvertModifier.php
class InvertModifier (line 11) | class InvertModifier extends GenericInvertModifier implements Specialize...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/PadModifier.php
class PadModifier (line 10) | class PadModifier extends ContainModifier
method getCropSize (line 12) | public function getCropSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Gd/Modifiers/PixelateModifier.php
class PixelateModifier (line 11) | class PixelateModifier extends GenericPixelateModifier implements Specia...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/PlaceModifier.php
class PlaceModifier (line 14) | class PlaceModifier extends GenericPlaceModifier implements SpecializedI...
method apply (line 21) | public function apply(ImageInterface $image): ImageInterface
method placeOpaque (line 44) | private function placeOpaque(FrameInterface $frame, ImageInterface $wa...
method placeTransparent (line 73) | private function placeTransparent(FrameInterface $frame, ImageInterfac...
FILE: src/Drivers/Gd/Modifiers/ProfileModifier.php
class ProfileModifier (line 12) | class ProfileModifier extends GenericProfileModifier implements Speciali...
method apply (line 19) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/ProfileRemovalModifier.php
class ProfileRemovalModifier (line 11) | class ProfileRemovalModifier extends GenericProfileRemovalModifier imple...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/QuantizeColorsModifier.php
class QuantizeColorsModifier (line 13) | class QuantizeColorsModifier extends GenericQuantizeColorsModifier imple...
method apply (line 20) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/RemoveAnimationModifier.php
class RemoveAnimationModifier (line 11) | class RemoveAnimationModifier extends GenericRemoveAnimationModifier imp...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/ResizeCanvasModifier.php
class ResizeCanvasModifier (line 11) | class ResizeCanvasModifier extends GenericResizeCanvasModifier implement...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/ResizeCanvasRelativeModifier.php
class ResizeCanvasRelativeModifier (line 10) | class ResizeCanvasRelativeModifier extends ResizeCanvasModifier
method cropSize (line 12) | protected function cropSize(ImageInterface $image, bool $relative = fa...
FILE: src/Drivers/Gd/Modifiers/ResizeDownModifier.php
class ResizeDownModifier (line 10) | class ResizeDownModifier extends ResizeModifier
method getAdjustedSize (line 12) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Gd/Modifiers/ResizeModifier.php
class ResizeModifier (line 17) | class ResizeModifier extends GenericResizeModifier implements Specialize...
method apply (line 24) | public function apply(ImageInterface $image): ImageInterface
method resizeFrame (line 37) | private function resizeFrame(FrameInterface $frame, SizeInterface $res...
method getAdjustedSize (line 66) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Gd/Modifiers/ResolutionModifier.php
class ResolutionModifier (line 11) | class ResolutionModifier extends GenericResolutionModifier implements Sp...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/RotateModifier.php
class RotateModifier (line 19) | class RotateModifier extends GenericRotateModifier implements Specialize...
method apply (line 26) | public function apply(ImageInterface $image): ImageInterface
method modifyFrame (line 43) | protected function modifyFrame(FrameInterface $frame, ColorInterface $...
FILE: src/Drivers/Gd/Modifiers/ScaleDownModifier.php
class ScaleDownModifier (line 10) | class ScaleDownModifier extends ResizeModifier
method getAdjustedSize (line 17) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Gd/Modifiers/ScaleModifier.php
class ScaleModifier (line 10) | class ScaleModifier extends ResizeModifier
method getAdjustedSize (line 12) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Gd/Modifiers/SharpenModifier.php
class SharpenModifier (line 11) | class SharpenModifier extends GenericSharpenModifier implements Speciali...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
method matrix (line 33) | private function matrix(): array
FILE: src/Drivers/Gd/Modifiers/SliceAnimationModifier.php
class SliceAnimationModifier (line 12) | class SliceAnimationModifier extends GenericSliceAnimationModifier imple...
method apply (line 19) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Gd/Modifiers/TextModifier.php
class TextModifier (line 14) | class TextModifier extends GenericTextModifier implements SpecializedInt...
method apply (line 21) | public function apply(ImageInterface $image): ImageInterface
method gdTextColor (line 100) | protected function gdTextColor(ImageInterface $image): int
method gdStrokeColor (line 114) | protected function gdStrokeColor(ImageInterface $image): int
method gdFont (line 137) | private function gdFont(): int
FILE: src/Drivers/Gd/Modifiers/TrimModifier.php
class TrimModifier (line 15) | class TrimModifier extends GenericTrimModifier implements SpecializedInt...
method apply (line 22) | public function apply(ImageInterface $image): ImageInterface
method trimColor (line 54) | private function trimColor(ImageInterface $image): int
FILE: src/Drivers/Imagick/Analyzers/ColorspaceAnalyzer.php
class ColorspaceAnalyzer (line 14) | class ColorspaceAnalyzer extends GenericColorspaceAnalyzer implements Sp...
method analyze (line 16) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Imagick/Analyzers/HeightAnalyzer.php
class HeightAnalyzer (line 11) | class HeightAnalyzer extends GenericHeightAnalyzer implements Specialize...
method analyze (line 13) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Imagick/Analyzers/PixelColorAnalyzer.php
class PixelColorAnalyzer (line 15) | class PixelColorAnalyzer extends GenericPixelColorAnalyzer implements Sp...
method analyze (line 17) | public function analyze(ImageInterface $image): mixed
method colorAt (line 28) | protected function colorAt(ColorspaceInterface $colorspace, Imagick $i...
FILE: src/Drivers/Imagick/Analyzers/PixelColorsAnalyzer.php
class PixelColorsAnalyzer (line 10) | class PixelColorsAnalyzer extends PixelColorAnalyzer
method analyze (line 12) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Imagick/Analyzers/ProfileAnalyzer.php
class ProfileAnalyzer (line 13) | class ProfileAnalyzer extends GenericProfileAnalyzer implements Speciali...
method analyze (line 15) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Imagick/Analyzers/ResolutionAnalyzer.php
class ResolutionAnalyzer (line 12) | class ResolutionAnalyzer extends GenericResolutionAnalyzer implements Sp...
method analyze (line 14) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Imagick/Analyzers/WidthAnalyzer.php
class WidthAnalyzer (line 11) | class WidthAnalyzer extends GenericWidthAnalyzer implements SpecializedI...
method analyze (line 13) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/Imagick/ColorProcessor.php
class ColorProcessor (line 14) | class ColorProcessor implements ColorProcessorInterface
method __construct (line 16) | public function __construct(protected ColorspaceInterface $colorspace)
method colorToNative (line 21) | public function colorToNative(ColorInterface $color): ImagickPixel
method nativeToColor (line 28) | public function nativeToColor(mixed $native): ColorInterface
FILE: src/Drivers/Imagick/Core.php
class Core (line 18) | class Core implements CoreInterface, Iterator
method __construct (line 27) | public function __construct(protected Imagick $imagick)
method has (line 37) | public function has(int|string $key): bool
method push (line 53) | public function push(mixed $item): CollectionInterface
method get (line 63) | public function get(int|string $key, mixed $default = null): mixed
method getAtPosition (line 79) | public function getAtPosition(int $key = 0, mixed $default = null): mixed
method empty (line 89) | public function empty(): CollectionInterface
method slice (line 101) | public function slice(int $offset, ?int $length = null): CollectionInt...
method add (line 129) | public function add(FrameInterface $frame): CoreInterface
method count (line 157) | public function count(): int
method current (line 167) | public function current(): mixed
method next (line 179) | public function next(): void
method key (line 189) | public function key(): mixed
method valid (line 199) | public function valid(): bool
method rewind (line 215) | public function rewind(): void
method native (line 225) | public function native(): mixed
method setNative (line 235) | public function setNative(mixed $native): CoreInterface
method frame (line 247) | public function frame(int $position): FrameInterface
method loops (line 263) | public function loops(): int
method setLoops (line 273) | public function setLoops(int $loops): CoreInterface
method first (line 286) | public function first(): FrameInterface
method last (line 296) | public function last(): FrameInterface
method toArray (line 306) | public function toArray(): array
method __clone (line 320) | public function __clone(): void
FILE: src/Drivers/Imagick/Decoders/Base64ImageDecoder.php
class Base64ImageDecoder (line 11) | class Base64ImageDecoder extends BinaryImageDecoder
method decode (line 18) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/BinaryImageDecoder.php
class BinaryImageDecoder (line 14) | class BinaryImageDecoder extends NativeObjectDecoder
method decode (line 21) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/DataUriImageDecoder.php
class DataUriImageDecoder (line 11) | class DataUriImageDecoder extends BinaryImageDecoder
method decode (line 18) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/EncodedImageObjectDecoder.php
class EncodedImageObjectDecoder (line 12) | class EncodedImageObjectDecoder extends BinaryImageDecoder
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/FilePathImageDecoder.php
class FilePathImageDecoder (line 13) | class FilePathImageDecoder extends NativeObjectDecoder
method decode (line 20) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/FilePointerImageDecoder.php
class FilePointerImageDecoder (line 11) | class FilePointerImageDecoder extends BinaryImageDecoder
method decode (line 18) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/NativeObjectDecoder.php
class NativeObjectDecoder (line 18) | class NativeObjectDecoder extends SpecializableDecoder implements Specia...
method decode (line 25) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Decoders/SplFileInfoImageDecoder.php
class SplFileInfoImageDecoder (line 12) | class SplFileInfoImageDecoder extends FilePathImageDecoder
method decode (line 19) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/Imagick/Driver.php
class Driver (line 23) | class Driver extends AbstractDriver
method id (line 30) | public function id(): string
method checkHealth (line 42) | public function checkHealth(): void
method createImage (line 56) | public function createImage(int $width, int $height): ImageInterface
method createAnimation (line 78) | public function createAnimation(callable $init): ImageInterface
method colorProcessor (line 127) | public function colorProcessor(ColorspaceInterface $colorspace): Color...
method fontProcessor (line 137) | public function fontProcessor(): FontProcessorInterface
method supports (line 147) | public function supports(string|Format|FileExtension|MediaType $identi...
method version (line 163) | public static function version(): string
FILE: src/Drivers/Imagick/Encoders/AvifEncoder.php
class AvifEncoder (line 15) | class AvifEncoder extends GenericAvifEncoder implements SpecializedInter...
method encode (line 17) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/BmpEncoder.php
class BmpEncoder (line 14) | class BmpEncoder extends GenericBmpEncoder implements SpecializedInterface
method encode (line 16) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/GifEncoder.php
class GifEncoder (line 14) | class GifEncoder extends GenericGifEncoder implements SpecializedInterface
method encode (line 16) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/HeicEncoder.php
class HeicEncoder (line 14) | class HeicEncoder extends GenericHeicEncoder implements SpecializedInter...
method encode (line 16) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/Jpeg2000Encoder.php
class Jpeg2000Encoder (line 15) | class Jpeg2000Encoder extends GenericJpeg2000Encoder implements Speciali...
method encode (line 17) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/JpegEncoder.php
class JpegEncoder (line 15) | class JpegEncoder extends GenericJpegEncoder implements SpecializedInter...
method encode (line 17) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/PngEncoder.php
class PngEncoder (line 14) | class PngEncoder extends GenericPngEncoder implements SpecializedInterface
method encode (line 21) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/TiffEncoder.php
class TiffEncoder (line 14) | class TiffEncoder extends GenericTiffEncoder implements SpecializedInter...
method encode (line 16) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/Encoders/WebpEncoder.php
class WebpEncoder (line 16) | class WebpEncoder extends GenericWebpEncoder implements SpecializedInter...
method encode (line 18) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Drivers/Imagick/FontProcessor.php
class FontProcessor (line 18) | class FontProcessor extends AbstractFontProcessor
method boxSize (line 25) | public function boxSize(string $text, FontInterface $font): SizeInterface
method toImagickDraw (line 50) | public function toImagickDraw(FontInterface $font, ?ImagickPixel $colo...
FILE: src/Drivers/Imagick/Frame.php
class Frame (line 19) | class Frame extends AbstractFrame implements FrameInterface
method __construct (line 27) | public function __construct(protected Imagick $native)
method toImage (line 39) | public function toImage(DriverInterface $driver): ImageInterface
method setNative (line 49) | public function setNative(mixed $native): FrameInterface
method native (line 61) | public function native(): Imagick
method size (line 71) | public function size(): SizeInterface
method delay (line 84) | public function delay(): float
method setDelay (line 94) | public function setDelay(float $delay): FrameInterface
method dispose (line 106) | public function dispose(): int
method setDispose (line 118) | public function setDispose(int $dispose): FrameInterface
method setOffset (line 134) | public function setOffset(int $left, int $top): FrameInterface
method offsetLeft (line 151) | public function offsetLeft(): int
method setOffsetLeft (line 161) | public function setOffsetLeft(int $offset): FrameInterface
method offsetTop (line 171) | public function offsetTop(): int
method setOffsetTop (line 181) | public function setOffsetTop(int $offset): FrameInterface
FILE: src/Drivers/Imagick/Modifiers/AlignRotationModifier.php
class AlignRotationModifier (line 12) | class AlignRotationModifier extends GenericAlignRotationModifier impleme...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/BlendTransparencyModifier.php
class BlendTransparencyModifier (line 12) | class BlendTransparencyModifier extends GenericBlendTransparencyModifier...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/BlurModifier.php
class BlurModifier (line 11) | class BlurModifier extends GenericBlurModifier implements SpecializedInt...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/BrightnessModifier.php
class BrightnessModifier (line 11) | class BrightnessModifier extends GenericBrightnessModifier implements Sp...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ColorizeModifier.php
class ColorizeModifier (line 12) | class ColorizeModifier extends GenericColorizeModifier implements Specia...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
method normalizeLevel (line 30) | private function normalizeLevel(int $level): int
FILE: src/Drivers/Imagick/Modifiers/ColorspaceModifier.php
class ColorspaceModifier (line 16) | class ColorspaceModifier extends GenericColorspaceModifier implements Sp...
method apply (line 28) | public function apply(ImageInterface $image): ImageInterface
method getImagickColorspace (line 43) | private function getImagickColorspace(ColorspaceInterface $colorspace)...
FILE: src/Drivers/Imagick/Modifiers/ContainModifier.php
class ContainModifier (line 13) | class ContainModifier extends GenericContainModifier implements Speciali...
method apply (line 15) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ContrastModifier.php
class ContrastModifier (line 11) | class ContrastModifier extends GenericContrastModifier implements Specia...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/CoverDownModifier.php
class CoverDownModifier (line 10) | class CoverDownModifier extends CoverModifier
method getResizeSize (line 15) | public function getResizeSize(SizeInterface $size): SizeInterface
FILE: src/Drivers/Imagick/Modifiers/CoverModifier.php
class CoverModifier (line 11) | class CoverModifier extends GenericCoverModifier implements SpecializedI...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/CropModifier.php
class CropModifier (line 13) | class CropModifier extends GenericCropModifier implements SpecializedInt...
method apply (line 15) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/DrawBezierModifier.php
class DrawBezierModifier (line 14) | class DrawBezierModifier extends GenericDrawBezierModifier implements Sp...
method apply (line 20) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/DrawEllipseModifier.php
class DrawEllipseModifier (line 13) | class DrawEllipseModifier extends GenericDrawEllipseModifier implements ...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/DrawLineModifier.php
class DrawLineModifier (line 13) | class DrawLineModifier extends GenericDrawLineModifier implements Specia...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/DrawPixelModifier.php
class DrawPixelModifier (line 12) | class DrawPixelModifier extends GenericDrawPixelModifier implements Spec...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/DrawPolygonModifier.php
class DrawPolygonModifier (line 14) | class DrawPolygonModifier extends GenericDrawPolygonModifier implements ...
method apply (line 19) | public function apply(ImageInterface $image): ImageInterface
method points (line 55) | private function points(): array
FILE: src/Drivers/Imagick/Modifiers/DrawRectangleModifier.php
class DrawRectangleModifier (line 13) | class DrawRectangleModifier extends GenericDrawRectangleModifier impleme...
method apply (line 18) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/FillModifier.php
class FillModifier (line 14) | class FillModifier extends ModifiersFillModifier implements SpecializedI...
method apply (line 16) | public function apply(ImageInterface $image): ImageInterface
method floodFillWithColor (line 33) | private function floodFillWithColor(Imagick $frame, ImagickPixel $pixe...
method fillAllWithColor (line 51) | private function fillAllWithColor(Imagick $frame, ImagickPixel $pixel)...
FILE: src/Drivers/Imagick/Modifiers/FlipModifier.php
class FlipModifier (line 11) | class FlipModifier extends GenericFlipModifier implements SpecializedInt...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/FlopModifier.php
class FlopModifier (line 11) | class FlopModifier extends ModifiersFlopModifier implements SpecializedI...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/GammaModifier.php
class GammaModifier (line 11) | class GammaModifier extends GenericGammaModifier implements SpecializedI...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/GreyscaleModifier.php
class GreyscaleModifier (line 11) | class GreyscaleModifier extends GenericGreyscaleModifier implements Spec...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/InvertModifier.php
class InvertModifier (line 11) | class InvertModifier extends GenericInvertModifier implements Specialize...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/PadModifier.php
class PadModifier (line 10) | class PadModifier extends ContainModifier
method getCropSize (line 12) | public function getCropSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Imagick/Modifiers/PixelateModifier.php
class PixelateModifier (line 12) | class PixelateModifier extends GenericPixelateModifier implements Specia...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
method pixelateFrame (line 23) | protected function pixelateFrame(FrameInterface $frame): void
FILE: src/Drivers/Imagick/Modifiers/PlaceModifier.php
class PlaceModifier (line 12) | class PlaceModifier extends GenericPlaceModifier implements SpecializedI...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ProfileModifier.php
class ProfileModifier (line 12) | class ProfileModifier extends GenericProfileModifier implements Speciali...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ProfileRemovalModifier.php
class ProfileRemovalModifier (line 12) | class ProfileRemovalModifier extends GenericProfileRemovalModifier imple...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/QuantizeColorsModifier.php
class QuantizeColorsModifier (line 12) | class QuantizeColorsModifier extends GenericQuantizeColorsModifier imple...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/RemoveAnimationModifier.php
class RemoveAnimationModifier (line 12) | class RemoveAnimationModifier extends GenericRemoveAnimationModifier imp...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ResizeCanvasModifier.php
class ResizeCanvasModifier (line 11) | class ResizeCanvasModifier extends GenericResizeCanvasModifier implement...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ResizeCanvasRelativeModifier.php
class ResizeCanvasRelativeModifier (line 10) | class ResizeCanvasRelativeModifier extends ResizeCanvasModifier
method cropSize (line 12) | protected function cropSize(ImageInterface $image, bool $relative = fa...
FILE: src/Drivers/Imagick/Modifiers/ResizeDownModifier.php
class ResizeDownModifier (line 10) | class ResizeDownModifier extends ResizeModifier
method getAdjustedSize (line 12) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Imagick/Modifiers/ResizeModifier.php
class ResizeModifier (line 13) | class ResizeModifier extends GenericResizeModifier implements Specialize...
method apply (line 15) | public function apply(ImageInterface $image): ImageInterface
method getAdjustedSize (line 32) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Imagick/Modifiers/ResolutionModifier.php
class ResolutionModifier (line 11) | class ResolutionModifier extends GenericResolutionModifier implements Sp...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/RotateModifier.php
class RotateModifier (line 11) | class RotateModifier extends GenericRotateModifier implements Specialize...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/ScaleDownModifier.php
class ScaleDownModifier (line 10) | class ScaleDownModifier extends ResizeModifier
method getAdjustedSize (line 12) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Imagick/Modifiers/ScaleModifier.php
class ScaleModifier (line 10) | class ScaleModifier extends ResizeModifier
method getAdjustedSize (line 12) | protected function getAdjustedSize(ImageInterface $image): SizeInterface
FILE: src/Drivers/Imagick/Modifiers/SharpenModifier.php
class SharpenModifier (line 11) | class SharpenModifier extends GenericSharpenModifier implements Speciali...
method apply (line 13) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/SliceAnimationModifier.php
class SliceAnimationModifier (line 12) | class SliceAnimationModifier extends GenericSliceAnimationModifier imple...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/StripMetaModifier.php
class StripMetaModifier (line 12) | class StripMetaModifier implements ModifierInterface, SpecializedInterface
method apply (line 19) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Imagick/Modifiers/TextModifier.php
class TextModifier (line 23) | class TextModifier extends GenericTextModifier implements SpecializedInt...
method apply (line 30) | public function apply(ImageInterface $image): ImageInterface
method imagickDrawText (line 60) | private function imagickDrawText(ImageInterface $image, FontInterface ...
method imagickDrawStroke (line 84) | private function imagickDrawStroke(ImageInterface $image, FontInterfac...
method maybeDrawTextline (line 107) | private function maybeDrawTextline(
method processor (line 129) | private function processor(): FontProcessor
FILE: src/Drivers/Imagick/Modifiers/TrimModifier.php
class TrimModifier (line 12) | class TrimModifier extends GenericTrimModifier implements SpecializedInt...
method apply (line 14) | public function apply(ImageInterface $image): ImageInterface
FILE: src/Drivers/Specializable.php
class Specializable (line 10) | abstract class Specializable implements SpecializableInterface
FILE: src/Drivers/SpecializableAnalyzer.php
class SpecializableAnalyzer (line 10) | abstract class SpecializableAnalyzer extends Specializable implements An...
method analyze (line 17) | public function analyze(ImageInterface $image): mixed
FILE: src/Drivers/SpecializableDecoder.php
class SpecializableDecoder (line 13) | abstract class SpecializableDecoder extends AbstractDecoder implements S...
method decode (line 22) | public function decode(mixed $input): ImageInterface|ColorInterface
FILE: src/Drivers/SpecializableEncoder.php
class SpecializableEncoder (line 10) | abstract class SpecializableEncoder extends AbstractEncoder implements S...
FILE: src/Drivers/SpecializableModifier.php
class SpecializableModifier (line 10) | abstract class SpecializableModifier extends Specializable implements Mo...
method apply (line 17) | public function apply(ImageInterface $image): ImageInterface
FILE: src/EncodedImage.php
class EncodedImage (line 9) | class EncodedImage extends File implements EncodedImageInterface
method __construct (line 16) | public function __construct(
method mediaType (line 28) | public function mediaType(): string
method mimetype (line 38) | public function mimetype(): string
method toDataUri (line 48) | public function toDataUri(): string
method __debugInfo (line 58) | public function __debugInfo(): array
FILE: src/Encoders/AutoEncoder.php
class AutoEncoder (line 10) | class AutoEncoder extends MediaTypeEncoder
method encode (line 17) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Encoders/AvifEncoder.php
class AvifEncoder (line 9) | class AvifEncoder extends SpecializableEncoder
method __construct (line 17) | public function __construct(
FILE: src/Encoders/BmpEncoder.php
class BmpEncoder (line 9) | class BmpEncoder extends SpecializableEncoder
method __construct (line 11) | public function __construct()
FILE: src/Encoders/FileExtensionEncoder.php
class FileExtensionEncoder (line 14) | class FileExtensionEncoder extends AutoEncoder
method __construct (line 29) | public function __construct(public null|string|FileExtension $extensio...
method encode (line 39) | public function encode(ImageInterface $image): EncodedImageInterface
method encoderByFileExtension (line 55) | protected function encoderByFileExtension(null|string|FileExtension $e...
FILE: src/Encoders/FilePathEncoder.php
class FilePathEncoder (line 10) | class FilePathEncoder extends FileExtensionEncoder
method __construct (line 17) | public function __construct(protected ?string $path = null, mixed ...$...
method encode (line 30) | public function encode(ImageInterface $image): EncodedImageInterface
FILE: src/Encoders/GifEncoder.php
class GifEncoder (line 9) | class GifEncoder extends SpecializableEncoder
method __construct (line 16) | public function __construct(public bool $interlaced = false)
FILE: src/Encoders/HeicEncoder.php
class HeicEncoder (line 9) | class HeicEncoder extends SpecializableEncoder
method __construct (line 17) | public function __construct(
FILE: src/Encoders/Jpeg2000Encoder.php
class Jpeg2000Encoder (line 9) | class Jpeg2000Encoder extends SpecializableEncoder
method __construct (line 17) | public function __construct(
FILE: src/Encoders/JpegEncoder.php
class JpegEncoder (line 9) | class JpegEncoder extends SpecializableEncoder
method __construct (line 17) | public function __construct(
FILE: src/Encoders/MediaTypeEncoder.php
class MediaTypeEncoder (line 15) | class MediaTypeEncoder extends AbstractEncoder
method __construct (line 30) | public function __construct(public null|string|MediaType $mediaType = ...
method encode (line 40) | public function encode(ImageInterface $image): EncodedImageInterface
method encoderByMediaType (line 54) | protected function encoderByMediaType(string|MediaType $mediaType): En...
FILE: src/Encoders/PngEncoder.php
class PngEncoder (line 9) | class PngEncoder extends SpecializableEncoder
method __construct (line 16) | public function __construct(public bool $interlaced = false, public bo...
FILE: src/Encoders/TiffEncoder.php
class TiffEncoder (line 9) | class TiffEncoder extends SpecializableEncoder
method __construct (line 17) | public function __construct(
FILE: src/Encoders/WebpEncoder.php
class WebpEncoder (line 9) | class WebpEncoder extends SpecializableEncoder
method __construct (line 17) | public function __construct(
FILE: src/Exceptions/AnimationException.php
class AnimationException (line 7) | class AnimationException extends RuntimeException
FILE: src/Exceptions/ColorException.php
class ColorException (line 7) | class ColorException extends RuntimeException
FILE: src/Exceptions/DecoderException.php
class DecoderException (line 7) | class DecoderException extends RuntimeException
FILE: src/Exceptions/DriverException.php
class DriverException (line 7) | class DriverException extends RuntimeException
FILE: src/Exceptions/EncoderException.php
class EncoderException (line 7) | class EncoderException extends RuntimeException
FILE: src/Exceptions/FontException.php
class FontException (line 7) | class FontException extends RuntimeException
FILE: src/Exceptions/GeometryException.php
class GeometryException (line 7) | class GeometryException extends RuntimeException
FILE: src/Exceptions/InputException.php
class InputException (line 7) | class InputException extends RuntimeException
FILE: src/Exceptions/NotSupportedException.php
class NotSupportedException (line 7) | class NotSupportedException extends RuntimeException
FILE: src/Exceptions/NotWritableException.php
class NotWritableException (line 7) | class NotWritableException extends RuntimeException
FILE: src/Exceptions/RuntimeException.php
class RuntimeException (line 7) | class RuntimeException extends \RuntimeException
FILE: src/File.php
class File (line 13) | class File implements FileInterface, Stringable
method __construct (line 28) | public function __construct(mixed $data = null)
method fromPath (line 38) | public static function fromPath(string $path): self
method save (line 48) | public function save(string $filepath): void
method toString (line 84) | public function toString(): string
method toFilePointer (line 94) | public function toFilePointer()
method size (line 106) | public function size(): int
method __toString (line 118) | public function __toString(): string
FILE: src/FileExtension.php
method create (line 39) | public static function create(string|self|Format|MediaType $identifier):...
method tryCreate (line 72) | public static function tryCreate(string|self|Format|MediaType $identifie...
method format (line 84) | public function format(): Format
method mediaTypes (line 115) | public function mediaTypes(): array
method mediaType (line 123) | public function mediaType(): MediaType
FILE: src/Format.php
method create (line 40) | public static function create(string|self|MediaType|FileExtension $ident...
method tryCreate (line 73) | public static function tryCreate(string|self|MediaType|FileExtension $id...
method mediaTypes (line 87) | public function mediaTypes(): array
method mediaType (line 98) | public function mediaType(): MediaType
method fileExtensions (line 110) | public function fileExtensions(): array
method fileExtension (line 121) | public function fileExtension(): FileExtension
method encoder (line 131) | public function encoder(mixed ...$options): EncoderInterface
FILE: src/Geometry/Bezier.php
class Bezier (line 21) | class Bezier implements IteratorAggregate, Countable, ArrayAccess, Drawa...
method __construct (line 32) | public function __construct(
method position (line 44) | public function position(): PointInterface
method setPosition (line 54) | public function setPosition(PointInterface $position): DrawableInterface
method getIterator (line 66) | public function getIterator(): Traversable
method pivot (line 74) | public function pivot(): PointInterface
method setPivot (line 82) | public function setPivot(PointInterface $pivot): self
method first (line 92) | public function first(): ?PointInterface
method second (line 104) | public function second(): ?PointInterface
method third (line 116) | public function third(): ?PointInterface
method last (line 128) | public function last(): ?PointInterface
method count (line 140) | public function count(): int
method offsetExists (line 148) | public function offsetExists(mixed $offset): bool
method offsetGet (line 156) | public function offsetGet(mixed $offset): mixed
method offsetSet (line 164) | public function offsetSet(mixed $offset, mixed $value): void
method offsetUnset (line 172) | public function offsetUnset(mixed $offset): void
method addPoint (line 180) | public function addPoint(PointInterface $point): self
method toArray (line 192) | public function toArray(): array
FILE: src/Geometry/Circle.php
class Circle (line 9) | class Circle extends Ellipse
method __construct (line 16) | public function __construct(
method setDiameter (line 26) | public function setDiameter(int $diameter): self
method diameter (line 37) | public function diameter(): int
method setRadius (line 45) | public function setRadius(int $radius): self
method radius (line 53) | public function radius(): int
FILE: src/Geometry/Ellipse.php
class Ellipse (line 12) | class Ellipse implements DrawableInterface
method __construct (line 22) | public function __construct(
method position (line 35) | public function position(): PointInterface
method setPosition (line 45) | public function setPosition(PointInterface $position): self
method pivot (line 55) | public function pivot(): PointInterface
method setSize (line 63) | public function setSize(int $width, int $height): self
method setWidth (line 71) | public function setWidth(int $width): self
method setHeight (line 81) | public function setHeight(int $height): self
method width (line 91) | public function width(): int
method height (line 99) | public function height(): int
FILE: src/Geometry/Factories/BezierFactory.php
class BezierFactory (line 13) | class BezierFactory implements DrawableFactoryInterface
method __construct (line 22) | public function __construct(null|Closure|Bezier $init = null)
method init (line 36) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 46) | public function create(): DrawableInterface
method point (line 54) | public function point(int $x, int $y): self
method background (line 64) | public function background(mixed $color): self
method border (line 74) | public function border(mixed $color, int $size = 1): self
method __invoke (line 84) | public function __invoke(): Bezier
FILE: src/Geometry/Factories/CircleFactory.php
class CircleFactory (line 14) | class CircleFactory implements DrawableFactoryInterface
method __construct (line 23) | public function __construct(
method init (line 40) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 50) | public function create(): DrawableInterface
method radius (line 58) | public function radius(int $radius): self
method diameter (line 68) | public function diameter(int $diameter): self
method background (line 78) | public function background(mixed $color): self
method border (line 88) | public function border(mixed $color, int $size = 1): self
method __invoke (line 98) | public function __invoke(): Circle
FILE: src/Geometry/Factories/Drawable.php
class Drawable (line 7) | class Drawable
method bezier (line 12) | public static function bezier(): BezierFactory
method circle (line 20) | public static function circle(): CircleFactory
method ellipse (line 28) | public static function ellipse(): EllipseFactory
method line (line 36) | public static function line(): LineFactory
method polygon (line 44) | public static function polygon(): PolygonFactory
method rectangle (line 52) | public static function rectangle(): RectangleFactory
FILE: src/Geometry/Factories/EllipseFactory.php
class EllipseFactory (line 14) | class EllipseFactory implements DrawableFactoryInterface
method __construct (line 23) | public function __construct(
method init (line 40) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 50) | public function create(): DrawableInterface
method size (line 58) | public function size(int $width, int $height): self
method width (line 68) | public function width(int $width): self
method height (line 78) | public function height(int $height): self
method background (line 88) | public function background(mixed $color): self
method border (line 98) | public function border(mixed $color, int $size = 1): self
method __invoke (line 108) | public function __invoke(): Ellipse
FILE: src/Geometry/Factories/LineFactory.php
class LineFactory (line 13) | class LineFactory implements DrawableFactoryInterface
method __construct (line 22) | public function __construct(null|Closure|Line $init = null)
method init (line 36) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 46) | public function create(): DrawableInterface
method color (line 54) | public function color(mixed $color): self
method background (line 65) | public function background(mixed $color): self
method border (line 76) | public function border(mixed $color, int $size = 1): self
method width (line 88) | public function width(int $size): self
method from (line 98) | public function from(int $x, int $y): self
method to (line 108) | public function to(int $x, int $y): self
method __invoke (line 118) | public function __invoke(): Line
FILE: src/Geometry/Factories/PolygonFactory.php
class PolygonFactory (line 13) | class PolygonFactory implements DrawableFactoryInterface
method __construct (line 22) | public function __construct(null|Closure|Polygon $init = null)
method init (line 36) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 46) | public function create(): DrawableInterface
method point (line 54) | public function point(int $x, int $y): self
method background (line 64) | public function background(mixed $color): self
method border (line 74) | public function border(mixed $color, int $size = 1): self
method __invoke (line 84) | public function __invoke(): Polygon
FILE: src/Geometry/Factories/RectangleFactory.php
class RectangleFactory (line 14) | class RectangleFactory implements DrawableFactoryInterface
method __construct (line 23) | public function __construct(
method init (line 40) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 50) | public function create(): DrawableInterface
method size (line 58) | public function size(int $width, int $height): self
method width (line 68) | public function width(int $width): self
method height (line 78) | public function height(int $height): self
method background (line 88) | public function background(mixed $color): self
method border (line 98) | public function border(mixed $color, int $size = 1): self
method __invoke (line 108) | public function __invoke(): Rectangle
FILE: src/Geometry/Line.php
class Line (line 12) | class Line implements DrawableInterface
method __construct (line 22) | public function __construct(
method position (line 35) | public function position(): PointInterface
method setPosition (line 45) | public function setPosition(PointInterface $position): DrawableInterface
method width (line 55) | public function width(): int
method setWidth (line 63) | public function setWidth(int $width): self
method start (line 73) | public function start(): PointInterface
method end (line 81) | public function end(): PointInterface
method setStart (line 89) | public function setStart(PointInterface $start): self
method from (line 99) | public function from(int $x, int $y): self
method to (line 110) | public function to(int $x, int $y): self
method setEnd (line 121) | public function setEnd(PointInterface $end): self
FILE: src/Geometry/Pixel.php
class Pixel (line 9) | class Pixel extends Point
method __construct (line 16) | public function __construct(
method setBackgroundColor (line 29) | public function setBackgroundColor(ColorInterface $background): self
method backgroundColor (line 41) | public function backgroundColor(): ColorInterface
FILE: src/Geometry/Point.php
class Point (line 15) | class Point implements PointInterface, IteratorAggregate
method __construct (line 22) | public function __construct(
method getIterator (line 34) | public function getIterator(): Traversable
method setX (line 44) | public function setX(int $x): self
method x (line 56) | public function x(): int
method setY (line 66) | public function setY(int $y): self
method y (line 78) | public function y(): int
method moveX (line 88) | public function moveX(int $value): self
method moveY (line 100) | public function moveY(int $value): self
method move (line 112) | public function move(int $x, int $y): self
method setPosition (line 122) | public function setPosition(int $x, int $y): self
method rotate (line 135) | public function rotate(float $angle, PointInterface $pivot): self
FILE: src/Geometry/Polygon.php
class Polygon (line 21) | class Polygon implements IteratorAggregate, Countable, ArrayAccess, Draw...
method __construct (line 32) | public function __construct(
method position (line 44) | public function position(): PointInterface
method setPosition (line 54) | public function setPosition(PointInterface $position): self
method getIterator (line 66) | public function getIterator(): Traversable
method pivot (line 74) | public function pivot(): PointInterface
method setPivot (line 82) | public function setPivot(PointInterface $pivot): self
method first (line 92) | public function first(): ?PointInterface
method last (line 104) | public function last(): ?PointInterface
method count (line 116) | public function count(): int
method offsetExists (line 124) | public function offsetExists(mixed $offset): bool
method offsetGet (line 132) | public function offsetGet(mixed $offset): mixed
method offsetSet (line 140) | public function offsetSet(mixed $offset, mixed $value): void
method offsetUnset (line 148) | public function offsetUnset(mixed $offset): void
method addPoint (line 156) | public function addPoint(PointInterface $point): self
method width (line 166) | public function width(): int
method height (line 174) | public function height(): int
method mostLeftPoint (line 182) | public function mostLeftPoint(): PointInterface
method mostRightPoint (line 199) | public function mostRightPoint(): PointInterface
method mostTopPoint (line 216) | public function mostTopPoint(): PointInterface
method mostBottomPoint (line 233) | public function mostBottomPoint(): PointInterface
method centerPoint (line 250) | public function centerPoint(): PointInterface
method align (line 261) | public function align(string $position): self
method valign (line 291) | public function valign(string $position): self
method rotate (line 321) | public function rotate(float $angle): self
method movePointsX (line 354) | public function movePointsX(int $amount): self
method movePointsY (line 366) | public function movePointsY(int $amount): self
method toArray (line 380) | public function toArray(): array
FILE: src/Geometry/Rectangle.php
class Rectangle (line 12) | class Rectangle extends Polygon implements SizeInterface
method __construct (line 19) | public function __construct(
method setSize (line 33) | public function setSize(int $width, int $height): self
method setWidth (line 41) | public function setWidth(int $width): self
method setHeight (line 52) | public function setHeight(int $height): self
method pivot (line 63) | public function pivot(): PointInterface
method setPivot (line 71) | public function setPivot(PointInterface $pivot): self
method movePivot (line 82) | public function movePivot(string $position, int $offset_x = 0, int $of...
method alignPivotTo (line 163) | public function alignPivotTo(SizeInterface $size, string $position): self
method relativePositionTo (line 178) | public function relativePositionTo(SizeInterface $rectangle): PointInt...
method aspectRatio (line 189) | public function aspectRatio(): float
method fitsInto (line 197) | public function fitsInto(SizeInterface $size): bool
method isLandscape (line 213) | public function isLandscape(): bool
method isPortrait (line 221) | public function isPortrait(): bool
method topLeftPoint (line 229) | public function topLeftPoint(): PointInterface
method bottomRightPoint (line 237) | public function bottomRightPoint(): PointInterface
method resize (line 247) | public function resize(?int $width = null, ?int $height = null): SizeI...
method resizeDown (line 257) | public function resizeDown(?int $width = null, ?int $height = null): S...
method scale (line 267) | public function scale(?int $width = null, ?int $height = null): SizeIn...
method scaleDown (line 277) | public function scaleDown(?int $width = null, ?int $height = null): Si...
method cover (line 287) | public function cover(int $width, int $height): SizeInterface
method contain (line 297) | public function contain(int $width, int $height): SizeInterface
method containMax (line 307) | public function containMax(int $width, int $height): SizeInterface
method resizer (line 317) | protected function resizer(?int $width = null, ?int $height = null): R...
method __debugInfo (line 327) | public function __debugInfo(): array
FILE: src/Geometry/Tools/RectangleResizer.php
class RectangleResizer (line 11) | class RectangleResizer
method __construct (line 17) | public function __construct(
method to (line 39) | public static function to(mixed ...$arguments): self
method hasTargetWidth (line 47) | protected function hasTargetWidth(): bool
method getTargetWidth (line 55) | protected function getTargetWidth(): ?int
method hasTargetHeight (line 63) | protected function hasTargetHeight(): bool
method getTargetHeight (line 71) | protected function getTargetHeight(): ?int
method getTargetSize (line 81) | protected function getTargetSize(): SizeInterface
method toWidth (line 93) | public function toWidth(int $width): self
method toHeight (line 103) | public function toHeight(int $height): self
method toSize (line 113) | public function toSize(SizeInterface $size): self
method getProportionalWidth (line 124) | protected function getProportionalWidth(SizeInterface $size): int
method getProportionalHeight (line 136) | protected function getProportionalHeight(SizeInterface $size): int
method resize (line 148) | public function resize(SizeInterface $size): SizeInterface
method resizeDown (line 166) | public function resizeDown(SizeInterface $size): SizeInterface
method scale (line 188) | public function scale(SizeInterface $size): SizeInterface
method scaleDown (line 215) | public function scaleDown(SizeInterface $size): SizeInterface
method cover (line 259) | public function cover(SizeInterface $size): SizeInterface
method contain (line 282) | public function contain(SizeInterface $size): SizeInterface
method containDown (line 305) | public function containDown(SizeInterface $size): SizeInterface
method crop (line 334) | public function crop(SizeInterface $size, string $position = 'top-left...
FILE: src/Geometry/Traits/HasBackgroundColor.php
type HasBackgroundColor (line 7) | trait HasBackgroundColor
method setBackgroundColor (line 16) | public function setBackgroundColor(mixed $color): self
method backgroundColor (line 28) | public function backgroundColor(): mixed
method hasBackgroundColor (line 38) | public function hasBackgroundColor(): bool
FILE: src/Geometry/Traits/HasBorder.php
type HasBorder (line 7) | trait HasBorder
method setBorder (line 17) | public function setBorder(mixed $color, int $size = 1): self
method setBorderSize (line 27) | public function setBorderSize(int $size): self
method borderSize (line 39) | public function borderSize(): int
method setBorderColor (line 49) | public function setBorderColor(mixed $color): self
method borderColor (line 61) | public function borderColor(): mixed
method hasBorder (line 71) | public function hasBorder(): bool
FILE: src/Image.php
class Image (line 103) | final class Image implements ImageInterface
method __construct (line 116) | public function __construct(
method driver (line 129) | public function driver(): DriverInterface
method core (line 139) | public function core(): CoreInterface
method origin (line 149) | public function origin(): Origin
method setOrigin (line 159) | public function setOrigin(Origin $origin): ImageInterface
method count (line 171) | public function count(): int
method getIterator (line 181) | public function getIterator(): Traversable
method isAnimated (line 191) | public function isAnimated(): bool
method removeAnimation (line 201) | public function removeAnimation(int|string $position = 0): ImageInterface
method sliceAnimation (line 211) | public function sliceAnimation(int $offset = 0, ?int $length = null): ...
method loops (line 221) | public function loops(): int
method setLoops (line 231) | public function setLoops(int $loops): ImageInterface
method exif (line 243) | public function exif(?string $query = null): mixed
method setExif (line 253) | public function setExif(CollectionInterface $exif): ImageInterface
method modify (line 265) | public function modify(ModifierInterface $modifier): ImageInterface
method analyze (line 275) | public function analyze(AnalyzerInterface $analyzer): mixed
method encode (line 285) | public function encode(EncoderInterface $encoder = new AutoEncoder()):...
method save (line 295) | public function save(?string $path = null, mixed ...$options): ImageIn...
method width (line 321) | public function width(): int
method height (line 331) | public function height(): int
method size (line 341) | public function size(): SizeInterface
method colorspace (line 351) | public function colorspace(): ColorspaceInterface
method setColorspace (line 361) | public function setColorspace(string|ColorspaceInterface $colorspace):...
method resolution (line 371) | public function resolution(): ResolutionInterface
method setResolution (line 381) | public function setResolution(float $x, float $y): ImageInterface
method pickColor (line 391) | public function pickColor(int $x, int $y, int $frame_key = 0): ColorIn...
method pickColors (line 401) | public function pickColors(int $x, int $y): CollectionInterface
method blendingColor (line 411) | public function blendingColor(): ColorInterface
method setBlendingColor (line 423) | public function setBlendingColor(mixed $color): ImageInterface
method blendTransparency (line 437) | public function blendTransparency(mixed $color = null): ImageInterface
method profile (line 447) | public function profile(): ProfileInterface
method setProfile (line 457) | public function setProfile(ProfileInterface $profile): ImageInterface
method removeProfile (line 467) | public function removeProfile(): ImageInterface
method reduceColors (line 477) | public function reduceColors(int $limit, mixed $background = 'transpar...
method sharpen (line 487) | public function sharpen(int $amount = 10): ImageInterface
method invert (line 497) | public function invert(): ImageInterface
method pixelate (line 507) | public function pixelate(int $size): ImageInterface
method greyscale (line 517) | public function greyscale(): ImageInterface
method brightness (line 527) | public function brightness(int $level): ImageInterface
method contrast (line 537) | public function contrast(int $level): ImageInterface
method gamma (line 547) | public function gamma(float $gamma): ImageInterface
method colorize (line 557) | public function colorize(int $red = 0, int $green = 0, int $blue = 0):...
method flip (line 567) | public function flip(): ImageInterface
method flop (line 577) | public function flop(): ImageInterface
method blur (line 587) | public function blur(int $amount = 5): ImageInterface
method rotate (line 597) | public function rotate(float $angle, mixed $background = 'ffffff'): Im...
method orient (line 607) | public function orient(): ImageInterface
method text (line 617) | public function text(string $text, int $x, int $y, callable|Closure|Fo...
method resize (line 633) | public function resize(?int $width = null, ?int $height = null): Image...
method resizeDown (line 643) | public function resizeDown(?int $width = null, ?int $height = null): I...
method scale (line 653) | public function scale(?int $width = null, ?int $height = null): ImageI...
method scaleDown (line 663) | public function scaleDown(?int $width = null, ?int $height = null): Im...
method cover (line 673) | public function cover(int $width, int $height, string $position = 'cen...
method coverDown (line 683) | public function coverDown(int $width, int $height, string $position = ...
method resizeCanvas (line 693) | public function resizeCanvas(
method resizeCanvasRelative (line 707) | public function resizeCanvasRelative(
method pad (line 721) | public function pad(
method contain (line 735) | public function contain(
method crop (line 749) | public function crop(
method trim (line 765) | public function trim(int $tolerance = 0): ImageInterface
method place (line 775) | public function place(
method fill (line 790) | public function fill(mixed $color, ?int $x = null, ?int $y = null): Im...
method drawPixel (line 805) | public function drawPixel(int $x, int $y, mixed $color): ImageInterface
method drawRectangle (line 815) | public function drawRectangle(int $x, int $y, callable|Closure|Rectang...
method drawEllipse (line 829) | public function drawEllipse(int $x, int $y, callable|Closure|Ellipse $...
method drawCircle (line 843) | public function drawCircle(int $x, int $y, callable|Closure|Circle $in...
method drawPolygon (line 857) | public function drawPolygon(callable|Closure|Polygon $init): ImageInte...
method drawLine (line 871) | public function drawLine(callable|Closure|Line $init): ImageInterface
method drawBezier (line 885) | public function drawBezier(callable|Closure|Bezier $init): ImageInterface
method encodeByMediaType (line 899) | public function encodeByMediaType(null|string|MediaType $type = null, ...
method encodeByExtension (line 909) | public function encodeByExtension(
method encodeByPath (line 921) | public function encodeByPath(?string $path = null, mixed ...$options):...
method toJpeg (line 931) | public function toJpeg(mixed ...$options): EncodedImageInterface
method toJpg (line 941) | public function toJpg(mixed ...$options): EncodedImageInterface
method toJpeg2000 (line 951) | public function toJpeg2000(mixed ...$options): EncodedImageInterface
method toJp2 (line 961) | public function toJp2(mixed ...$options): EncodedImageInterface
method toPng (line 971) | public function toPng(mixed ...$options): EncodedImageInterface
method toGif (line 981) | public function toGif(mixed ...$options): EncodedImageInterface
method toWebp (line 991) | public function toWebp(mixed ...$options): EncodedImageInterface
method toBitmap (line 1001) | public function toBitmap(mixed ...$options): EncodedImageInterface
method toBmp (line 1011) | public function toBmp(mixed ...$options): EncodedImageInterface
method toAvif (line 1021) | public function toAvif(mixed ...$options): EncodedImageInterface
method toTiff (line 1031) | public function toTiff(mixed ...$options): EncodedImageInterface
method toTif (line 1041) | public function toTif(mixed ...$options): EncodedImageInterface
method toHeic (line 1051) | public function toHeic(mixed ...$options): EncodedImageInterface
method __debugInfo (line 1061) | public function __debugInfo(): array
method __clone (line 1076) | public function __clone(): void
FILE: src/ImageManager.php
class ImageManager (line 16) | final class ImageManager implements ImageManagerInterface
method __construct (line 26) | public function __construct(string|DriverInterface $driver, mixed ...$...
method withDriver (line 39) | public static function withDriver(string|DriverInterface $driver, mixe...
method gd (line 52) | public static function gd(mixed ...$options): self
method imagick (line 65) | public static function imagick(mixed ...$options): self
method create (line 75) | public function create(int $width, int $height): ImageInterface
method read (line 85) | public function read(mixed $input, string|array|DecoderInterface $deco...
method animate (line 101) | public function animate(callable $init): ImageInterface
method driver (line 111) | public function driver(): DriverInterface
method resolveDriver (line 122) | private static function resolveDriver(string|DriverInterface $driver, ...
FILE: src/InputHandler.php
class InputHandler (line 33) | class InputHandler implements InputHandlerInterface
method __construct (line 71) | public function __construct(array $decoders = [], ?DriverInterface $dr...
method withDecoders (line 82) | public static function withDecoders(array $decoders, ?DriverInterface ...
method handle (line 92) | public function handle(mixed $input): ImageInterface|ColorInterface
method resolve (line 116) | private function resolve(string|DecoderInterface $decoder): DecoderInt...
FILE: src/Interfaces/AnalyzerInterface.php
type AnalyzerInterface (line 9) | interface AnalyzerInterface
method analyze (line 16) | public function analyze(ImageInterface $image): mixed;
FILE: src/Interfaces/CollectionInterface.php
type CollectionInterface (line 12) | interface CollectionInterface extends Traversable
method has (line 17) | public function has(int|string $key): bool;
method push (line 24) | public function push(mixed $item): self;
method get (line 29) | public function get(int|string $key, mixed $default = null): mixed;
method getAtPosition (line 34) | public function getAtPosition(int $key = 0, mixed $default = null): mi...
method first (line 39) | public function first(): mixed;
method last (line 44) | public function last(): mixed;
method count (line 49) | public function count(): int;
method empty (line 56) | public function empty(): self;
method toArray (line 63) | public function toArray(): array;
method slice (line 70) | public function slice(int $offset, ?int $length = 0): self;
FILE: src/Interfaces/ColorChannelInterface.php
type ColorChannelInterface (line 9) | interface ColorChannelInterface
method __construct (line 16) | public function __construct(?int $value = null, ?float $normalized = n...
method value (line 21) | public function value(): int;
method normalize (line 26) | public function normalize(int $precision = 32): float;
method validate (line 34) | public function validate(mixed $value): mixed;
method min (line 39) | public function min(): int;
method max (line 46) | public function max(): int;
method toString (line 51) | public function toString(): string;
method __toString (line 56) | public function __toString(): string;
FILE: src/Interfaces/ColorInterface.php
type ColorInterface (line 10) | interface ColorInterface
method create (line 18) | public static function create(mixed $input): self;
method colorspace (line 23) | public function colorspace(): ColorspaceInterface;
method toString (line 28) | public function toString(): string;
method toArray (line 35) | public function toArray(): array;
method toHex (line 40) | public function toHex(string $prefix = ''): string;
method channels (line 47) | public function channels(): array;
method normalize (line 54) | public function normalize(): array;
method channel (line 61) | public function channel(string $classname): ColorChannelInterface;
method convertTo (line 66) | public function convertTo(string|ColorspaceInterface $colorspace): self;
method isGreyscale (line 71) | public function isGreyscale(): bool;
method isTransparent (line 76) | public function isTransparent(): bool;
method isClear (line 81) | public function isClear(): bool;
method __toString (line 86) | public function __toString(): string;
FILE: src/Interfaces/ColorProcessorInterface.php
type ColorProcessorInterface (line 9) | interface ColorProcessorInterface
method colorToNative (line 16) | public function colorToNative(ColorInterface $color): mixed;
method nativeToColor (line 23) | public function nativeToColor(mixed $native): ColorInterface;
FILE: src/Interfaces/ColorspaceInterface.php
type ColorspaceInterface (line 7) | interface ColorspaceInterface
method importColor (line 12) | public function importColor(ColorInterface $color): ColorInterface;
method colorFromNormalized (line 19) | public function colorFromNormalized(array $normalized): ColorInterface;
FILE: src/Interfaces/CoreInterface.php
type CoreInterface (line 9) | interface CoreInterface extends CollectionInterface
method native (line 16) | public function native(): mixed;
method setNative (line 23) | public function setNative(mixed $native): self;
method count (line 28) | public function count(): int;
method frame (line 35) | public function frame(int $position): FrameInterface;
method add (line 42) | public function add(FrameInterface $frame): self;
method loops (line 47) | public function loops(): int;
method setLoops (line 55) | public function setLoops(int $loops): self;
method first (line 62) | public function first(): FrameInterface;
method last (line 69) | public function last(): FrameInterface;
FILE: src/Interfaces/DecoderInterface.php
type DecoderInterface (line 9) | interface DecoderInterface
method decode (line 16) | public function decode(mixed $input): ImageInterface|ColorInterface;
FILE: src/Interfaces/DrawableFactoryInterface.php
type DrawableFactoryInterface (line 9) | interface DrawableFactoryInterface
method init (line 14) | public static function init(null|Closure|DrawableInterface $init = nul...
method create (line 19) | public function create(): DrawableInterface;
method background (line 24) | public function background(mixed $color): self;
method border (line 29) | public function border(mixed $color, int $size = 1): self;
method __invoke (line 34) | public function __invoke(): DrawableInterface;
FILE: src/Interfaces/DrawableInterface.php
type DrawableInterface (line 7) | interface DrawableInterface
method position (line 12) | public function position(): PointInterface;
method setPosition (line 17) | public function setPosition(PointInterface $position): self;
method setBackgroundColor (line 22) | public function setBackgroundColor(mixed $color): self;
method backgroundColor (line 27) | public function backgroundColor(): mixed;
method hasBackgroundColor (line 32) | public function hasBackgroundColor(): bool;
method setBorder (line 37) | public function setBorder(mixed $color, int $size = 1): self;
method setBorderSize (line 42) | public function setBorderSize(int $size): self;
method setBorderColor (line 47) | public function setBorderColor(mixed $color): self;
method borderSize (line 52) | public function borderSize(): int;
method borderColor (line 57) | public function borderColor(): mixed;
method hasBorder (line 62) | public function hasBorder(): bool;
FILE: src/Interfaces/DriverInterface.php
type DriverInterface (line 15) | interface DriverInterface
method id (line 20) | public function id(): string;
method config (line 25) | public function config(): Config;
method specialize (line 33) | public function specialize(
method specializeMultiple (line 45) | public function specializeMultiple(array $objects): array;
method createImage (line 52) | public function createImage(int $width, int $height): ImageInterface;
method createAnimation (line 59) | public function createAnimation(callable $init): ImageInterface;
method handleInput (line 67) | public function handleInput(mixed $input, array $decoders = []): Image...
method colorProcessor (line 72) | public function colorProcessor(ColorspaceInterface $colorspace): Color...
method fontProcessor (line 77) | public function fontProcessor(): FontProcessorInterface;
method checkHealth (line 85) | public function checkHealth(): void;
method supports (line 91) | public function supports(string|Format|FileExtension|MediaType $identi...
FILE: src/Interfaces/EncodedImageInterface.php
type EncodedImageInterface (line 7) | interface EncodedImageInterface extends FileInterface
method mediaType (line 12) | public function mediaType(): string;
method mimetype (line 17) | public function mimetype(): string;
method toDataUri (line 22) | public function toDataUri(): string;
FILE: src/Interfaces/EncoderInterface.php
type EncoderInterface (line 9) | interface EncoderInterface
method encode (line 16) | public function encode(ImageInterface $image): EncodedImageInterface;
FILE: src/Interfaces/FileInterface.php
type FileInterface (line 9) | interface FileInterface
method save (line 16) | public function save(string $filepath): void;
method toFilePointer (line 23) | public function toFilePointer();
method size (line 28) | public function size(): int;
method toString (line 33) | public function toString(): string;
method __toString (line 38) | public function __toString(): string;
FILE: src/Interfaces/FontInterface.php
type FontInterface (line 9) | interface FontInterface
method setColor (line 14) | public function setColor(mixed $color): self;
method color (line 19) | public function color(): mixed;
method setStrokeColor (line 24) | public function setStrokeColor(mixed $color): self;
method strokeColor (line 29) | public function strokeColor(): mixed;
method setStrokeWidth (line 37) | public function setStrokeWidth(int $width): self;
method strokeWidth (line 42) | public function strokeWidth(): int;
method hasStrokeEffect (line 47) | public function hasStrokeEffect(): bool;
method setSize (line 52) | public function setSize(float $size): self;
method size (line 57) | public function size(): float;
method setAngle (line 62) | public function setAngle(float $angle): self;
method angle (line 67) | public function angle(): float;
method setFilename (line 72) | public function setFilename(string $filename): self;
method filename (line 77) | public function filename(): ?string;
method hasFilename (line 82) | public function hasFilename(): bool;
method setAlignment (line 87) | public function setAlignment(string $align): self;
method alignment (line 92) | public function alignment(): string;
method setValignment (line 97) | public function setValignment(string $align): self;
method valignment (line 102) | public function valignment(): string;
method setLineHeight (line 107) | public function setLineHeight(float $value): self;
method lineHeight (line 112) | public function lineHeight(): float;
method setWrapWidth (line 117) | public function setWrapWidth(?int $width): self;
method wrapWidth (line 122) | public function wrapWidth(): ?int;
FILE: src/Interfaces/FontProcessorInterface.php
type FontProcessorInterface (line 10) | interface FontProcessorInterface
method boxSize (line 17) | public function boxSize(string $text, FontInterface $font): SizeInterf...
method textBlock (line 25) | public function textBlock(string $text, FontInterface $font, PointInte...
method nativeFontSize (line 30) | public function nativeFontSize(FontInterface $font): float;
method typographicalSize (line 37) | public function typographicalSize(FontInterface $font): int;
method capHeight (line 44) | public function capHeight(FontInterface $font): int;
method leading (line 51) | public function leading(FontInterface $font): int;
FILE: src/Interfaces/FrameInterface.php
type FrameInterface (line 9) | interface FrameInterface
method native (line 14) | public function native(): mixed;
method setNative (line 19) | public function setNative(mixed $native): self;
method toImage (line 26) | public function toImage(DriverInterface $driver): ImageInterface;
method size (line 31) | public function size(): SizeInterface;
method delay (line 36) | public function delay(): float;
method setDelay (line 41) | public function setDelay(float $delay): self;
method dispose (line 46) | public function dispose(): int;
method setDispose (line 51) | public function setDispose(int $dispose): self;
method setOffset (line 56) | public function setOffset(int $left, int $top): self;
method offsetLeft (line 61) | public function offsetLeft(): int;
method setOffsetLeft (line 66) | public function setOffsetLeft(int $offset): self;
method offsetTop (line 71) | public function offsetTop(): int;
method setOffsetTop (line 76) | public function setOffsetTop(int $offset): self;
FILE: src/Interfaces/ImageInterface.php
type ImageInterface (line 26) | interface ImageInterface extends IteratorAggregate, Countable
method driver (line 31) | public function driver(): DriverInterface;
method core (line 36) | public function core(): CoreInterface;
method origin (line 41) | public function origin(): Origin;
method setOrigin (line 46) | public function setOrigin(Origin $origin): self;
method width (line 55) | public function width(): int;
method height (line 64) | public function height(): int;
method size (line 73) | public function size(): SizeInterface;
method encode (line 82) | public function encode(EncoderInterface $encoder = new AutoEncoder()):...
method save (line 92) | public function save(?string $path = null, mixed ...$options): self;
method modify (line 101) | public function modify(ModifierInterface $modifier): self;
method analyze (line 108) | public function analyze(AnalyzerInterface $analyzer): mixed;
method isAnimated (line 115) | public function isAnimated(): bool;
method removeAnimation (line 129) | public function removeAnimation(int|string $position = 0): self;
method sliceAnimation (line 138) | public function sliceAnimation(int $offset = 0, ?int $length = null): ...
method loops (line 145) | public function loops(): int;
method setLoops (line 152) | public function setLoops(int $loops): self;
method exif (line 159) | public function exif(?string $query = null): mixed;
method setExif (line 164) | public function setExif(CollectionInterface $exif): self;
method resolution (line 173) | public function resolution(): ResolutionInterface;
method setResolution (line 182) | public function setResolution(float $x, float $y): self;
method colorspace (line 191) | public function colorspace(): ColorspaceInterface;
method setColorspace (line 200) | public function setColorspace(string|ColorspaceInterface $colorspace):...
method pickColor (line 209) | public function pickColor(int $x, int $y, int $frame_key = 0): ColorIn...
method pickColors (line 218) | public function pickColors(int $x, int $y): CollectionInterface;
method blendingColor (line 226) | public function blendingColor(): ColorInterface;
method setBlendingColor (line 234) | public function setBlendingColor(mixed $color): self;
method blendTransparency (line 241) | public function blendTransparency(mixed $color = null): self;
method profile (line 250) | public function profile(): ProfileInterface;
method setProfile (line 259) | public function setProfile(ProfileInterface $profile): self;
method removeProfile (line 268) | public function removeProfile(): self;
method reduceColors (line 277) | public function reduceColors(int $limit, mixed $background = 'transpar...
method sharpen (line 286) | public function sharpen(int $amount = 10): self;
method greyscale (line 295) | public function greyscale(): self;
method brightness (line 304) | public function brightness(int $level): self;
method contrast (line 313) | public function contrast(int $level): self;
method gamma (line 322) | public function gamma(float $gamma): self;
method colorize (line 331) | public function colorize(int $red = 0, int $green = 0, int $blue = 0):...
method flip (line 340) | public function flip(): self;
method flop (line 349) | public function flop(): self;
method blur (line 358) | public function blur(int $amount = 5): self;
method invert (line 367) | public function invert(): self;
method pixelate (line 376) | public function pixelate(int $size): self;
method rotate (line 386) | public function rotate(float $angle, mixed $background = 'ffffff'): self;
method orient (line 395) | public function orient(): self;
method text (line 404) | public function text(string $text, int $x, int $y, callable|Closure|Fo...
method resize (line 413) | public function resize(?int $width = null, ?int $height = null): self;
method resizeDown (line 422) | public function resizeDown(?int $width = null, ?int $height = null): s...
method scale (line 431) | public function scale(?int $width = null, ?int $height = null): self;
method scaleDown (line 441) | public function scaleDown(?int $width = null, ?int $height = null): self;
method cover (line 453) | public function cover(int $width, int $height, string $position = 'cen...
method coverDown (line 462) | public function coverDown(int $width, int $height, string $position = ...
method resizeCanvas (line 474) | public function resizeCanvas(
method resizeCanvasRelative (line 490) | public function resizeCanvasRelative(
method pad (line 511) | public function pad(
method contain (line 527) | public function contain(
method crop (line 543) | public function crop(
method trim (line 560) | public function trim(int $tolerance = 0): self;
method place (line 569) | public function place(
method fill (line 591) | public function fill(mixed $color, ?int $x = null, ?int $y = null): self;
method drawPixel (line 600) | public function drawPixel(int $x, int $y, mixed $color): self;
method drawRectangle (line 609) | public function drawRectangle(int $x, int $y, callable|Closure|Rectang...
method drawEllipse (line 618) | public function drawEllipse(int $x, int $y, callable|Closure|Ellipse $...
method drawCircle (line 627) | public function drawCircle(int $x, int $y, callable|Closure|Circle $in...
method drawPolygon (line 636) | public function drawPolygon(callable|Closure|Polygon $init): self;
method drawLine (line 645) | public function drawLine(callable|Closure|Line $init): self;
method drawBezier (line 654) | public function drawBezier(callable|Closure|Bezier $init): self;
method encodeByMediaType (line 664) | public function encodeByMediaType(null|string|MediaType $type = null, ...
method encodeByExtension (line 675) | public function encodeByExtension(
method encodeByPath (line 689) | public function encodeByPath(?string $path = null, mixed ...$options):...
method toJpeg (line 698) | public function toJpeg(mixed ...$options): EncodedImageInterface;
method toJpeg2000 (line 707) | public function toJpeg2000(mixed ...$options): EncodedImageInterface;
method toWebp (line 716) | public function toWebp(mixed ...$options): EncodedImageInterface;
method toPng (line 725) | public function toPng(mixed ...$options): EncodedImageInterface;
method toGif (line 734) | public function toGif(mixed ...$options): EncodedImageInterface;
method toBitmap (line 743) | public function toBitmap(mixed ...$options): EncodedImageInterface;
method toAvif (line 752) | public function toAvif(mixed ...$options): EncodedImageInterface;
method toTiff (line 761) | public function toTiff(mixed ...$options): EncodedImageInterface;
method toHeic (line 770) | public function toHeic(mixed ...$options): EncodedImageInterface;
FILE: src/Interfaces/ImageManagerInterface.php
type ImageManagerInterface (line 9) | interface ImageManagerInterface
method create (line 18) | public function create(int $width, int $height): ImageInterface;
method read (line 48) | public function read(mixed $input, string|array|DecoderInterface $deco...
method animate (line 57) | public function animate(callable $init): ImageInterface;
method driver (line 62) | public function driver(): DriverInterface;
FILE: src/Interfaces/InputHandlerInterface.php
type InputHandlerInterface (line 9) | interface InputHandlerInterface
method handle (line 16) | public function handle(mixed $input): ImageInterface|ColorInterface;
FILE: src/Interfaces/ModifierInterface.php
type ModifierInterface (line 9) | interface ModifierInterface
method apply (line 16) | public function apply(ImageInterface $image): ImageInterface;
FILE: src/Interfaces/PointInterface.php
type PointInterface (line 7) | interface PointInterface
method x (line 12) | public function x(): int;
method y (line 17) | public function y(): int;
method setX (line 22) | public function setX(int $x): self;
method setY (line 27) | public function setY(int $y): self;
method moveX (line 32) | public function moveX(int $value): self;
method moveY (line 37) | public function moveY(int $value): self;
method move (line 42) | public function move(int $x, int $y): self;
method setPosition (line 47) | public function setPosition(int $x, int $y): self;
method rotate (line 52) | public function rotate(float $angle, self $pivot): self;
FILE: src/Interfaces/ProfileInterface.php
type ProfileInterface (line 7) | interface ProfileInterface
method __toString (line 12) | public function __toString(): string;
FILE: src/Interfaces/ResolutionInterface.php
type ResolutionInterface (line 7) | interface ResolutionInterface
method x (line 12) | public function x(): float;
method setX (line 17) | public function setX(float $x): self;
method y (line 22) | public function y(): float;
method setY (line 27) | public function setY(float $y): self;
method perInch (line 32) | public function perInch(): self;
method perCm (line 37) | public function perCm(): self;
method unit (line 42) | public function unit(): string;
method toString (line 47) | public function toString(): string;
method __toString (line 52) | public function __toString(): string;
FILE: src/Interfaces/SizeInterface.php
type SizeInterface (line 9) | interface SizeInterface
method width (line 14) | public function width(): int;
method height (line 19) | public function height(): int;
method pivot (line 24) | public function pivot(): PointInterface;
method setWidth (line 29) | public function setWidth(int $width): self;
method setHeight (line 34) | public function setHeight(int $height): self;
method setPivot (line 39) | public function setPivot(PointInterface $pivot): self;
method aspectRatio (line 44) | public function aspectRatio(): float;
method fitsInto (line 49) | public function fitsInto(self $size): bool;
method isLandscape (line 54) | public function isLandscape(): bool;
method isPortrait (line 59) | public function isPortrait(): bool;
method movePivot (line 64) | public function movePivot(string $position, int $offset_x = 0, int $of...
method alignPivotTo (line 69) | public function alignPivotTo(self $size, string $position): self;
method relativePositionTo (line 75) | public function relativePositionTo(self $size): PointInterface;
method resize (line 82) | public function resize(?int $width = null, ?int $height = null): self;
method resizeDown (line 89) | public function resizeDown(?int $width = null, ?int $height = null): s...
method scale (line 96) | public function scale(?int $width = null, ?int $height = null): self;
method scaleDown (line 103) | public function scaleDown(?int $width = null, ?int $height = null): self;
method cover (line 110) | public function cover(int $width, int $height): self;
method contain (line 117) | public function contain(int $width, int $height): self;
method containMax (line 122) | public function containMax(int $width, int $height): self;
FILE: src/Interfaces/SpecializableInterface.php
type SpecializableInterface (line 9) | interface SpecializableInterface
method specializable (line 17) | public function specializable(): array;
method setDriver (line 24) | public function setDriver(DriverInterface $driver): self;
method driver (line 29) | public function driver(): DriverInterface;
FILE: src/Interfaces/SpecializedInterface.php
type SpecializedInterface (line 7) | interface SpecializedInterface
FILE: src/MediaType.php
method create (line 47) | public static function create(string|self|Format|FileExtension $identifi...
method tryCreate (line 80) | public static function tryCreate(string|self|Format|FileExtension $ident...
method format (line 92) | public function format(): Format
method fileExtensions (line 131) | public function fileExtensions(): array
method fileExtension (line 139) | public function fileExtension(): FileExtension
FILE: src/ModifierStack.php
class ModifierStack (line 10) | class ModifierStack implements ModifierInterface
method __construct (line 18) | public function __construct(protected array $modifiers)
method apply (line 26) | public function apply(ImageInterface $image): ImageInterface
method push (line 38) | public function push(ModifierInterface $modifier): self
FILE: src/Modifiers/AbstractDrawModifier.php
class AbstractDrawModifier (line 13) | abstract class AbstractDrawModifier extends SpecializableModifier
method drawable (line 18) | abstract public function drawable(): DrawableInterface;
method backgroundColor (line 23) | public function backgroundColor(): ColorInterface
method borderColor (line 37) | public function borderColor(): ColorInterface
FILE: src/Modifiers/AlignRotationModifier.php
class AlignRotationModifier (line 9) | class AlignRotationModifier extends SpecializableModifier
FILE: src/Modifiers/BlendTransparencyModifier.php
class BlendTransparencyModifier (line 17) | class BlendTransparencyModifier extends SpecializableModifier
method __construct (line 24) | public function __construct(public mixed $color = null)
method blendingColor (line 36) | protected function blendingColor(DriverInterface $driver): ColorInterface
FILE: src/Modifiers/BlurModifier.php
class BlurModifier (line 9) | class BlurModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public int $amount)
FILE: src/Modifiers/BrightnessModifier.php
class BrightnessModifier (line 9) | class BrightnessModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public int $level)
FILE: src/Modifiers/ColorizeModifier.php
class ColorizeModifier (line 9) | class ColorizeModifier extends SpecializableModifier
method __construct (line 16) | public function __construct(
FILE: src/Modifiers/ColorspaceModifier.php
class ColorspaceModifier (line 13) | class ColorspaceModifier extends SpecializableModifier
method __construct (line 15) | public function __construct(public string|ColorspaceInterface $target)
method targetColorspace (line 23) | public function targetColorspace(): ColorspaceInterface
FILE: src/Modifiers/ContainModifier.php
class ContainModifier (line 13) | class ContainModifier extends SpecializableModifier
method __construct (line 15) | public function __construct(
method getCropSize (line 27) | public function getCropSize(ImageInterface $image): SizeInterface
method getResizeSize (line 40) | public function getResizeSize(ImageInterface $image): SizeInterface
FILE: src/Modifiers/ContrastModifier.php
class ContrastModifier (line 9) | class ContrastModifier extends SpecializableModifier
method __construct (line 16) | public function __construct(public int $level)
FILE: src/Modifiers/CoverDownModifier.php
class CoverDownModifier (line 7) | class CoverDownModifier extends CoverModifier
FILE: src/Modifiers/CoverModifier.php
class CoverModifier (line 13) | class CoverModifier extends SpecializableModifier
method __construct (line 20) | public function __construct(
method getCropSize (line 31) | public function getCropSize(ImageInterface $image): SizeInterface
method getResizeSize (line 45) | public function getResizeSize(SizeInterface $size): SizeInterface
FILE: src/Modifiers/CropModifier.php
class CropModifier (line 13) | class CropModifier extends SpecializableModifier
method __construct (line 20) | public function __construct(
method crop (line 34) | public function crop(ImageInterface $image): SizeInterface
FILE: src/Modifiers/DrawBezierModifier.php
class DrawBezierModifier (line 10) | class DrawBezierModifier extends AbstractDrawModifier
method __construct (line 17) | public function __construct(public Bezier $drawable)
method drawable (line 25) | public function drawable(): DrawableInterface
FILE: src/Modifiers/DrawEllipseModifier.php
class DrawEllipseModifier (line 10) | class DrawEllipseModifier extends AbstractDrawModifier
method __construct (line 12) | public function __construct(public Ellipse $drawable)
method drawable (line 17) | public function drawable(): DrawableInterface
FILE: src/Modifiers/DrawLineModifier.php
class DrawLineModifier (line 10) | class DrawLineModifier extends AbstractDrawModifier
method __construct (line 17) | public function __construct(public Line $drawable)
method drawable (line 25) | public function drawable(): DrawableInterface
FILE: src/Modifiers/DrawPixelModifier.php
class DrawPixelModifier (line 10) | class DrawPixelModifier extends SpecializableModifier
method __construct (line 17) | public function __construct(
FILE: src/Modifiers/DrawPolygonModifier.php
class DrawPolygonModifier (line 10) | class DrawPolygonModifier extends AbstractDrawModifier
method __construct (line 12) | public function __construct(public Polygon $drawable)
method drawable (line 17) | public function drawable(): DrawableInterface
FILE: src/Modifiers/DrawRectangleModifier.php
class DrawRectangleModifier (line 10) | class DrawRectangleModifier extends AbstractDrawModifier
method __construct (line 17) | public function __construct(public Rectangle $drawable)
method drawable (line 25) | public function drawable(): DrawableInterface
FILE: src/Modifiers/FillModifier.php
class FillModifier (line 10) | class FillModifier extends SpecializableModifier
method __construct (line 12) | public function __construct(
method hasPosition (line 19) | public function hasPosition(): bool
FILE: src/Modifiers/FlipModifier.php
class FlipModifier (line 9) | class FlipModifier extends SpecializableModifier
FILE: src/Modifiers/FlopModifier.php
class FlopModifier (line 9) | class FlopModifier extends SpecializableModifier
FILE: src/Modifiers/GammaModifier.php
class GammaModifier (line 9) | class GammaModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public float $gamma)
FILE: src/Modifiers/GreyscaleModifier.php
class GreyscaleModifier (line 9) | class GreyscaleModifier extends SpecializableModifier
FILE: src/Modifiers/InvertModifier.php
class InvertModifier (line 9) | class InvertModifier extends SpecializableModifier
FILE: src/Modifiers/PadModifier.php
class PadModifier (line 10) | class PadModifier extends ContainModifier
method getCropSize (line 12) | public function getCropSize(ImageInterface $image): SizeInterface
FILE: src/Modifiers/PixelateModifier.php
class PixelateModifier (line 9) | class PixelateModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public int $size)
FILE: src/Modifiers/PlaceModifier.php
class PlaceModifier (line 12) | class PlaceModifier extends SpecializableModifier
method __construct (line 19) | public function __construct(
method getPosition (line 32) | public function getPosition(ImageInterface $image, ImageInterface $wat...
FILE: src/Modifiers/ProfileModifier.php
class ProfileModifier (line 10) | class ProfileModifier extends SpecializableModifier
method __construct (line 12) | public function __construct(public ProfileInterface $profile)
FILE: src/Modifiers/ProfileRemovalModifier.php
class ProfileRemovalModifier (line 9) | class ProfileRemovalModifier extends SpecializableModifier
FILE: src/Modifiers/QuantizeColorsModifier.php
class QuantizeColorsModifier (line 9) | class QuantizeColorsModifier extends SpecializableModifier
method __construct (line 16) | public function __construct(
FILE: src/Modifiers/RemoveAnimationModifier.php
class RemoveAnimationModifier (line 13) | class RemoveAnimationModifier extends SpecializableModifier
method __construct (line 15) | public function __construct(public int|string $position = 0)
method selectedFrame (line 23) | protected function selectedFrame(ImageInterface $image): FrameInterface
method normalizePosition (line 33) | protected function normalizePosition(ImageInterface $image): int
FILE: src/Modifiers/ResizeCanvasModifier.php
class ResizeCanvasModifier (line 13) | class ResizeCanvasModifier extends SpecializableModifier
method __construct (line 20) | public function __construct(
method cropSize (line 34) | protected function cropSize(ImageInterface $image, bool $relative = fa...
FILE: src/Modifiers/ResizeCanvasRelativeModifier.php
class ResizeCanvasRelativeModifier (line 7) | class ResizeCanvasRelativeModifier extends ResizeCanvasModifier
FILE: src/Modifiers/ResizeDownModifier.php
class ResizeDownModifier (line 7) | class ResizeDownModifier extends ResizeModifier
FILE: src/Modifiers/ResizeModifier.php
class ResizeModifier (line 9) | class ResizeModifier extends SpecializableModifier
method __construct (line 16) | public function __construct(public ?int $width = null, public ?int $he...
FILE: src/Modifiers/ResolutionModifier.php
class ResolutionModifier (line 9) | class ResolutionModifier extends SpecializableModifier
method __construct (line 16) | public function __construct(public float $x, public float $y)
FILE: src/Modifiers/RotateModifier.php
class RotateModifier (line 9) | class RotateModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public float $angle, public mixed $backgro...
method rotationAngle (line 20) | public function rotationAngle(): float
FILE: src/Modifiers/ScaleDownModifier.php
class ScaleDownModifier (line 7) | class ScaleDownModifier extends ScaleModifier
FILE: src/Modifiers/ScaleModifier.php
class ScaleModifier (line 7) | class ScaleModifier extends ResizeModifier
FILE: src/Modifiers/SharpenModifier.php
class SharpenModifier (line 9) | class SharpenModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public int $amount)
FILE: src/Modifiers/SliceAnimationModifier.php
class SliceAnimationModifier (line 9) | class SliceAnimationModifier extends SpecializableModifier
method __construct (line 11) | public function __construct(public int $offset = 0, public ?int $lengt...
FILE: src/Modifiers/TextModifier.php
class TextModifier (line 15) | class TextModifier extends SpecializableModifier
method __construct (line 22) | public function __construct(
method textColor (line 41) | protected function textColor(): ColorInterface
method strokeColor (line 60) | protected function strokeColor(): ColorInterface
method strokeOffsets (line 78) | protected function strokeOffsets(FontInterface $font): array
FILE: src/Modifiers/TrimModifier.php
class TrimModifier (line 9) | class TrimModifier extends SpecializableModifier
method __construct (line 16) | public function __construct(public int $tolerance = 0)
FILE: src/Origin.php
class Origin (line 7) | class Origin
method __construct (line 14) | public function __construct(
method mediaType (line 24) | public function mediaType(): string
method mimetype (line 32) | public function mimetype(): string
method setMediaType (line 40) | public function setMediaType(string|MediaType $type): self
method filePath (line 53) | public function filePath(): ?string
method setFilePath (line 61) | public function setFilePath(string $path): self
method fileExtension (line 71) | public function fileExtension(): ?string
method __debugInfo (line 81) | public function __debugInfo(): array
FILE: src/Resolution.php
class Resolution (line 16) | class Resolution implements ResolutionInterface, Stringable, IteratorAgg...
method __construct (line 24) | public function __construct(
method getIterator (line 37) | public function getIterator(): Traversable
method x (line 47) | public function x(): float
method setX (line 57) | public function setX(float $x): self
method y (line 69) | public function y(): float
method setY (line 79) | public function setY(float $y): self
method setPerUnit (line 91) | protected function setPerUnit(int $per_unit): self
method unit (line 103) | public function unit(): string
method perInch (line 116) | public function perInch(): self
method perCm (line 132) | public function perCm(): self
method toString (line 148) | public function toString(): string
method __toString (line 158) | public function __toString(): string
FILE: src/Traits/CanBeDriverSpecialized.php
type CanBeDriverSpecialized (line 12) | trait CanBeDriverSpecialized
method specializable (line 24) | public function specializable(): array
method driver (line 43) | public function driver(): DriverInterface
method setDriver (line 53) | public function setDriver(DriverInterface $driver): SpecializableInter...
method belongsToDriver (line 69) | protected function belongsToDriver(object $driver): bool
FILE: src/Traits/CanBuildFilePointer.php
type CanBuildFilePointer (line 9) | trait CanBuildFilePointer
method buildFilePointer (line 18) | public function buildFilePointer(mixed $data = null)
FILE: src/Typography/Font.php
class Font (line 10) | class Font implements FontInterface
method __construct (line 23) | public function __construct(?string $filename = null)
method setSize (line 33) | public function setSize(float $size): FontInterface
method size (line 45) | public function size(): float
method setAngle (line 55) | public function setAngle(float $angle): FontInterface
method angle (line 67) | public function angle(): float
method setFilename (line 79) | public function setFilename(string $filename): FontInterface
method filename (line 95) | public function filename(): ?string
method hasFilename (line 105) | public function hasFilename(): bool
method setColor (line 115) | public function setColor(mixed $color): FontInterface
method color (line 127) | public function color(): mixed
method setStrokeColor (line 137) | public function setStrokeColor(mixed $color): FontInterface
method strokeColor (line 149) | public function strokeColor(): mixed
method setStrokeWidth (line 159) | public function setStrokeWidth(int $width): FontInterface
method strokeWidth (line 177) | public function strokeWidth(): int
method hasStrokeEffect (line 187) | public function hasStrokeEffect(): bool
method alignment (line 197) | public function alignment(): string
method setAlignment (line 207) | public function setAlignment(string $value): FontInterface
method valignment (line 219) | public function valignment(): string
method setValignment (line 229) | public function setValignment(string $value): FontInterface
method setLineHeight (line 241) | public function setLineHeight(float $height): FontInterface
method lineHeight (line 253) | public function lineHeight(): float
method setWrapWidth (line 263) | public function setWrapWidth(?int $width): FontInterface
method wrapWidth (line 275) | public function wrapWidth(): ?int
FILE: src/Typography/FontFactory.php
class FontFactory (line 11) | class FontFactory
method __construct (line 22) | public function __construct(callable|Closure|FontInterface $init)
method filename (line 34) | public function filename(string $value): self
method file (line 46) | public function file(string $value): self
method stroke (line 56) | public function stroke(mixed $color, int $width = 1): self
method color (line 67) | public function color(mixed $value): self
method size (line 77) | public function size(float $value): self
method align (line 87) | public function align(string $value): self
method valign (line 97) | public function valign(string $value): self
method lineHeight (line 107) | public function lineHeight(float $value): self
method angle (line 117) | public function angle(float $value): self
method wrap (line 127) | public function wrap(int $width): self
method __invoke (line 137) | public function __invoke(): FontInterface
FILE: src/Typography/Line.php
class Line (line 18) | class Line implements IteratorAggregate, Countable, Stringable
method __construct (line 32) | public function __construct(
method add (line 44) | public function add(string $word): self
method getIterator (line 56) | public function getIterator(): Traversable
method position (line 64) | public function position(): PointInterface
method setPosition (line 72) | public function setPosition(PointInterface $point): self
method count (line 82) | public function count(): int
method length (line 90) | public function length(): int
method wordsSeperatedBySpaces (line 98) | private function wordsSeperatedBySpaces(string $text): bool
method __toString (line 115) | public function __toString(): string
FILE: src/Typography/TextBlock.php
class TextBlock (line 9) | class TextBlock extends Collection
method __construct (line 16) | public function __construct(string $text)
method lines (line 28) | public function lines(): array
method setLines (line 38) | public function setLines(array $lines): self
method line (line 48) | public function line(mixed $key): ?Line
method longestLine (line 60) | public function longestLine(): Line
FILE: tests/BaseTestCase.php
class BaseTestCase (line 17) | abstract class BaseTestCase extends MockeryTestCase
method getTestResourcePath (line 19) | public static function getTestResourcePath(string $filename = 'test.jp...
method getTestResourceData (line 24) | public static function getTestResourceData(string $filename = 'test.jp...
method getTestResourcePointer (line 29) | public static function getTestResourcePointer(string $filename = 'test...
method assertColor (line 43) | protected function assertColor(int $r, int $g, int $b, int $a, ColorIn...
method assertTransparency (line 92) | protected function assertTransparency(ColorInterface $color): void
method assertMediaType (line 99) | protected function assertMediaType(string|array $allowed, string|Encod...
method assertMediaTypeBitmap (line 114) | protected function assertMediaTypeBitmap(string|EncodedImage $input): ...
FILE: tests/Feature/Gd/ConvertPngGif.php
class ConvertPngGif (line 11) | #[RequiresPhpExtension('gd')]
method testConversionKeepsTransparency (line 14) | public function testConversionKeepsTransparency(): void
FILE: tests/Feature/Imagick/ConvertPngGif.php
class ConvertPngGif (line 11) | #[RequiresPhpExtension('imagick')]
method testConversionKeepsTransparency (line 14) | public function testConversionKeepsTransparency(): void
FILE: tests/Feature/Imagick/CropResizePngTest.php
class CropResizePngTest (line 9) | class CropResizePngTest extends ImagickTestCase
method testCropResizePng (line 11) | public function testCropResizePng(): void
FILE: tests/GdTestCase.php
class GdTestCase (line 13) | abstract class GdTestCase extends BaseTestCase
method readTestImage (line 15) | public static function readTestImage(string $filename = 'test.jpg'): I...
method createTestImage (line 22) | public static function createTestImage(int $width, int $height): Image
method createTestAnimation (line 35) | public static function createTestAnimation(): Image
FILE: tests/ImagickTestCase.php
class ImagickTestCase (line 15) | abstract class ImagickTestCase extends BaseTestCase
method readTestImage (line 17) | public static function readTestImage(string $filename = 'test.jpg'): I...
method createTestImage (line 29) | public static function createTestImage(int $width, int $height): Image
method createTestAnimation (line 46) | public static function createTestAnimation(): Image
FILE: tests/Traits/CanDetectProgressiveJpeg.php
type CanDetectProgressiveJpeg (line 10) | trait CanDetectProgressiveJpeg
method isProgressiveJpeg (line 19) | private function isProgressiveJpeg(EncodedImage $image): bool
FILE: tests/Traits/CanInspectPngFormat.php
type CanInspectPngFormat (line 10) | trait CanInspectPngFormat
method isInterlacedPng (line 17) | private function isInterlacedPng(EncodedImage $image): bool
method pngColorType (line 29) | private function pngColorType(EncodedImage $image): string
FILE: tests/Unit/CollectionTest.php
class CollectionTest (line 11) | #[CoversClass(Collection::class)]
method testConstructor (line 14) | public function testConstructor(): void
method testIterator (line 23) | public function testIterator(): void
method testCount (line 43) | public function testCount(): void
method testFilter (line 50) | public function testFilter(): void
method testFirstLast (line 60) | public function testFirstLast(): void
method testPush (line 71) | public function testPush(): void
method testToArray (line 80) | public function testToArray(): void
method testMap (line 86) | public function testMap(): void
method testGet (line 98) | public function testGet(): void
method testGetAtPosition (line 131) | public function testGetAtPosition(): void
method testGetAtPositionEmpty (line 142) | public function testGetAtPositionEmpty(): void
method testEmpty (line 149) | public function testEmpty(): void
method testSlice (line 158) | public function testSlice(): void
method testSliceOutOfBounds (line 175) | public function testSliceOutOfBounds(): void
FILE: tests/Unit/Colors/Cmyk/ChannelTest.php
class ChannelTest (line 15) | #[CoversClass(Cyan::class)]
method testConstructor (line 21) | public function testConstructor(): void
method testConstructorFail (line 39) | public function testConstructorFail(): void
method testToInt (line 45) | public function testToInt(): void
method testToString (line 51) | public function testToString(): void
method testValue (line 58) | public function testValue(): void
method testNormalize (line 64) | public function testNormalize(): void
method testValidate (line 74) | public function testValidate(): void
FILE: tests/Unit/Colors/Cmyk/ColorTest.php
class ColorTest (line 17) | #[CoversClass(Color::class)]
method testConstructor (line 20) | public function testConstructor(): void
method testCreate (line 26) | public function testCreate(): void
method testColorspace (line 32) | public function testColorspace(): void
method testChannels (line 38) | public function testChannels(): void
method testChannel (line 45) | public function testChannel(): void
method testChannelNotFound (line 53) | public function testChannelNotFound(): void
method testCyanMagentaYellowKey (line 60) | public function testCyanMagentaYellowKey(): void
method testToArray (line 73) | public function testToArray(): void
method testToHex (line 79) | public function testToHex(): void
method testIsGreyscale (line 86) | public function testIsGreyscale(): void
method testNormalize (line 95) | public function testNormalize(): void
method testToString (line 101) | public function testToString(): void
method testIsTransparent (line 107) | public function testIsTransparent(): void
method testIsClear (line 113) | public function testIsClear(): void
method testDebugInfo (line 119) | public function testDebugInfo(): void
FILE: tests/Unit/Colors/Cmyk/ColorspaceTest.php
class ColorspaceTest (line 19) | #[CoversClass(Colorspace::class)]
method testColorFromNormalized (line 22) | public function testColorFromNormalized(): void
method testImportRgbColor (line 33) | public function testImportRgbColor(): void
method testImportHsvColor (line 59) | public function testImportHsvColor(): void
method testImportHslColor (line 70) | public function testImportHslColor(): void
FILE: tests/Unit/Colors/Cmyk/Decoders/StringColorDecoderTest.php
class StringColorDecoderTest (line 13) | #[CoversClass(StringColorDecoder::class)]
method testDecode (line 16) | public function testDecode(): void
method testDecodeInvalid (line 36) | public function testDecodeInvalid(): void
FILE: tests/Unit/Colors/Hsl/ChannelTest.php
class ChannelTest (line 14) | #[CoversClass(Hue::class)]
method testConstructor (line 19) | public function testConstructor(): void
method testConstructorFail (line 37) | public function testConstructorFail(): void
method testToInt (line 43) | public function testToInt(): void
method testToString (line 49) | public function testToString(): void
method testValue (line 56) | public function testValue(): void
method testNormalize (line 62) | public function testNormalize(): void
method testValidate (line 74) | public function testValidate(): void
FILE: tests/Unit/Colors/Hsl/Channels/SaturationTest.php
class SaturationTest (line 11) | #[CoversClass(Saturation::class)]
method testMinMax (line 14) | public function testMinMax(): void
FILE: tests/Unit/Colors/Hsl/ColorTest.php
class ColorTest (line 16) | #[CoversClass(Color::class)]
method testConstructor (line 19) | public function testConstructor(): void
method testCreate (line 25) | public function testCreate(): void
method testColorspace (line 31) | public function testColorspace(): void
method testChannels (line 37) | public function testChannels(): void
method testChannel (line 44) | public function testChannel(): void
method testChannelNotFound (line 52) | public function testChannelNotFound(): void
method testHueSaturationLuminanceKey (line 59) | public function testHueSaturationLuminanceKey(): void
method testToArray (line 70) | public function testToArray(): void
method testToHex (line 76) | public function testToHex(): void
method testNormalize (line 82) | public function testNormalize(): void
method testToString (line 88) | public function testToString(): void
method testIsGreyscale (line 94) | public function testIsGreyscale(): void
method testIsTransparent (line 106) | public function testIsTransparent(): void
method testIsClear (line 112) | public function testIsClear(): void
method testDebugInfo (line 118) | public function testDebugInfo(): void
FILE: tests/Unit/Colors/Hsl/ColorspaceTest.php
class ColorspaceTest (line 18) | #[CoversClass(Colorspace::class)]
method testColorFromNormalized (line 21) | public function testColorFromNormalized(): void
method testImportRgbColor (line 31) | public function testImportRgbColor(): void
method testImportCmykColor (line 54) | public function testImportCmykColor(): void
method testImportHsvColor (line 71) | public function testImportHsvColor(): void
FILE: tests/Unit/Colors/Hsl/Decoders/StringColorDecoderTest.php
class StringColorDecoderTest (line 14) | #[CoversClass(StringColorDecoder::class)]
method testDecode (line 20) | #[DataProvider('decodeDataProvier')]
method decodeDataProvier (line 29) | public static function decodeDataProvier(): Generator
FILE: tests/Unit/Colors/Hsv/ChannelTest.php
class ChannelTest (line 14) | #[CoversClass(Hue::class)]
method testConstructor (line 19) | public function testConstructor(): void
method testConstructorFail (line 37) | public function testConstructorFail(): void
method testToInt (line 43) | public function testToInt(): void
method testToString (line 49) | public function testToString(): void
method testValue (line 56) | public function testValue(): void
method testNormalize (line 62) | public function testNormalize(): void
method testValidate (line 74) | public function testValidate(): void
FILE: tests/Unit/Colors/Hsv/Channels/SaturationTest.php
class SaturationTest (line 11) | #[CoversClass(Saturation::class)]
method testMinMax (line 14) | public function testMinMax(): void
FILE: tests/Unit/Colors/Hsv/Channels/ValueTest.php
class ValueTest (line 11) | #[CoversClass(Value::class)]
method testMinMax (line 14) | public function testMinMax(): void
FILE: tests/Unit/Colors/Hsv/ColorTest.php
class ColorTest (line 16) | #[CoversClass(Color::class)]
method testConstructor (line 19) | public function testConstructor(): void
method testCreate (line 25) | public function testCreate(): void
method testColorspace (line 31) | public function testColorspace(): void
method testChannels (line 37) | public function testChannels(): void
method testChannel (line 44) | public function testChannel(): void
method testChannelNotFound (line 52) | public function testChannelNotFound(): void
method testHueSaturationValueKey (line 59) | public function testHueSaturationValueKey(): void
method testToArray (line 70) | public function testToArray(): void
method testToHex (line 76) | public function testToHex(): void
method testNormalize (line 82) | public function testNormalize(): void
method testToString (line 88) | public function testToString(): void
method testIsGreyscale (line 94) | public function testIsGreyscale(): void
method testIsTransparent (line 106) | public function testIsTransparent(): void
method testIsClear (line 112) | public function testIsClear(): void
method testDebugInfo (line 118) | public function testDebugInfo(): void
FILE: tests/Unit/Colors/Hsv/ColorspaceTest.php
class ColorspaceTest (line 18) | #[CoversClass(Colorspace::class)]
method testColorFromNormalized (line 21) | public function testColorFromNormalized(): void
method testImportRgbColor (line 31) | public function testImportRgbColor(): void
method testImportCmykColor (line 54) | public function testImportCmykColor(): void
method testImportHslColor (line 71) | public function testImportHslColor(): void
FILE: tests/Unit/Colors/Hsv/Decoders/StringColorDecoderTest.php
class StringColorDecoderTest (line 14) | #[CoversClass(StringColorDecoder::class)]
method testDecodeHsv (line 20) | #[DataProvider('decodeDataProvier')]
method decodeDataProvier (line 29) | public static function decodeDataProvier(): Generator
FILE: tests/Unit/Colors/ProfileTest.php
class ProfileTest (line 10) | class ProfileTest extends BaseTestCase
method testFromPath (line 12) | public function testFromPath(): void
FILE: tests/Unit/Colors/Rgb/ChannelTest.php
class ChannelTest (line 15) | #[CoversClass(Red::class)]
method testConstructor (line 20) | public function testConstructor(): void
method testConstructorFail (line 38) | public function testConstructorFail(): void
method testToInt (line 44) | public function testToInt(): void
method testToString (line 50) | public function testToString(): void
method testValue (line 57) | public function testValue(): void
method testNormalize (line 63) | public function testNormalize(): void
method testValidate (line 73) | public function testValidate(): void
FILE: tests/Unit/Colors/Rgb/Channels/AlphaTest.php
class AlphaTest (line 11) | #[CoversClass(Alpha::class)]
method testToString (line 14) | public function testToString(): void
FILE: tests/Unit/Colors/Rgb/ColorTest.php
class ColorTest (line 18) | #[CoversClass(Color::class)]
method testConstructor (line 21) | public function testConstructor(): void
method testCreate (line 30) | public function testCreate(): void
method testColorspace (line 41) | public function testColorspace(): void
method testChannels (line 47) | public function testChannels(): void
method testChannel (line 54) | public function testChannel(): void
method testChannelNotFound (line 62) | public function testChannelNotFound(): void
method testRedGreenBlue (line 69) | public function testRedGreenBlue(): void
method testToArray (line 80) | public function testToArray(): void
method testToHex (line 86) | public function testToHex(): void
method testNormalize (line 96) | public function testNormalize(): void
method testToString (line 102) | public function testToString(): void
method testConvertTo (line 108) | public function testConvertTo(): void
method testIsGreyscale (line 141) | public function testIsGreyscale(): void
method testIsTransparent (line 150) | public function testIsTransparent(): void
method testIsClear (line 165) | public function testIsClear(): void
method testDebugInfo (line 180) | public function testDebugInfo(): void
FILE: tests/Unit/Colors/Rgb/ColorspaceTest.php
class ColorspaceTest (line 19) | #[CoversClass(Colorspace::class)]
method testColorFromNormalized (line 22) | public function testColorFromNormalized(): void
method testImportCmykColor (line 34) | public function testImportCmykColor(): void
method testImportHsvColor (line 50) | public function testImportHsvColor(): void
method testImportHslColor (line 67) | public function testImportHslColor(): void
FILE: tests/Unit/Colors/Rgb/Decoders/HexColorDecoderTest.php
class HexColorDecoderTest (line 14) | #[CoversClass(HexColorDecoder::class)]
method testDecode (line 20) | #[DataProvider('decodeDataProvier')]
method decodeDataProvier (line 29) | public static function decodeDataProvier(): Generator
FILE: tests/Unit/Colors/Rgb/Decoders/HtmlColornameDecoderTest.php
class HtmlColornameDecoderTest (line 14) | #[CoversClass(HtmlColorNameDecoder::class)]
method testDecode (line 20) | #[DataProvider('decodeDataProvier')]
method decodeDataProvier (line 29) | public static function decodeDataProvier(): Generator
FILE: tests/Unit/Colors/Rgb/Decoders/StringColorDecoderTest.php
class StringColorDecoderTest (line 14) | #[CoversClass(StringColorDecoder::class)]
method testDecode (line 20) | #[DataProvider('decodeDataProvier')]
method decodeDataProvier (line 29) | public static function decodeDataProvier(): Generator
FILE: tests/Unit/ConfigTest.php
class ConfigTest (line 11) | #[CoversClass(Config::class)]
method testConstructor (line 14) | public function testConstructor(): void
method testGetSetOptions (line 37) | public function testGetSetOptions(): void
method testSetOptionsWithArray (line 74) | public function testSetOptionsWithArray(): void
FILE: tests/Unit/Drivers/AbstractDecoderTest.php
class AbstractDecoderTest (line 17) | #[CoversClass(AbstractDecoder::class)]
method testIsGifFormat (line 20) | public function testIsGifFormat(): void
method testIsFile (line 27) | public function testIsFile(): void
method testExtractExifDataFromBinary (line 37) | public function testExtractExifDataFromBinary(): void
method testExtractExifDataFromPath (line 48) | public function testExtractExifDataFromPath(): void
method testParseDataUri (line 56) | public function testParseDataUri(): void
method testIsValidBase64 (line 99) | public function testIsValidBase64(): void
FILE: tests/Unit/Drivers/AbstractEncoderTest.php
class AbstractEncoderTest (line 14) | #[CoversClass(AbstractEncoder::class)]
method testEncode (line 17) | public function testEncode(): void
FILE: tests/Unit/Drivers/AbstractFontProcessorTest.php
class AbstractFontProcessorTest (line 16) | #[CoversClass(AbstractFontProcessor::class)]
method testTextBlock (line 19) | public function testTextBlock(): void
method testNativeFontSize (line 81) | public function testNativeFontSize(): void
method testTypographicalSize (line 88) | public function testTypographicalSize(): void
method testCapHeight (line 96) | public function testCapHeight(): void
method testLeading (line 104) | public function testLeading(): void
FILE: tests/Unit/Drivers/Gd/Analyzers/ColorspaceAnalyzerTest.php
class ColorspaceAnalyzerTest (line 14) | #[RequiresPhpExtension('gd')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Gd/Analyzers/HeightAnalyzerTest.php
class HeightAnalyzerTest (line 13) | #[RequiresPhpExtension('gd')]
method testAnalyze (line 17) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Gd/Analyzers/PixelColorAnalyzerTest.php
class PixelColorAnalyzerTest (line 14) | #[RequiresPhpExtension('gd')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Gd/Analyzers/PixelColorsAnalyzerTest.php
class PixelColorsAnalyzerTest (line 15) | #[RequiresPhpExtension('gd')]
method testAnalyzeAnimated (line 19) | public function testAnalyzeAnimated(): void
method testAnalyzeNonAnimated (line 30) | public function testAnalyzeNonAnimated(): void
FILE: tests/Unit/Drivers/Gd/Analyzers/ResolutionAnalyzerTest.php
class ResolutionAnalyzerTest (line 14) | #[RequiresPhpExtension('gd')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Gd/Analyzers/WidthAnalyzerTest.php
class WidthAnalyzerTest (line 13) | #[RequiresPhpExtension('gd')]
method testAnalyze (line 17) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Gd/ClonerTest.php
class ClonerTest (line 14) | #[RequiresPhpExtension('gd')]
method testClone (line 18) | public function testClone(): void
method testCloneEmpty (line 34) | public function testCloneEmpty(): void
method testCloneBlended (line 55) | public function testCloneBlended(): void
FILE: tests/Unit/Drivers/Gd/ColorProcessorTest.php
class ColorProcessorTest (line 18) | #[RequiresPhpExtension('gd')]
method testColorToNative (line 22) | public function testColorToNative(): void
method testNativeToColorInteger (line 29) | public function testNativeToColorInteger(): void
method testNativeToColorArray (line 40) | public function testNativeToColorArray(): void
method testNativeToColorInvalid (line 51) | public function testNativeToColorInvalid(): void
FILE: tests/Unit/Drivers/Gd/CoreTest.php
class CoreTest (line 15) | #[RequiresPhpExtension('gd')]
method setUp (line 21) | protected function setUp(): void
method getTestFrame (line 30) | public function getTestFrame(): Frame
method testAdd (line 35) | public function testAdd(): void
method testSetNative (line 43) | public function testSetNative(): void
method testCount (line 53) | public function testCount(): void
method testIterator (line 58) | public function testIterator(): void
method testNative (line 65) | public function testNative(): void
method testFrame (line 70) | public function testFrame(): void
method testSetGetLoops (line 79) | public function testSetGetLoops(): void
method testHas (line 87) | public function testHas(): void
method testPush (line 95) | public function testPush(): void
method testGet (line 103) | public function testGet(): void
method testEmpty (line 112) | public function testEmpty(): void
method testSlice (line 119) | public function testSlice(): void
method testFirst (line 127) | public function testFirst(): void
method testLast (line 132) | public function testLast(): void
FILE: tests/Unit/Drivers/Gd/Decoders/AbstractDecoderTest.php
class AbstractDecoderTest (line 14) | #[RequiresPhpExtension('gd')]
method testGetMediaTypeFromFilePath (line 18) | public function testGetMediaTypeFromFilePath(): void
method testGetMediaTypeFromFileBinary (line 27) | public function testGetMediaTypeFromFileBinary(): void
FILE: tests/Unit/Drivers/Gd/Decoders/Base64ImageDecoderTest.php
class Base64ImageDecoderTest (line 15) | #[RequiresPhpExtension('gd')]
method setUp (line 21) | protected function setUp(): void
method testDecode (line 27) | public function testDecode(): void
method testDecoderInvalid (line 36) | public function testDecoderInvalid(): void
FILE: tests/Unit/Drivers/Gd/Decoders/BinaryImageDecoderTest.php
class BinaryImageDecoderTest (line 14) | #[RequiresPhpExtension('gd')]
method setUp (line 20) | protected function setUp(): void
method testDecodePng (line 26) | public function testDecodePng(): void
method testDecodeGif (line 35) | public function testDecodeGif(): void
method testDecodeAnimatedGif (line 44) | public function testDecodeAnimatedGif(): void
method testDecodeJpegWithExif (line 53) | public function testDecodeJpegWithExif(): void
FILE: tests/Unit/Drivers/Gd/Decoders/DataUriImageDecoderTest.php
class DataUriImageDecoderTest (line 16) | #[RequiresPhpExtension('gd')]
method setUp (line 22) | protected function setUp(): void
method testDecode (line 28) | public function testDecode(): void
method testDecoderNonString (line 37) | public function testDecoderNonString(): void
method testDecoderInvalid (line 43) | public function testDecoderInvalid(): void
method testDecoderNonImage (line 49) | public function testDecoderNonImage(): void
FILE: tests/Unit/Drivers/Gd/Decoders/EncodedImageObjectDecoderTest.php
class EncodedImageObjectDecoderTest (line 15) | #[RequiresPhpExtension('gd')]
method setUp (line 21) | protected function setUp(): void
method testDecode (line 27) | public function testDecode(): void
FILE: tests/Unit/Drivers/Gd/Decoders/FilePathImageDecoderTest.php
class FilePathImageDecoderTest (line 17) | #[RequiresPhpExtension('gd')]
method setUp (line 23) | protected function setUp(): void
method testDecode (line 29) | #[DataProvider('validFormatPathsProvider')]
method validFormatPathsProvider (line 43) | public static function validFormatPathsProvider(): Generator
FILE: tests/Unit/Drivers/Gd/Decoders/FilePointerImageDecoderTest.php
class FilePointerImageDecoderTest (line 14) | #[RequiresPhpExtension('gd')]
method testDecode (line 18) | public function testDecode(): void
FILE: tests/Unit/Drivers/Gd/Decoders/ImageObjectDecoderTest.php
class ImageObjectDecoderTest (line 13) | #[RequiresPhpExtension('gd')]
method testDecode (line 17) | public function testDecode(): void
FILE: tests/Unit/Drivers/Gd/Decoders/NativeObjectDecoderTest.php
class NativeObjectDecoderTest (line 14) | #[RequiresPhpExtension('gd')]
method setUp (line 20) | protected function setUp(): void
method testDecode (line 26) | public function testDecode(): void
FILE: tests/Unit/Drivers/Gd/Decoders/SplFileInfoImageDecoderTest.php
class SplFileInfoImageDecoderTest (line 15) | #[RequiresPhpExtension('gd')]
method testDecode (line 19) | public function testDecode(): void
FILE: tests/Unit/Drivers/Gd/DriverTest.php
class DriverTest (line 34) | #[RequiresPhpExtension('gd')]
method setUp (line 40) | protected function setUp(): void
method testId (line 45) | public function testId(): void
method testCreateImage (line 50) | public function testCreateImage(): void
method testCreateAnimation (line 58) | public function testCreateAnimation(): void
method testHandleInputImage (line 72) | public function testHandleInputImage(): void
method testHandleInputColor (line 78) | public function testHandleInputColor(): void
method testHandleInputObjects (line 84) | public function testHandleInputObjects(): void
method testHandleInputClassnames (line 92) | public function testHandleInputClassnames(): void
method testColorProcessor (line 100) | public function testColorProcessor(): void
method testSupports (line 106) | #[DataProvider('supportsDataProvider')]
method supportsDataProvider (line 112) | public static function supportsDataProvider(): Generator
method testVersion (line 222) | public function testVersion(): void
method testSpecialize (line 227) | #[DataProvider('spezializeDataProvider')]
method spezializeDataProvider (line 233) | public static function spezializeDataProvider(): Generator
method testSpecializeFailure (line 248) | public function testSpecializeFailure(): void
FILE: tests/Unit/Drivers/Gd/Encoders/AvifEncoderTest.php
class AvifEncoderTest (line 12) | #[RequiresPhpExtension('gd')]
method testEncode (line 16) | public function testEncode(): void
FILE: tests/Unit/Drivers/Gd/Encoders/BmpEncoderTest.php
class BmpEncoderTest (line 12) | #[RequiresPhpExtension('gd')]
method testEncode (line 16) | public function testEncode(): void
FILE: tests/Unit/Drivers/Gd/Encoders/GifEncoderTest.php
class GifEncoderTest (line 13) | #[RequiresPhpExtension('gd')]
method testEncode (line 17) | public function testEncode(): void
method testEncodeInterlaced (line 29) | public function testEncodeInterlaced(): void
method testEncodeInterlacedAnimation (line 41) | public function testEncodeInterlacedAnimation(): void
FILE: tests/Unit/Drivers/Gd/Encoders/JpegEncoderTest.php
class JpegEncoderTest (line 14) | #[RequiresPhpExtension('gd')]
method testEncode (line 20) | public function testEncode(): void
method testEncodeProgressive (line 30) | public function testEncodeProgressive(): void
FILE: tests/Unit/Drivers/Gd/Encoders/PngEncoderTest.php
class PngEncoderTest (line 16) | #[RequiresPhpExtension('gd')]
method testEncode (line 22) | public function testEncode(): void
method testEncodeInterlaced (line 32) | public function testEncodeInterlaced(): void
method testEncoderIndexed (line 42) | #[DataProvider('indexedDataProvider')]
method indexedDataProvider (line 51) | public static function indexedDataProvider(): Generator
FILE: tests/Unit/Drivers/Gd/Encoders/WebpEncoderTest.php
class WebpEncoderTest (line 12) | #[RequiresPhpExtension('gd')]
method testEncode (line 16) | public function testEncode(): void
FILE: tests/Unit/Drivers/Gd/FontProcessorTest.php
class FontProcessorTest (line 16) | #[RequiresPhpExtension('gd')]
method testBoxSizeGdOne (line 20) | public function testBoxSizeGdOne(): void
method testBoxSizeGdTwo (line 29) | public function testBoxSizeGdTwo(): void
method testBoxSizeGdThree (line 38) | public function testBoxSizeGdThree(): void
method testBoxSizeGdFour (line 47) | public function testBoxSizeGdFour(): void
method testBoxSizeGdFive (line 56) | public function testBoxSizeGdFive(): void
method testBoxSizeTtf (line 65) | public function testBoxSizeTtf(): void
method testNativeFontSize (line 74) | public function testNativeFontSize(): void
method testTextBlock (line 81) | public function testTextBlock(): void
method testTypographicalSize (line 88) | public function testTypographicalSize(): void
method testCapHeight (line 95) | public function testCapHeight(): void
method testLeading (line 102) | public function testLeading(): void
method testNativeFontSizeTtf (line 109) | public function testNativeFontSizeTtf(): void
method testTextBlockTtf (line 116) | public function testTextBlockTtf(): void
method testTypographicalSizeTtf (line 123) | public function testTypographicalSizeTtf(): void
method testCapHeightTtf (line 130) | public function testCapHeightTtf(): void
method testLeadingTtf (line 137) | public function testLeadingTtf(): void
method testFont (line 144) | private function testFont(): Font
FILE: tests/Unit/Drivers/Gd/FrameTest.php
class FrameTest (line 16) | #[RequiresPhpExtension('gd')]
method getTestFrame (line 20) | protected function getTestFrame(): Frame
method testConstructor (line 25) | public function testConstructor(): void
method testGetNative (line 31) | public function testGetNative(): void
method testSetCore (line 37) | public function testSetCore(): void
method testGetSize (line 48) | public function testGetSize(): void
method testSetGetDelay (line 54) | public function testSetGetDelay(): void
method testSetGetDispose (line 64) | public function testSetGetDispose(): void
method testSetGetOffsetLeft (line 74) | public function testSetGetOffsetLeft(): void
method testSetGetOffsetTop (line 84) | public function testSetGetOffsetTop(): void
method testSetGetOffset (line 94) | public function testSetGetOffset(): void
method testToImage (line 106) | public function testToImage(): void
method testDebugInfo (line 112) | public function testDebugInfo(): void
FILE: tests/Unit/Drivers/Gd/ImageTest.php
class ImageTest (line 31) | #[RequiresPhpExtension('gd')]
method setUp (line 37) | protected function setUp(): void
method testClone (line 51) | public function testClone(): void
method testDriver (line 70) | public function testDriver(): void
method testCore (line 75) | public function testCore(): void
method testCount (line 80) | public function testCount(): void
method testIteration (line 85) | public function testIteration(): void
method testIsAnimated (line 92) | public function testIsAnimated(): void
method testSetGetLoops (line 97) | public function testSetGetLoops(): void
method testRemoveAnimation (line 105) | public function testRemoveAnimation(): void
method testSliceAnimation (line 113) | public function testSliceAnimation(): void
method testExif (line 121) | public function testExif(): void
method testModify (line 127) | public function testModify(): void
method testAnalyze (line 133) | public function testAnalyze(): void
method testEncode (line 139) | public function testEncode(): void
method testAutoEncode (line 145) | public function testAutoEncode(): void
method testEncodeByMediaType (line 152) | public function testEncodeByMediaType(): void
method testEncodeByExtension (line 167) | public function testEncodeByExtension(): void
method testEncodeByPath (line 182) | public function testEncodeByPath(): void
method testSaveAsFormat (line 193) | public function testSaveAsFormat(): void
method testSaveFallback (line 203) | public function testSaveFallback(): void
method testSaveUndeterminedPath (line 213) | public function testSaveUndeterminedPath(): void
method testWidthHeightSize (line 219) | public function testWidthHeightSize(): void
method testColorspace (line 226) | public function testColorspace(): void
method testSetColorspace (line 231) | public function testSetColorspace(): void
method testSetGetResolution (line 237) | public function testSetGetResolution(): void
method testPickColor (line 250) | public function testPickColor(): void
method testPickColors (line 256) | public function testPickColors(): void
method testProfile (line 263) | public function testProfile(): void
method testReduceColors (line 269) | public function testReduceColors(): void
method testSharpen (line 276) | public function testSharpen(): void
method testText (line 281) | public function testText(): void
method testBlendTransparencyDefault (line 286) | public function testBlendTransparencyDefault(): void
method testBlendTransparencyArgument (line 295) | public function testBlendTransparencyArgument(): void
method testBlendTransparencyIgnoreTransparencyInBlendingColor (line 304) | public function testBlendTransparencyIgnoreTransparencyInBlendingColor...
method testToJpeg (line 313) | public function testToJpeg(): void
method testToJpeg2000 (line 319) | public function testToJpeg2000(): void
method testToPng (line 325) | public function testToPng(): void
method testToGif (line 330) | public function testToGif(): void
method testToWebp (line 335) | public function testToWebp(): void
method testToBitmap (line 340) | public function testToBitmap(): void
method testToAvif (line 346) | public function testToAvif(): void
method testToTiff (line 351) | public function testToTiff(): void
method testToHeic (line 357) | public function testToHeic(): void
method testInvert (line 363) | public function testInvert(): void
method testPixelate (line 374) | public function testPixelate(): void
method testGreyscale (line 385) | public function testGreyscale(): void
method testBrightness (line 394) | public function testBrightness(): void
method testDebugInfo (line 403) | public function testDebugInfo(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/BlurModifierTest.php
class BlurModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testColorChange (line 17) | public function testColorChange(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/BrightnessModifierTest.php
class BrightnessModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testApply (line 17) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ColorizeModifierTest.php
class ColorizeModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ContainModifierTest.php
class ContainModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ContrastModifierTest.php
class ContrastModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testApply (line 17) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/CoverDownModifierTest.php
class CoverDownModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
method testModifyOddSize (line 31) | public function testModifyOddSize(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/CoverModifierTest.php
class CoverModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
method testModifyOddSize (line 31) | public function testModifyOddSize(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/CropModifierTest.php
class CropModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
method testModifyExtend (line 28) | public function testModifyExtend(): void
method testModifySinglePixel (line 40) | public function testModifySinglePixel(): void
method testModifyKeepsResolution (line 53) | public function testModifyKeepsResolution(): void
method testHalfTransparent (line 61) | public function testHalfTransparent(): void
method testMergeTransparentBackgrounds (line 78) | public function testMergeTransparentBackgrounds(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/DrawBezierModifierTest.php
class DrawBezierModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testApply (line 19) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/DrawEllipseModifierTest.php
class DrawEllipseModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testApply (line 19) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/DrawLineModifierTest.php
class DrawLineModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testApply (line 19) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/DrawPixelModifierTest.php
class DrawPixelModifierTest (line 13) | #[RequiresPhpExtension('gd')]
method testApply (line 18) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/DrawPolygonModifierTest.php
class DrawPolygonModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testApply (line 19) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/DrawRectangleModifierTest.php
class DrawRectangleModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testApply (line 19) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/FillModifierTest.php
class FillModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testFloodFillColor (line 19) | public function testFloodFillColor(): void
method testFillAllColor (line 29) | public function testFillAllColor(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/FlipFlopModifierTest.php
class FlipFlopModifierTest (line 13) | #[RequiresPhpExtension('gd')]
method testFlipImage (line 18) | public function testFlipImage(): void
method testFlopImage (line 26) | public function testFlopImage(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/GammaModifierTest.php
class GammaModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModifier (line 17) | public function testModifier(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/GreyscaleModifierTest.php
class GreyscaleModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testColorChange (line 17) | public function testColorChange(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/InvertModifierTest.php
class InvertModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testApply (line 17) | public function testApply(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/PadModifierTest.php
class PadModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/PixelateModifierTest.php
class PixelateModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/PlaceModifierTest.php
class PlaceModifierTest (line 13) | #[RequiresPhpExtension('gd')]
method testColorChange (line 18) | public function testColorChange(): void
method testColorChangeOpacityPng (line 26) | public function testColorChangeOpacityPng(): void
method testColorChangeOpacityJpeg (line 35) | public function testColorChangeOpacityJpeg(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/QuantizeColorsModifierTest.php
class QuantizeColorsModifierTest (line 14) | #[RequiresPhpExtension('gd')]
method testColorChange (line 19) | public function testColorChange(): void
method testNoColorReduction (line 27) | public function testNoColorReduction(): void
method testInvalidColorInput (line 35) | public function testInvalidColorInput(): void
method assertColorCount (line 42) | private function assertColorCount(int $count, ImageInterface $image): ...
method testVerifyColorValueAfterQuantization (line 59) | public function testVerifyColorValueAfterQuantization(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/RemoveAnimationModifierTest.php
class RemoveAnimationModifierTest (line 13) | #[RequiresPhpExtension('gd')]
method testApply (line 18) | public function testApply(): void
method testApplyPercent (line 27) | public function testApplyPercent(): void
method testApplyNonAnimated (line 36) | public function testApplyNonAnimated(): void
method testApplyInvalid (line 45) | public function testApplyInvalid(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ResizeCanvasModifierTest.php
class ResizeCanvasModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
method testModifyWithTransparency (line 30) | public function testModifyWithTransparency(): void
method testModifyEdge (line 59) | public function testModifyEdge(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ResizeCanvasRelativeModifierTest.php
class ResizeCanvasRelativeModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
method testModifyWithTransparency (line 30) | public function testModifyWithTransparency(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ResizeModifierTest.php
class ResizeModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/ResolutionModifierTest.php
class ResolutionModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testResolutionChange (line 17) | public function testResolutionChange(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/RotateModifierTest.php
class RotateModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testRotate (line 17) | public function testRotate(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/SharpenModifierTest.php
class SharpenModifierTest (line 12) | #[RequiresPhpExtension('gd')]
method testModify (line 17) | public function testModify(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/TextModifierTest.php
class TextModifierTest (line 16) | #[RequiresPhpExtension('gd')]
method testTextColor (line 21) | public function testTextColor(): void
FILE: tests/Unit/Drivers/Gd/Modifiers/TrimModifierTest.php
class TrimModifierTest (line 13) | #[RequiresPhpExtension('gd')]
method testTrim (line 18) | public function testTrim(): void
method testTrimGradient (line 28) | public function testTrimGradient(): void
method testTrimHighTolerance (line 38) | public function testTrimHighTolerance(): void
method testTrimAnimated (line 49) | public function testTrimAnimated(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/ColorspaceAnalyzerTest.php
class ColorspaceAnalyzerTest (line 14) | #[RequiresPhpExtension('imagick')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/HeightAnalyzerTest.php
class HeightAnalyzerTest (line 13) | #[RequiresPhpExtension('imagick')]
method testAnalyze (line 17) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/PixelColorAnalyzerTest.php
class PixelColorAnalyzerTest (line 14) | #[RequiresPhpExtension('imagick')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/PixelColorsAnalyzerTest.php
class PixelColorsAnalyzerTest (line 15) | #[RequiresPhpExtension('imagick')]
method testAnalyzeAnimated (line 19) | public function testAnalyzeAnimated(): void
method testAnalyzeNonAnimated (line 30) | public function testAnalyzeNonAnimated(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/ProfileAnalyzerTest.php
class ProfileAnalyzerTest (line 14) | #[RequiresPhpExtension('imagick')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/ResolutionAnalyzerTest.php
class ResolutionAnalyzerTest (line 14) | #[RequiresPhpExtension('imagick')]
method testAnalyze (line 18) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Imagick/Analyzers/WidthAnalyzerTest.php
class WidthAnalyzerTest (line 13) | #[RequiresPhpExtension('imagick')]
method testAnalyze (line 17) | public function testAnalyze(): void
FILE: tests/Unit/Drivers/Imagick/ColorProcessorTest.php
class ColorProcessorTest (line 15) | #[RequiresPhpExtension('imagick')]
method testColorToNative (line 19) | public function testColorToNative(): void
method testNativeToColor (line 26) | public function testNativeToColor(): void
FILE: tests/Unit/Drivers/Imagick/CoreTest.php
class CoreTest (line 16) | #[RequiresPhpExtension('imagick')]
method setUp (line 22) | protected function setUp(): void
method testAdd (line 41) | public function testAdd(): void
method testCount (line 51) | public function testCount(): void
method testIterator (line 56) | public function testIterator(): void
method testNative (line 63) | public function testNative(): void
method testSetNative (line 68) | public function testSetNative(): void
method testFrame (line 82) | public function testFrame(): void
method testSetGetLoops (line 91) | public function testSetGetLoops(): void
method testHas (line 99) | public function testHas(): void
method testPush (line 107) | public function testPush(): void
method testGet (line 117) | public function testGet(): void
method testEmpty (line 126) | public function testEmpty(): void
method testSlice (line 133) | public function testSlice(): void
method testFirst (line 141) | public function testFirst(): void
method testLast (line 146) | public function testLast(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/Base64ImageDecoderTest.php
class Base64ImageDecoderTest (line 15) | #[RequiresPhpExtension('imagick')]
method setUp (line 21) | protected function setUp(): void
method testDecode (line 27) | public function testDecode(): void
method testDecoderInvalid (line 36) | public function testDecoderInvalid(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/BinaryImageDecoderTest.php
class BinaryImageDecoderTest (line 18) | #[RequiresPhpExtension('imagick')]
method setUp (line 24) | protected function setUp(): void
method testDecodePng (line 30) | public function testDecodePng(): void
method testDecodeGif (line 40) | public function testDecodeGif(): void
method testDecodeAnimatedGif (line 49) | public function testDecodeAnimatedGif(): void
method testDecodeJpegWithExif (line 58) | public function testDecodeJpegWithExif(): void
method testDecodeCmykImage (line 68) | public function testDecodeCmykImage(): void
method testDecodeNonString (line 75) | public function testDecodeNonString(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/DataUriImageDecoderTest.php
class DataUriImageDecoderTest (line 16) | #[RequiresPhpExtension('imagick')]
method setUp (line 22) | protected function setUp(): void
method testDecode (line 28) | public function testDecode(): void
method testDecoderNonString (line 37) | public function testDecoderNonString(): void
method testDecoderInvalid (line 43) | public function testDecoderInvalid(): void
method testDecoderNonImage (line 49) | public function testDecoderNonImage(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/EncodedImageObjectDecoderTest.php
class EncodedImageObjectDecoderTest (line 15) | #[RequiresPhpExtension('imagick')]
method setUp (line 21) | protected function setUp(): void
method testDecode (line 27) | public function testDecode(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/FilePathImageDecoderTest.php
class FilePathImageDecoderTest (line 17) | #[RequiresPhpExtension('imagick')]
method setUp (line 23) | protected function setUp(): void
method testDecode (line 29) | #[DataProvider('validFormatPathsProvider')]
method validFormatPathsProvider (line 43) | public static function validFormatPathsProvider(): Generator
FILE: tests/Unit/Drivers/Imagick/Decoders/FilePointerImageDecoderTest.php
class FilePointerImageDecoderTest (line 14) | #[RequiresPhpExtension('imagick')]
method testDecode (line 18) | public function testDecode(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/ImageObjectDecoderTest.php
class ImageObjectDecoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testDecode (line 17) | public function testDecode(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/NativeObjectDecoderTest.php
class NativeObjectDecoderTest (line 16) | #[RequiresPhpExtension('imagick')]
method setUp (line 22) | protected function setUp(): void
method testDecode (line 28) | public function testDecode(): void
FILE: tests/Unit/Drivers/Imagick/Decoders/SplFileInfoImageDecoderTest.php
class SplFileInfoImageDecoderTest (line 15) | #[RequiresPhpExtension('imagick')]
method testDecode (line 19) | public function testDecode(): void
FILE: tests/Unit/Drivers/Imagick/DriverTest.php
class DriverTest (line 34) | #[RequiresPhpExtension('imagick')]
method setUp (line 40) | protected function setUp(): void
method testId (line 45) | public function testId(): void
method testCreateImage (line 50) | public function testCreateImage(): void
method testCreateAnimation (line 58) | public function testCreateAnimation(): void
method testHandleInputImage (line 72) | public function testHandleInputImage(): void
method testHandleInputColor (line 78) | public function testHandleInputColor(): void
method testHandleInputObjects (line 84) | public function testHandleInputObjects(): void
method testHandleInputClassnames (line 92) | public function testHandleInputClassnames(): void
method testColorProcessor (line 100) | public function testColorProcessor(): void
method testSupports (line 106) | #[DataProvider('supportsDataProvider')]
method supportsDataProvider (line 112) | public static function supportsDataProvider(): Generator
method testVersion (line 222) | public function testVersion(): void
method testSpecialize (line 227) | #[DataProvider('spezializeDataProvider')]
method spezializeDataProvider (line 233) | public static function spezializeDataProvider(): Generator
method testSpecializeFailure (line 248) | public function testSpecializeFailure(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/AvifEncoderTest.php
class AvifEncoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testEncode (line 17) | public function testEncode(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/BmpEncoderTest.php
class BmpEncoderTest (line 12) | #[RequiresPhpExtension('imagick')]
method testEncode (line 16) | public function testEncode(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/GifEncoderTest.php
class GifEncoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testEncode (line 17) | public function testEncode(): void
method testEncodeInterlaced (line 29) | public function testEncodeInterlaced(): void
method testEncodeInterlacedAnimation (line 41) | public function testEncodeInterlacedAnimation(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/HeicEncoderTest.php
class HeicEncoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testEncode (line 17) | public function testEncode(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/Jpeg2000EncoderTest.php
class Jpeg2000EncoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testEncode (line 17) | public function testEncode(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/JpegEncoderTest.php
class JpegEncoderTest (line 15) | #[RequiresPhpExtension('imagick')]
method testEncode (line 21) | public function testEncode(): void
method testEncodeProgressive (line 31) | public function testEncodeProgressive(): void
method testEncodeStripExif (line 42) | public function testEncodeStripExif(): void
method testEncodeStripExifKeepICCProfiles (line 56) | public function testEncodeStripExifKeepICCProfiles(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/PngEncoderTest.php
class PngEncoderTest (line 16) | #[RequiresPhpExtension('imagick')]
method testEncode (line 22) | public function testEncode(): void
method testEncodeInterlaced (line 32) | public function testEncodeInterlaced(): void
method testEncoderIndexed (line 42) | #[DataProvider('indexedDataProvider')]
method indexedDataProvider (line 51) | public static function indexedDataProvider(): Generator
FILE: tests/Unit/Drivers/Imagick/Encoders/TiffEncoderTest.php
class TiffEncoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testEncode (line 17) | public function testEncode(): void
FILE: tests/Unit/Drivers/Imagick/Encoders/WebpEncoderTest.php
class WebpEncoderTest (line 13) | #[RequiresPhpExtension('imagick')]
method testEncode (line 17) | public function testEncode(): void
FILE: tests/Unit/Drivers/Imagick/FontProcessorTest.php
class FontProcessorTest (line 16) | #[RequiresPhpExtension('imagick')]
method testBoxSizeTtf (line 20) | public function testBoxSizeTtf(): void
method testNativeFontSize (line 33) | public function testNativeFontSize(): void
method testTextBlock (line 42) | public function testTextBlock(): void
method testTypographicalSize (line 53) | public function testTypographicalSize(): void
method testCapHeight (line 60) | public function testCapHeight(): void
method testLeading (line 67) | public function testLeading(): void
method testFont (line 74) | private function testFont(): Font
FILE: tests/Unit/Drivers/Imagick/FrameTest.php
class FrameTest (line 17) | #[RequiresPhpExtension('imagick')]
method getTestFrame (line 21) | protected function getTestFrame(): Frame
method testConstructor (line 32) | public function testConstructor(): void
method testGetSize (line 38) | public function testGetSize(): void
method testSetGetDelay (line 44) | public function testSetGetDelay(): void
method testSetGetDispose (line 55) | public function testSetGetDispose(): void
method testSetGetOffsetLeft (line 65) | public function testSetGetOffsetLeft(): void
method testSetGetOffsetTop (line 75) | public function testSetGetOffsetTop(): void
method testSetGetOffset (line 85) | public function testSetGetOffset(): void
method testToImage (line 97) | public function testToImage(): void
FILE: tests/Unit/Drivers/Imagick/ImageTest.php
class ImageTest (line 31) | #[RequiresPhpExtension('imagick')]
method setUp (line 37) | protected function setUp(): void
method testClone (line 50) | public function testClone(): void
method testDriver (line 69) | public function testDriver(): void
method testCore (line 74) | public function testCore(): void
method testCount (line 79) | public function testCount(): void
method testIteration (line 84) | public function testIteration(): void
method testIsAnimated (line 91) | public function testIsAnimated(): void
method testSetGetLoops (line 96) | public function testSetGetLoops(): void
method testSetGetOrigin (line 104) | public function testSetGetOrigin(): void
method testRemoveAnimation (line 114) | public function testRemoveAnimation(): void
method testSliceAnimation (line 122) | public function testSliceAnimation(): void
method testExif (line 130) | public function testExif(): void
method testModify (line 136) | public function testModify(): void
method testAnalyze (line 142) | public function testAnalyze(): void
method testEncode (line 148) | public function testEncode(): void
method testAutoEncode (line 154) | public function testAutoEncode(): void
method testEncodeByMediaType (line 161) | public function testEncodeByMediaType(): void
method testEncodeByExtension (line 172) | public function testEncodeByExtension(): void
method testEncodeByPath (line 183) | public function testEncodeByPath(): void
method testSaveAsFormat (line 194) | public function testSaveAsFormat(): void
method testSaveFallback (line 204) | public function testSaveFallback(): void
method testSaveUndeterminedPath (line 214) | public function testSaveUndeterminedPath(): void
method testWidthHeightSize (line 220) | public function testWidthHeightSize(): void
method testSetGetColorspace (line 227) | public function testSetGetColorspace(): void
method testSetGetResolution (line 236) | public function testSetGetResolution(): void
method testPickColor (line 249) | public function testPickColor(): void
method testPickColors (line 255) | public function testPickColors(): void
method testProfile (line 262) | public function testProfile(): void
method testReduceColors (line 268) | public function testReduceColors(): void
method testSharpen (line 275) | public function testSharpen(): void
method testBlendTransparencyDefault (line 280) | public function testBlendTransparencyDefault(): void
method testBlendTransparencyArgument (line 289) | public function testBlendTransparencyArgument(): void
method testBlendTransparencyIgnoreTransparencyInBlendingColor (line 298) | public function testBlendTransparencyIgnoreTransparencyInBlendingColor...
method testToJpeg (line 307) | public function testToJpeg(): void
method testToJpeg2000 (line 313) | public function testToJpeg2000(): void
method testToPng (line 319) | public function testToPng(): void
method testToGif (line 324) | public function testToGif(): void
method testToWebp (line 329) | public function testToWebp(): void
method testToBitmap (line 334) | public function testToBitmap(): void
method testToAvif (line 340) | public function testToAvif(): void
method testToTiff (line 345) | public function testToTiff(): void
method testToHeic (line 351) | public function testToHeic(): void
method testInvert (line 356) | public function testInvert(): void
method testPixelate (line 367) | public function testPixelate(): void
method testGreyscale (line 387) | public function testGreyscale(): void
method testBrightness (line 396) | public function testBrightness(): void
method testDebugInfo (line 405) | public function testDebugInfo(): void
FILE: tests/Unit/Drivers/Imagick/Modifiers/BlurModifierTest.php
class Blu
Condensed preview — 551 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,039K chars).
[
{
"path": ".editorconfig",
"chars": 187,
"preview": "# editorconfig.org\n\nroot = true\n\n[*.php]\nindent_size = 4\nindent_style = space\nindent_size = 4\nend_of_line = lf\ncharset ="
},
{
"path": ".gitattributes",
"chars": 421,
"preview": "* text=auto\n\n/.editorconfig export-ignore\n/.github export-ignore\n/.well-known export-ignore\n/CONT"
},
{
"path": ".github/FUNDING.yml",
"chars": 87,
"preview": "github: [Intervention]\nko_fi: interventionphp\ncustom: https://paypal.me/interventionio\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 554,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n## Describe the b"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 361,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n## Describe th"
},
{
"path": ".github/workflows/run-tests.yml",
"chars": 3671,
"preview": "name: Tests\n\non: [ push, pull_request ]\n\njobs:\n run:\n runs-on: ubuntu-22.04\n strategy:\n fail-fast: false\n "
},
{
"path": ".gitignore",
"chars": 80,
"preview": "build/\nvendor/\n/.phpunit.cache\ncomposer.lock\nphpunit.xml\nphpcs.xml\nphpstan.neon\n"
},
{
"path": ".well-known/funding-manifest-urls",
"chars": 80,
"preview": "https://intervention.io/funding.json\nhttps://image.intervention.io/funding.json\n"
},
{
"path": "CONTRIBUTING.md",
"chars": 183,
"preview": "# Contributing to Intervention Image\n\nThank you for your interest in contributing to the project. \n\nYou can read the ful"
},
{
"path": "Dockerfile",
"chars": 733,
"preview": "FROM php:8.1-cli\n\n# install dependencies\nRUN apt update \\\n && apt install -y \\\n libmagickwand-dev \\\n "
},
{
"path": "LICENSE",
"chars": 1087,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013-present Oliver Vogel\n\nPermission is hereby granted, free of charge, to any per"
},
{
"path": "composer.json",
"chars": 1242,
"preview": "{\n \"name\": \"intervention/image\",\n \"description\": \"PHP Image Processing\",\n \"homepage\": \"https://image.interventi"
},
{
"path": "docker-compose.yml",
"chars": 609,
"preview": "services:\n tests:\n build: ./\n working_dir: /project\n entrypoint: [\"./vendor/bin/phpunit\"]\n volumes:\n -"
},
{
"path": "phpcs.xml.dist",
"chars": 6047,
"preview": "<?xml version=\"1.0\"?>\n<ruleset name=\"Intervention\">\n <file>src/</file>\n <file>tests/</file>\n <arg name=\"colors\""
},
{
"path": "phpstan.dist.neon",
"chars": 410,
"preview": "parameters:\n level: 6\n paths:\n - src\n reportUnmatchedIgnoredErrors: false\n ignoreErrors:\n - \n "
},
{
"path": "phpunit.dist.xml",
"chars": 866,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit \n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n xsi:noNa"
},
{
"path": "readme.md",
"chars": 2862,
"preview": "# Intervention Image\n## PHP Image Processing\n\n[;\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Analyzers/HeightAnalyzer.php",
"chars": 191,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Analyzers/PixelColorAnalyzer.php",
"chars": 326,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Analyzers/PixelColorsAnalyzer.php",
"chars": 292,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Analyzers/ProfileAnalyzer.php",
"chars": 192,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Analyzers/ResolutionAnalyzer.php",
"chars": 195,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Analyzers/WidthAnalyzer.php",
"chars": 190,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Analyzers;\n\nuse Intervention\\Image\\Drivers\\SpecializableAn"
},
{
"path": "src/Collection.php",
"chars": 4543,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image;\n\nuse Intervention\\Image\\Interfaces\\CollectionInterface;\nu"
},
{
"path": "src/Colors/AbstractColor.php",
"chars": 2707,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors;\n\nuse Intervention\\Image\\Exceptions\\ColorException;"
},
{
"path": "src/Colors/AbstractColorChannel.php",
"chars": 2142,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors;\n\nuse Intervention\\Image\\Exceptions\\ColorException;"
},
{
"path": "src/Colors/Cmyk/Channels/Cyan.php",
"chars": 307,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstr"
},
{
"path": "src/Colors/Cmyk/Channels/Key.php",
"chars": 119,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk\\Channels;\n\nclass Key extends Cyan\n{\n //\n}\n"
},
{
"path": "src/Colors/Cmyk/Channels/Magenta.php",
"chars": 123,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk\\Channels;\n\nclass Magenta extends Cyan\n{\n //"
},
{
"path": "src/Colors/Cmyk/Channels/Yellow.php",
"chars": 122,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk\\Channels;\n\nclass Yellow extends Cyan\n{\n //\n"
},
{
"path": "src/Colors/Cmyk/Color.php",
"chars": 3365,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk;\n\nuse Intervention\\Image\\Colors\\AbstractColor;"
},
{
"path": "src/Colors/Cmyk/Colorspace.php",
"chars": 2355,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk;\n\nuse Intervention\\Image\\Colors\\Rgb\\Color as R"
},
{
"path": "src/Colors/Cmyk/Decoders/StringColorDecoder.php",
"chars": 1207,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Cmyk\\Decoders;\n\nuse Intervention\\Image\\Colors\\Cmyk\\"
},
{
"path": "src/Colors/Hsl/Channels/Hue.php",
"chars": 475,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsl\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Hsl/Channels/Luminance.php",
"chars": 481,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsl\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Hsl/Channels/Saturation.php",
"chars": 482,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsl\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Hsl/Color.php",
"chars": 2882,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsl;\n\nuse Intervention\\Image\\Colors\\AbstractColor;\n"
},
{
"path": "src/Colors/Hsl/Colorspace.php",
"chars": 4087,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsl;\n\nuse Intervention\\Image\\Colors\\Cmyk\\Color as C"
},
{
"path": "src/Colors/Hsl/Decoders/StringColorDecoder.php",
"chars": 1268,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsl\\Decoders;\n\nuse Intervention\\Image\\Colors\\Hsl\\Co"
},
{
"path": "src/Colors/Hsv/Channels/Hue.php",
"chars": 475,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsv\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Hsv/Channels/Saturation.php",
"chars": 482,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsv\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Hsv/Channels/Value.php",
"chars": 477,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsv\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Hsv/Color.php",
"chars": 2858,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsv;\n\nuse Intervention\\Image\\Colors\\AbstractColor;\n"
},
{
"path": "src/Colors/Hsv/Colorspace.php",
"chars": 3558,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsv;\n\nuse Intervention\\Image\\Colors\\Cmyk\\Color as C"
},
{
"path": "src/Colors/Hsv/Decoders/StringColorDecoder.php",
"chars": 1276,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Hsv\\Decoders;\n\nuse Intervention\\Image\\Colors\\Hsv\\Co"
},
{
"path": "src/Colors/Profile.php",
"chars": 485,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors;\n\nuse Intervention\\Image\\File;\nuse Intervention\\Ima"
},
{
"path": "src/Colors/Rgb/Channels/Alpha.php",
"chars": 306,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Channels;\n\nclass Alpha extends Red\n{\n /**\n "
},
{
"path": "src/Colors/Rgb/Channels/Blue.php",
"chars": 118,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Channels;\n\nclass Blue extends Red\n{\n //\n}\n"
},
{
"path": "src/Colors/Rgb/Channels/Green.php",
"chars": 119,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Channels;\n\nclass Green extends Red\n{\n //\n}\n"
},
{
"path": "src/Colors/Rgb/Channels/Red.php",
"chars": 475,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Channels;\n\nuse Intervention\\Image\\Colors\\Abstra"
},
{
"path": "src/Colors/Rgb/Color.php",
"chars": 4211,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb;\n\nuse Intervention\\Image\\Colors\\AbstractColor;\n"
},
{
"path": "src/Colors/Rgb/Colorspace.php",
"chars": 4308,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb;\n\nuse Intervention\\Image\\Colors\\Hsv\\Color as Hs"
},
{
"path": "src/Colors/Rgb/Decoders/HexColorDecoder.php",
"chars": 1553,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Decoders;\n\nuse Intervention\\Image\\Colors\\Rgb\\Co"
},
{
"path": "src/Colors/Rgb/Decoders/HtmlColornameDecoder.php",
"chars": 5701,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\De"
},
{
"path": "src/Colors/Rgb/Decoders/StringColorDecoder.php",
"chars": 1730,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Decoders;\n\nuse Intervention\\Image\\Colors\\Rgb\\Co"
},
{
"path": "src/Colors/Rgb/Decoders/TransparentColorDecoder.php",
"chars": 746,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Colors\\Rgb\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\De"
},
{
"path": "src/Config.php",
"chars": 1548,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image;\n\nuse Intervention\\Image\\Exceptions\\InputException;\n\nclass"
},
{
"path": "src/Decoders/Base64ImageDecoder.php",
"chars": 192,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/BinaryImageDecoder.php",
"chars": 192,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/ColorObjectDecoder.php",
"chars": 646,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\AbstractDecoder;"
},
{
"path": "src/Decoders/DataUriImageDecoder.php",
"chars": 193,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/EncodedImageObjectDecoder.php",
"chars": 199,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/FilePathImageDecoder.php",
"chars": 194,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/FilePointerImageDecoder.php",
"chars": 197,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/ImageObjectDecoder.php",
"chars": 646,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\AbstractDecoder;"
},
{
"path": "src/Decoders/NativeObjectDecoder.php",
"chars": 193,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Decoders/SplFileInfoImageDecoder.php",
"chars": 197,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Decoders;\n\nuse Intervention\\Image\\Drivers\\SpecializableDec"
},
{
"path": "src/Drivers/AbstractDecoder.php",
"chars": 3877,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers;\n\nuse Exception;\nuse Intervention\\Image\\Collection"
},
{
"path": "src/Drivers/AbstractDriver.php",
"chars": 3967,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers;\n\nuse Intervention\\Image\\Config;\nuse Intervention\\"
},
{
"path": "src/Drivers/AbstractEncoder.php",
"chars": 1153,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers;\n\nuse Intervention\\Image\\EncodedImage;\nuse Interve"
},
{
"path": "src/Drivers/AbstractFontProcessor.php",
"chars": 5268,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers;\n\nuse Intervention\\Image\\Exceptions\\FontException;"
},
{
"path": "src/Drivers/AbstractFrame.php",
"chars": 533,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers;\n\nuse Intervention\\Image\\Interfaces\\FrameInterface"
},
{
"path": "src/Drivers/Gd/Analyzers/ColorspaceAnalyzer.php",
"chars": 603,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Analyzers;\n\nuse Intervention\\Image\\Analyzers\\Co"
},
{
"path": "src/Drivers/Gd/Analyzers/HeightAnalyzer.php",
"chars": 558,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Analyzers;\n\nuse Intervention\\Image\\Analyzers\\He"
},
{
"path": "src/Drivers/Gd/Analyzers/PixelColorAnalyzer.php",
"chars": 1486,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Analyzers;\n\nuse GdImage;\nuse Intervention\\Image"
},
{
"path": "src/Drivers/Gd/Analyzers/PixelColorsAnalyzer.php",
"chars": 641,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Analyzers;\n\nuse Intervention\\Image\\Collection;\n"
},
{
"path": "src/Drivers/Gd/Analyzers/ResolutionAnalyzer.php",
"chars": 636,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Analyzers;\n\nuse Intervention\\Image\\Analyzers\\Re"
},
{
"path": "src/Drivers/Gd/Analyzers/WidthAnalyzer.php",
"chars": 554,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Analyzers;\n\nuse Intervention\\Image\\Analyzers\\Wi"
},
{
"path": "src/Drivers/Gd/Cloner.php",
"chars": 2910,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd;\n\nuse GdImage;\nuse Intervention\\Image\\Colors\\Rg"
},
{
"path": "src/Drivers/Gd/ColorProcessor.php",
"chars": 4244,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd;\n\nuse Intervention\\Image\\Colors\\Rgb\\Channels\\Al"
},
{
"path": "src/Drivers/Gd/Core.php",
"chars": 2225,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd;\n\nuse Intervention\\Image\\Collection;\nuse Interv"
},
{
"path": "src/Drivers/Gd/Decoders/AbstractDecoder.php",
"chars": 2631,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\Drivers\\Speci"
},
{
"path": "src/Drivers/Gd/Decoders/Base64ImageDecoder.php",
"chars": 725,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\De"
},
{
"path": "src/Drivers/Gd/Decoders/BinaryImageDecoder.php",
"chars": 1918,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\Ru"
},
{
"path": "src/Drivers/Gd/Decoders/DataUriImageDecoder.php",
"chars": 976,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\De"
},
{
"path": "src/Drivers/Gd/Decoders/EncodedImageObjectDecoder.php",
"chars": 682,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\EncodedImage;"
},
{
"path": "src/Drivers/Gd/Decoders/FilePathImageDecoder.php",
"chars": 2054,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\De"
},
{
"path": "src/Drivers/Gd/Decoders/FilePointerImageDecoder.php",
"chars": 818,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Intervention\\Image\\Exceptions\\De"
},
{
"path": "src/Drivers/Gd/Decoders/NativeObjectDecoder.php",
"chars": 3186,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse Exception;\nuse GdImage;\nuse Inte"
},
{
"path": "src/Drivers/Gd/Decoders/SplFileInfoImageDecoder.php",
"chars": 744,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Decoders;\n\nuse SplFileInfo;\nuse Intervention\\Im"
},
{
"path": "src/Drivers/Gd/Driver.php",
"chars": 4235,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd;\n\nuse Intervention\\Image\\Drivers\\AbstractDriver"
},
{
"path": "src/Drivers/Gd/Encoders/AvifEncoder.php",
"chars": 718,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Encoders;\n\nuse Intervention\\Image\\EncodedImage;"
},
{
"path": "src/Drivers/Gd/Encoders/BmpEncoder.php",
"chars": 703,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Encoders;\n\nuse Intervention\\Image\\EncodedImage;"
},
{
"path": "src/Drivers/Gd/Encoders/GifEncoder.php",
"chars": 1897,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Encoders;\n\nuse Exception;\nuse Intervention\\Gif\\"
},
{
"path": "src/Drivers/Gd/Encoders/JpegEncoder.php",
"chars": 1050,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Encoders;\n\nuse Intervention\\Image\\Drivers\\Gd\\Cl"
},
{
"path": "src/Drivers/Gd/Encoders/PngEncoder.php",
"chars": 1507,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Encoders;\n\nuse GdImage;\nuse Intervention\\Image\\"
},
{
"path": "src/Drivers/Gd/Encoders/WebpEncoder.php",
"chars": 835,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Encoders;\n\nuse Intervention\\Image\\EncodedImage;"
},
{
"path": "src/Drivers/Gd/FontProcessor.php",
"chars": 3216,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd;\n\nuse Intervention\\Image\\Drivers\\AbstractFontPr"
},
{
"path": "src/Drivers/Gd/Frame.php",
"chars": 3907,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd;\n\nuse GdImage;\nuse Intervention\\Image\\Drivers\\A"
},
{
"path": "src/Drivers/Gd/Modifiers/AlignRotationModifier.php",
"chars": 1537,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php",
"chars": 1015,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Drivers\\Gd\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/BlurModifier.php",
"chars": 716,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/BrightnessModifier.php",
"chars": 695,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ColorizeModifier.php",
"chars": 862,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ColorspaceModifier.php",
"chars": 877,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Colors\\Rgb\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/ContainModifier.php",
"chars": 2991,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Colors\\Rgb\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/ContrastModifier.php",
"chars": 677,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/CoverDownModifier.php",
"chars": 432,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\G"
},
{
"path": "src/Drivers/Gd/Modifiers/CoverModifier.php",
"chars": 1603,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Drivers\\Gd\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/CropModifier.php",
"chars": 2506,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Drivers\\Gd\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/DrawBezierModifier.php",
"chars": 9239,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse RuntimeException;\nuse Intervent"
},
{
"path": "src/Drivers/Gd/Modifiers/DrawEllipseModifier.php",
"chars": 2809,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse RuntimeException;\nuse Intervent"
},
{
"path": "src/Drivers/Gd/Modifiers/DrawLineModifier.php",
"chars": 1177,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse RuntimeException;\nuse Intervent"
},
{
"path": "src/Drivers/Gd/Modifiers/DrawPixelModifier.php",
"chars": 981,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/DrawPolygonModifier.php",
"chars": 1657,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse RuntimeException;\nuse Intervent"
},
{
"path": "src/Drivers/Gd/Modifiers/DrawRectangleModifier.php",
"chars": 2075,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse RuntimeException;\nuse Intervent"
},
{
"path": "src/Drivers/Gd/Modifiers/FillModifier.php",
"chars": 1764,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\R"
},
{
"path": "src/Drivers/Gd/Modifiers/FlipModifier.php",
"chars": 636,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/FlopModifier.php",
"chars": 638,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/GammaModifier.php",
"chars": 646,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/GreyscaleModifier.php",
"chars": 661,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/InvertModifier.php",
"chars": 646,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/PadModifier.php",
"chars": 564,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/PixelateModifier.php",
"chars": 675,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/PlaceModifier.php",
"chars": 3288,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\R"
},
{
"path": "src/Drivers/Gd/Modifiers/ProfileModifier.php",
"chars": 687,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\N"
},
{
"path": "src/Drivers/Gd/Modifiers/ProfileRemovalModifier.php",
"chars": 687,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/QuantizeColorsModifier.php",
"chars": 2208,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Drivers\\Gd\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/RemoveAnimationModifier.php",
"chars": 670,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ResizeCanvasModifier.php",
"chars": 830,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ResizeCanvasRelativeModifier.php",
"chars": 406,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ResizeDownModifier.php",
"chars": 398,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ResizeModifier.php",
"chars": 1993,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Drivers\\Gd\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/ResolutionModifier.php",
"chars": 732,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/RotateModifier.php",
"chars": 3293,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Colors\\Rgb\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/ScaleDownModifier.php",
"chars": 486,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/ScaleModifier.php",
"chars": 388,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/SharpenModifier.php",
"chars": 1124,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Interfaces\\I"
},
{
"path": "src/Drivers/Gd/Modifiers/SliceAnimationModifier.php",
"chars": 826,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\A"
},
{
"path": "src/Drivers/Gd/Modifiers/TextModifier.php",
"chars": 4934,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\C"
},
{
"path": "src/Drivers/Gd/Modifiers/TrimModifier.php",
"chars": 2880,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Gd\\Modifiers;\n\nuse Intervention\\Image\\Exceptions\\A"
},
{
"path": "src/Drivers/Imagick/Analyzers/ColorspaceAnalyzer.php",
"chars": 774,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Analyzers/HeightAnalyzer.php",
"chars": 487,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Intervention\\Image\\Analyze"
},
{
"path": "src/Drivers/Imagick/Analyzers/PixelColorAnalyzer.php",
"chars": 1089,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Analyzers/PixelColorsAnalyzer.php",
"chars": 561,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Intervention\\Image\\Collect"
},
{
"path": "src/Drivers/Imagick/Analyzers/ProfileAnalyzer.php",
"chars": 773,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Intervention\\Image\\Analyze"
},
{
"path": "src/Drivers/Imagick/Analyzers/ResolutionAnalyzer.php",
"chars": 735,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Intervention\\Image\\Analyze"
},
{
"path": "src/Drivers/Imagick/Analyzers/WidthAnalyzer.php",
"chars": 482,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Analyzers;\n\nuse Intervention\\Image\\Analyze"
},
{
"path": "src/Drivers/Imagick/ColorProcessor.php",
"chars": 1493,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick;\n\nuse Imagick;\nuse ImagickPixel;\nuse Inter"
},
{
"path": "src/Drivers/Imagick/Core.php",
"chars": 6529,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick;\n\nuse Imagick;\nuse ImagickException;\nuse I"
},
{
"path": "src/Drivers/Imagick/Decoders/Base64ImageDecoder.php",
"chars": 650,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Intervention\\Image\\Exceptio"
},
{
"path": "src/Drivers/Imagick/Decoders/BinaryImageDecoder.php",
"chars": 1256,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Imagick;\nuse ImagickExcepti"
},
{
"path": "src/Drivers/Imagick/Decoders/DataUriImageDecoder.php",
"chars": 901,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Intervention\\Image\\Exceptio"
},
{
"path": "src/Drivers/Imagick/Decoders/EncodedImageObjectDecoder.php",
"chars": 687,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Intervention\\Image\\EncodedI"
},
{
"path": "src/Drivers/Imagick/Decoders/FilePathImageDecoder.php",
"chars": 1205,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Imagick;\nuse ImagickExcepti"
},
{
"path": "src/Drivers/Imagick/Decoders/FilePointerImageDecoder.php",
"chars": 823,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Intervention\\Image\\Exceptio"
},
{
"path": "src/Drivers/Imagick/Decoders/NativeObjectDecoder.php",
"chars": 2321,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Decoders/SplFileInfoImageDecoder.php",
"chars": 669,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Decoders;\n\nuse SplFileInfo;\nuse Interventi"
},
{
"path": "src/Drivers/Imagick/Driver.php",
"chars": 4748,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick;\n\nuse Imagick;\nuse ImagickPixel;\nuse Inter"
},
{
"path": "src/Drivers/Imagick/Encoders/AvifEncoder.php",
"chars": 1283,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Encoders/BmpEncoder.php",
"chars": 907,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Encoders/GifEncoder.php",
"chars": 1020,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Encoders/HeicEncoder.php",
"chars": 1120,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Intervention\\Image\\Drivers\\"
},
{
"path": "src/Drivers/Imagick/Encoders/Jpeg2000Encoder.php",
"chars": 1397,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Encoders/JpegEncoder.php",
"chars": 2103,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Encoders/PngEncoder.php",
"chars": 1358,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse Intervention\\I"
},
{
"path": "src/Drivers/Imagick/Encoders/TiffEncoder.php",
"chars": 1259,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Intervention\\Image\\Drivers\\"
},
{
"path": "src/Drivers/Imagick/Encoders/WebpEncoder.php",
"chars": 1555,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Encoders;\n\nuse Imagick;\nuse ImagickPixel;\n"
},
{
"path": "src/Drivers/Imagick/FontProcessor.php",
"chars": 1987,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick;\n\nuse Imagick;\nuse ImagickDraw;\nuse Imagic"
},
{
"path": "src/Drivers/Imagick/Frame.php",
"chars": 4013,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick;\n\nuse Imagick;\nuse ImagickException;\nuse I"
},
{
"path": "src/Drivers/Imagick/Modifiers/AlignRotationModifier.php",
"chars": 1880,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Modifiers/BlendTransparencyModifier.php",
"chars": 1090,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Modifiers/BlurModifier.php",
"chars": 575,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/BrightnessModifier.php",
"chars": 597,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/ColorizeModifier.php",
"chars": 1214,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Modifiers/ColorspaceModifier.php",
"chars": 1568,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Modifiers/ContainModifier.php",
"chars": 2840,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse ImagickPi"
},
{
"path": "src/Drivers/Imagick/Modifiers/ContrastModifier.php",
"chars": 612,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/CoverDownModifier.php",
"chars": 437,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Excepti"
},
{
"path": "src/Drivers/Imagick/Modifiers/CoverModifier.php",
"chars": 971,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/CropModifier.php",
"chars": 2967,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse ImagickPixel;"
},
{
"path": "src/Drivers/Imagick/Modifiers/DrawBezierModifier.php",
"chars": 2591,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse RuntimeEx"
},
{
"path": "src/Drivers/Imagick/Modifiers/DrawEllipseModifier.php",
"chars": 1520,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse RuntimeEx"
},
{
"path": "src/Drivers/Imagick/Modifiers/DrawLineModifier.php",
"chars": 1174,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse RuntimeEx"
},
{
"path": "src/Drivers/Imagick/Modifiers/DrawPixelModifier.php",
"chars": 880,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse Intervent"
},
{
"path": "src/Drivers/Imagick/Modifiers/DrawPolygonModifier.php",
"chars": 1823,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse ImagickPi"
},
{
"path": "src/Drivers/Imagick/Modifiers/DrawRectangleModifier.php",
"chars": 1531,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse ImagickDraw;\nuse RuntimeEx"
},
{
"path": "src/Drivers/Imagick/Modifiers/FillModifier.php",
"chars": 1868,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse ImagickDraw;\n"
},
{
"path": "src/Drivers/Imagick/Modifiers/FlipModifier.php",
"chars": 541,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/FlopModifier.php",
"chars": 545,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/GammaModifier.php",
"chars": 558,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/GreyscaleModifier.php",
"chars": 576,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/InvertModifier.php",
"chars": 556,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/PadModifier.php",
"chars": 569,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/PixelateModifier.php",
"chars": 965,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Interfa"
},
{
"path": "src/Drivers/Imagick/Modifiers/PlaceModifier.php",
"chars": 1251,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Imagick;\nuse Intervention\\"
},
{
"path": "src/Drivers/Imagick/Modifiers/ProfileModifier.php",
"chars": 753,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Excepti"
},
{
"path": "src/Drivers/Imagick/Modifiers/ProfileRemovalModifier.php",
"chars": 766,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Excepti"
},
{
"path": "src/Drivers/Imagick/Modifiers/QuantizeColorsModifier.php",
"chars": 1117,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Intervention\\Image\\Drivers\\Imagick\\Modifiers;\n\nuse Intervention\\Image\\Excepti"
}
]
// ... and 351 more files (download for full content)
About this extraction
This page contains the full source code of the Intervention/image GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 551 files (933.6 KB), approximately 250.6k tokens, and a symbol index with 2541 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.