getWidth(), height: $imageInfo->getHeight(), extension: $imageInfo->getExtension(), fullPath: $imageInfo->getPathname(), publicUrl: PathUtility::getAbsoluteWebPath($imageInfo->getPathname(), false), ); } public static function createFromProcessedFile(ProcessedFile $processedFile): self { return new self( width: (int)$processedFile->getProperty('width'), height: (int)$processedFile->getProperty('height'), extension: $processedFile->getExtension(), fullPath: $processedFile->getForLocalProcessing(false), publicUrl: $processedFile->getPublicUrl(), originalFile: $processedFile->getOriginalFile(), processedFile: $processedFile ); } public function getWidth(): int { return $this->width; } public function withWidth(int $width): self { $imageResource = clone $this; $imageResource->width = $width; return $imageResource; } public function getHeight(): int { return $this->height; } public function withHeight(int $height): self { $imageResource = clone $this; $imageResource->height = $height; return $imageResource; } public function getExtension(): string { return $this->extension; } public function withExtension(string $extension): self { $imageResource = clone $this; $imageResource->extension = $extension; return $imageResource; } public function getFullPath(): string { return $this->fullPath; } public function withFullPath(string $fullPath): self { $imageResource = clone $this; $imageResource->fullPath = $fullPath; return $imageResource; } public function getPublicUrl(): ?string { return $this->publicUrl; } public function withPublicUrl(string $publicUrl): self { $imageResource = clone $this; $imageResource->publicUrl = $publicUrl; return $imageResource; } public function getOriginalFile(): ?File { return $this->originalFile; } public function withOriginalFile(?File $originalFile): self { $imageResource = clone $this; $imageResource->originalFile = $originalFile; return $imageResource; } public function getProcessedFile(): ?ProcessedFile { return $this->processedFile; } public function withProcessedFile(?ProcessedFile $processedFile): self { $imageResource = clone $this; $imageResource->processedFile = $processedFile; return $imageResource; } /** * Legacy image resource information, used for asset collector and GifBuilder BBOX * * @return array{0: int<0, max>, 1: int<0, max>, 2: string, 3: string, 'origFile': string|null, 'origFile_mtime': int} */ public function getLegacyImageResourceInformation(): array { return [ 0 => $this->width, 1 => $this->height, 2 => $this->extension, 3 => $this->fullPath, 'origFile' => $this->publicUrl, 'origFile_mtime' => $this->originalFile?->getModificationTime(), ]; } }