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