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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

TypeGif.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.14 KiB


01  <?php
02   
03  /**
04   * fast-image-size image type gif
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 TypeGif extends TypeBase
15  {
16      /** @var string GIF87a header */
17      const GIF87A_HEADER = "\x47\x49\x46\x38\x37\x61";
18   
19      /** @var string GIF89a header */
20      const GIF89A_HEADER = "\x47\x49\x46\x38\x39\x61";
21   
22      /** @var int GIF header size */
23      const GIF_HEADER_SIZE = 6;
24   
25      /**
26       * {@inheritdoc}
27       */
28      public function getSize($filename)
29      {
30          // Get data needed for reading image dimensions as outlined by GIF87a
31          // and GIF89a specifications
32          $data = $this->fastImageSize->getImage($filename, 0, self::GIF_HEADER_SIZE + self::SHORT_SIZE * 2);
33   
34          $type = substr($data, 0, self::GIF_HEADER_SIZE);
35          if ($type !== self::GIF87A_HEADER && $type !== self::GIF89A_HEADER)
36          {
37              return;
38          }
39   
40          $size = unpack('vwidth/vheight', substr($data, self::GIF_HEADER_SIZE, self::SHORT_SIZE * 2));
41   
42          $this->fastImageSize->setSize($size);
43          $this->fastImageSize->setImageType(IMAGETYPE_GIF);
44      }
45  }
46