ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.Image.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Style\Content;
22
24
29class Image
30{
31 protected string $path;
32 protected string $type;
33 protected DataSize $size;
34 protected int $width;
35 protected int $height;
36
37 public function __construct(
38 string $path,
40 int $width,
41 int $height
42 ) {
43 $this->path = $path;
44 $this->width = $width;
45 $this->height = $height;
46 $this->size = $size;
47 }
48
49 public function getPath(): string
50 {
51 return $this->path;
52 }
53
54 public function getFilename(): string
55 {
56 return basename($this->path);
57 }
58
59 public function getType(): string
60 {
61 return pathinfo($this->path, PATHINFO_EXTENSION);
62 }
63
64 public function getSize(): DataSize
65 {
66 return $this->size;
67 }
68
69 public function getWidth(): int
70 {
71 return $this->width;
72 }
73
74 public function getHeight(): int
75 {
76 return $this->height;
77 }
78}
This class provides the data size with additional information to remove the work to calculate the siz...
Definition: DataSize.php:31
__construct(string $path, DataSize $size, int $width, int $height)
Definition: class.Image.php:37