Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
ImageInfo
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\ImageMetadata;
6
7/**
8 * Parsed image header metadata — everything needed to build a PDF ImageXObject
9 * without decoding pixel data.
10 */
11final class ImageInfo
12{
13    public function __construct(
14        public readonly int    $width,
15        public readonly int    $height,
16        public readonly string $colorSpace,      // 'DeviceGray', 'DeviceRGB', 'DeviceCMYK'
17        public readonly int    $bitsPerComponent,
18        public readonly string $format,          // 'jpeg', 'png', 'gif', 'tiff', 'webp', 'svg'
19        public readonly bool   $hasAlpha = false,
20        public readonly ?int   $xDpi = null,
21        public readonly ?int   $yDpi = null,
22        public readonly ?string $iccProfile = null,
23        // Intrinsic aspect ratio (width / height) for resolution-
24        // independent images — populated by `SvgParser` when the
25        // root `<svg>` carries either explicit width/height or a
26        // `viewBox`. Raster parsers leave this null; the ratio is
27        // already implicit in their pixel `width`/`height`.
28        public readonly ?float $intrinsicRatio = null,
29    ) {}
30}