‪TYPO3CMS  9.5
Image.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 
25 class ‪Image
26 {
32  protected ‪$url;
33 
37  protected ‪$width;
38 
42  protected ‪$height;
43 
49  public function ‪__construct(‪$url, ‪$width, ‪$height)
50  {
51  $this->url = ‪$url;
52  $this->width = (int)‪$width;
53  $this->height = (int)‪$height;
54  }
55 
62  public function ‪getUrl($relativeToCurrentScript = false)
63  {
65  if ($relativeToCurrentScript && !GeneralUtility::isValidUrl(‪$url)) {
67  }
68  return ‪$url;
69  }
70 
74  public function ‪getWidth()
75  {
76  return ‪$this->width;
77  }
78 
82  public function ‪getHeight()
83  {
84  return ‪$this->height;
85  }
86 }
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:23
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:153
‪TYPO3\CMS\Backend\Backend\Avatar\Image\getHeight
‪int getHeight()
Definition: Image.php:79
‪TYPO3\CMS\Backend\Backend\Avatar\Image\getUrl
‪string getUrl($relativeToCurrentScript=false)
Definition: Image.php:59
‪TYPO3\CMS\Backend\Backend\Avatar\Image\__construct
‪__construct($url, $width, $height)
Definition: Image.php:46
‪TYPO3\CMS\Backend\Backend\Avatar\Image\$url
‪string $url
Definition: Image.php:31
‪TYPO3\CMS\Backend\Backend\Avatar\Image\$width
‪int $width
Definition: Image.php:35
‪TYPO3\CMS\Backend\Backend\Avatar\Image\$height
‪int $height
Definition: Image.php:39
‪TYPO3\CMS\Backend\Backend\Avatar
Definition: Avatar.php:3
‪TYPO3\CMS\Backend\Backend\Avatar\Image\getWidth
‪int getWidth()
Definition: Image.php:71
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Backend\Backend\Avatar\Image
Definition: Image.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath
‪static string getAbsoluteWebPath($targetPath)
Definition: PathUtility.php:42