Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
TypeBmp.php
01 <?php
02
03 /**
04 * fast-image-size image type bmp
05 * @package fast-image-size
06 * @copyright (c) Marc Alexander <admin@m-a-styles.de>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace FastImageSize\Type;
13
14 class TypeBmp extends TypeBase
15 {
16 /** @var int BMP header size needed for retrieving dimensions */
17 const BMP_HEADER_SIZE = 26;
18
19 /** @var string BMP signature */
20 const BMP_SIGNATURE = "\x42\x4D";
21
22 /** qvar int BMP dimensions offset */
23 const BMP_DIMENSIONS_OFFSET = 18;
24
25 /**
26 * {@inheritdoc}
27 */
28 public function getSize($filename)
29 {
30 $data = $this->fastImageSize->getImage($filename, 0, self::BMP_HEADER_SIZE);
31
32 // Check if supplied file is a BMP file
33 if (substr($data, 0, 2) !== self::BMP_SIGNATURE)
34 {
35 return;
36 }
37
38 $size = unpack('lwidth/lheight', substr($data, self::BMP_DIMENSIONS_OFFSET, 2 * self::LONG_SIZE));
39
40 $this->fastImageSize->setSize($size);
41 $this->fastImageSize->setImageType(IMAGETYPE_BMP);
42 }
43 }
44