TypeError
get_resource_type(): Argument #1 ($resource) must be of type resource, GdImage given TypeError thrown with message "get_resource_type(): Argument #1 ($resource) must be of type resource, GdImage given" Stacktrace: #14 TypeError in C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\vendors\abeautifulsite\SimpleImage.php:57 #13 get_resource_type in C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\vendors\abeautifulsite\SimpleImage.php:57 #12 abeautifulsite\SimpleImage:__destruct in C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\lib\thumb.php:224 #11 Thumb:create in C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\lib\thumb.php:77 #10 Thumb:__construct in C:\wwwroot\reichwein-weimar.de\kirby\kirby\component\thumb.php:104 #9 Kirby\Component\Thumb:create in C:\wwwroot\reichwein-weimar.de\kirby\kirby\traits\image.php:46 #8 FileAbstract:thumb in C:\wwwroot\reichwein-weimar.de\kirby\helpers.php:322 #7 thumb in C:\wwwroot\reichwein-weimar.de\site\templates\referenz01.php:38 #6 require in C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\lib\tpl.php:22 #5 Tpl:load in C:\wwwroot\reichwein-weimar.de\kirby\kirby\component\template.php:103 #4 Kirby\Component\Template:render in C:\wwwroot\reichwein-weimar.de\kirby\kirby.php:671 #3 Kirby:template in C:\wwwroot\reichwein-weimar.de\kirby\kirby.php:659 #2 Kirby:render in C:\wwwroot\reichwein-weimar.de\kirby\kirby\component\response.php:29 #1 Kirby\Component\Response:make in C:\wwwroot\reichwein-weimar.de\kirby\kirby.php:741 #0 Kirby:launch in C:\wwwroot\reichwein-weimar.de\index.php:16
Stack frames (15)
14
TypeError
…\vendor\getkirby\toolkit\vendors\abeautifulsite\SimpleImage.php
57
13
get_resource_type
…\vendor\getkirby\toolkit\vendors\abeautifulsite\SimpleImage.php
57
12
abeautifulsite
\
SimpleImage
__destruct
…\vendor\getkirby\toolkit\lib\thumb.php
224
11
Thumb
create
…\vendor\getkirby\toolkit\lib\thumb.php
77
10
Thumb
__construct
…\kirby\component\thumb.php
104
9
Kirby
\
Component
\
Thumb
create
…\kirby\traits\image.php
46
8
FileAbstract
thumb
…\helpers.php
322
7
thumb
C:\wwwroot\reichwein-weimar.de\site\templates\referenz01.php
38
6
require
…\vendor\getkirby\toolkit\lib\tpl.php
22
5
Tpl
load
…\kirby\component\template.php
103
4
Kirby
\
Component
\
Template
render
…\kirby.php
671
3
Kirby
template
…\kirby.php
659
2
Kirby
render
…\kirby\component\response.php
29
1
Kirby
\
Component
\
Response
make
…\kirby.php
741
0
Kirby
launch
C:\wwwroot\reichwein-weimar.de\index.php
16
C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\vendors\abeautifulsite\SimpleImage.php
     *                                  Where red, green, blue - integers 0-255, alpha - integer 0-127<br>
     *                                  (is used for creating image from scratch)
     *
     * @throws Exception
     *
     */
    public function __construct($filename = null, $width = null, $height = null, $color = null) {
        if ($filename !== null) {
            $this->load($filename);
        } elseif ($width !== null) {
            $this->create($width, $height, $color);
        }
    }

    /**
     * Destroy image resource
     *
     */
    public function __destruct() {
        if( get_resource_type($this->image) === 'gd' ) {
            imagedestroy($this->image);
        }
    }

    /**
     * Adaptive resize
     *
     * This function has been deprecated and will be removed in an upcoming release. Please
     * update your code to use the `thumbnail()` method instead. The arguments for both
     * methods are exactly the same.
     *
     * @param int           $width
     * @param int|null      $height If omitted - assumed equal to $width
     *
     * @return SimpleImage
     *
     */
    public function adaptive_resize($width, $height = null) {

        return $this->thumbnail($width, $height);
C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\vendors\abeautifulsite\SimpleImage.php
     *                                  Where red, green, blue - integers 0-255, alpha - integer 0-127<br>
     *                                  (is used for creating image from scratch)
     *
     * @throws Exception
     *
     */
    public function __construct($filename = null, $width = null, $height = null, $color = null) {
        if ($filename !== null) {
            $this->load($filename);
        } elseif ($width !== null) {
            $this->create($width, $height, $color);
        }
    }

    /**
     * Destroy image resource
     *
     */
    public function __destruct() {
        if( get_resource_type($this->image) === 'gd' ) {
            imagedestroy($this->image);
        }
    }

    /**
     * Adaptive resize
     *
     * This function has been deprecated and will be removed in an upcoming release. Please
     * update your code to use the `thumbnail()` method instead. The arguments for both
     * methods are exactly the same.
     *
     * @param int           $width
     * @param int|null      $height If omitted - assumed equal to $width
     *
     * @return SimpleImage
     *
     */
    public function adaptive_resize($width, $height = null) {

        return $this->thumbnail($width, $height);
C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\lib\thumb.php
    if($this->options['overwrite'] === true) return false;

    // try to use the original if resizing is not necessary
    if($this->options['width']   >= $this->source->width()  &&
       $this->options['height']  >= $this->source->height() &&
       $this->options['crop']    == false                   &&
       $this->options['blur']    == false                   &&
       $this->options['upscale'] == false) return true;

    return false;

  }

  /**
   * Calls the driver function and
   * creates the thumbnail
   */
  protected function create() {
    return call_user_func_array(static::$drivers[$this->options['driver']], array($this));
  }

  /**
   * Makes all public methods of the result object
   * available to the thumb class
   *
   * @param string $method
   * @param mixed $arguments
   * @return mixed
   */
  public function __call($method, $arguments) {

    if(method_exists($this->result, $method)) {
      return call_user_func_array(array($this->result, $method), $arguments);
    }

  }

  /**
   * Generates and returns the full html tag for the thumbnail
C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\lib\thumb.php
    if($this->isObsolete()) return;

    // don't create the thumbnail if it exists
    if(!$this->isThere()) {

      // try to create the thumb folder if it is not there yet
      dir::make(dirname($this->destination->root));

      // check for a valid image
      if(!$this->source->exists() || $this->source->type() != 'image') {
        throw new Error('The given image is invalid', static::ERROR_INVALID_IMAGE);
      }

      // check for a valid driver
      if(!array_key_exists($this->options['driver'], static::$drivers)) {
        throw new Error('Invalid thumbnail driver', static::ERROR_INVALID_DRIVER);
      }

      // create the thumbnail
      $this->create();

      // check if creating the thumbnail failed
      if(!file_exists($this->destination->root)) return;

    }

    // create the result object
    $this->result = new Media($this->destination->root, $this->destination->url);

  }

  /**
   * Build the destination object
   * 
   * @return Obj
   */
  public function destination() {

    if(is_callable($this->options['destination'])) {
      return call($this->options['destination'], $this);
C:\wwwroot\reichwein-weimar.de\kirby\kirby\component\thumb.php
    }

    // load a thumb preset
    $presets = $this->kirby->option('thumbs.presets');
    if(is_string($params)) {
      if(isset($presets[$params])) {
        $params = $presets[$params];
      } else {
        throw new Error('Invalid thumb preset ' . $params);
      }
    } else if($params === []) {
      // try to load the default preset
      // otherwise use the thumb defaults from the Toolkit
      if(isset($presets['default'])) {
        $params = $presets['default'];
      }
    }

    // generate the thumb
    $thumb = new Generator($file, $params);
    $asset = new Asset($thumb->result);

    // store a reference to the original file
    $asset->original($file);

    return $thumb->exists() ? $asset : $file;

  }

  /**
   * Returns the clean path for a thumbnail
   * 
   * @param Generator $thumb
   * @return string
   */
  protected function path(Generator $thumb) {
    return ltrim($this->dir($thumb) . '/' . $this->filename($thumb), '/');
  }

  /**
C:\wwwroot\reichwein-weimar.de\kirby\kirby\traits\image.php
    if($original === null) {
      return $this->original;      
    } else {
      $this->original = $original;
      return $this;
    }
  }

  /**
   * Creates a thumbnail for the image
   * 
   * @param array $params
   * @return Asset
   */
  public function thumb($params = []) {
    // don't scale thumbs further down
    if($this->original()) {    
      throw new Exception('Thumbnails cannot be modified further');
    } else {
      return $this->kirby->component('thumb')->create($this, $params);
    }
  }

  /**
   * Scales the image if possible
   * 
   * @param int $width
   * @param mixed $height
   * @param mixed $quality
   * @return Asset
   */
  public function resize($width, $height = null, $quality = null) {

    $params = ['width' => $width];

    if($height)  $params['height']  = $height;
    if($quality) $params['quality'] = $quality;

    return $this->thumb($params);

C:\wwwroot\reichwein-weimar.de\kirby\helpers.php
  $page = $uri == '/' ? site() : page($uri);

  if($page) {
    return $page->image($filename);
  } else {
    return null;
  }

}

/**
 * Shortcut to create a new thumb object
 *
 * @param mixed Either a file path or a Media object
 * @param array An array of additional params for the thumb
 * @return object Thumb
 */
function thumb($image, $params = array(), $obj = true) {
  if(is_a($image, 'File') || is_a($image, 'Asset')) {
    return $obj ? $image->thumb($params) : $image->thumb($params)->url();
  } else {
    $class = new Thumb($image, $params);
    return $obj ? $class : $class->url();
  }
}
C:\wwwroot\reichwein-weimar.de\site\templates\referenz01.php
    </div>
    <!-- Bereich Text oben -->
    <div class="row bgr04">
        <div class="seite">
            <div class="large-5 columns disoben04 text">
                <h6>Projekt</h6>
                <?php echo $page->text()->kirbytext() ?>
                <h6>Ausf&uuml;hrung:</h6>
                <?php echo $page->Datum()->kirbytext() ?>
                <h6>Leistung:</h6>
                <?php echo $page->Leistung()->kirbytext() ?>
            </div>   
        </div> 
   </div> 
   <!-- Bereich Bilder -->
   <div class="row bgr04">
        <div class="seite">
            <div class="large-5 middle-5 small-1 columns disoben04 disunten06 "> 
                <?php foreach($page->images()->sortBy('sort', 'asc') as $image): ?>
                    <a href="<?php echo $image->url() ?>" rel="lightbox[1]" > <img class="referenzbild" src="<?php echo thumb($image, array('width' => 300, 'height' => 300, 'crop' => true))->url();?>" alt="<?php echo $page->title()->html() ?>"/> </a>
                <?php endforeach ?>
            </div>
        </div>
   </div>
   
   
  </main>
 
<?php snippet('footer') ?>
C:\wwwroot\reichwein-weimar.de\kirby\vendor\getkirby\toolkit\lib\tpl.php
/**
 * Tpl
 *
 * Super simple template engine
 *
 * @package   Kirby Toolkit
 * @author    Bastian Allgeier <bastian@getkirby.com>
 * @link      http://getkirby.com
 * @copyright Bastian Allgeier
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */
class Tpl extends Silo {

  public static $data = array();

  public static function load($_file, $_data = array(), $_return = true) {
    if(!file_exists($_file)) return false;
    ob_start();
    extract(array_merge(static::$data, (array)$_data));
    require($_file);
    $_content = ob_get_contents();
    ob_end_clean();
    if($_return) return $_content;
    echo $_content;
  }

}
C:\wwwroot\reichwein-weimar.de\kirby\kirby\component\template.php
    if($template instanceof Page) {
      $page = $template;
      $file = $page->templateFile();
      $data = $this->data($page, $data);
    } else {
      $file = $template;
      $data = $this->data(null, $data);
    }

    // check for an existing template
    if(!file_exists($file)) {
      throw new Exception('The template could not be found');
    }

    // merge and register the template data globally
    $tplData = tpl::$data;
    tpl::$data = array_merge(tpl::$data, $data);

    // load the template
    $result = tpl::load($file, null, $return);

    // reset the template data
    tpl::$data = $tplData;

    return $result;

  }

}
 
C:\wwwroot\reichwein-weimar.de\kirby\kirby.php
      }

      return $template;

    }

    // return a fresh template
    return $this->template($page, $data);

  }

  /**
   * Template configuration
   *
   * @param Page $page
   * @param array $data
   * @return string
   */
  public function template(Page $page, $data = array()) {
    return $this->component('template')->render($page, $data);
  }

  public function request() {
    if(!is_null($this->request)) return $this->request;
    return $this->request = new Request($this);
  }

  public function router() {
    return $this->router;
  }

  public function route() {
    return $this->route;
  }

  /**
   * Starts the router, renders the page and returns the response
   *
   * @return mixed
   */
C:\wwwroot\reichwein-weimar.de\kirby\kirby.php
        }

      }

      // try to fetch the template from cache
      $template = $this->cache()->get($cacheId);

      // fetch fresh content if the cache is empty
      if(empty($template)) {
        $template = $this->template($page, $data);
        // store the result for the next round
        $this->cache()->set($cacheId, $template);
      }

      return $template;

    }

    // return a fresh template
    return $this->template($page, $data);

  }

  /**
   * Template configuration
   *
   * @param Page $page
   * @param array $data
   * @return string
   */
  public function template(Page $page, $data = array()) {
    return $this->component('template')->render($page, $data);
  }

  public function request() {
    if(!is_null($this->request)) return $this->request;
    return $this->request = new Request($this);
  }

  public function router() {
C:\wwwroot\reichwein-weimar.de\kirby\kirby\component\response.php
 * @link      http://getkirby.com
 * @copyright Bastian Allgeier
 * @license   http://getkirby.com/license
 */
class Response extends \Kirby\Component {

  /**
   * Builds and return the response by various input
   * 
   * @param mixed $response
   * @return mixed
   */
  public function make($response) {

    if(is_string($response)) {
      return $this->kirby->render(page($response));
    } else if(is_array($response)) {
      return $this->kirby->render(page($response[0]), $response[1]);
    } else if(is_a($response, 'Page')) {
      return $this->kirby->render($response);      
    } else if(is_a($response, 'Response')) {
      return $response;
    } else {
      return null;
    }

  }

}
C:\wwwroot\reichwein-weimar.de\kirby\kirby.php
    // check for a valid route
    if(is_null($this->route)) {
      header::status('500');
      header::type('json');
      die(json_encode(array(
        'status'  => 'error',
        'message' => 'Invalid route or request method'
      )));
    }

    // call the router action with all arguments from the pattern
    $response = call($this->route->action(), $this->route->arguments());

    // load all language variables
    // this can only be loaded once the router action has been called
    // otherwise the current language is not yet available
    $this->localize();

    // build the response
    $this->response = $this->component('response')->make($response);

    // store the current language in the session
    if(
        $this->option('language.detect') &&
        $this->site()->multilang() &&
        $this->site()->language()
      ) {
      s::set('kirby_language', $this->site()->language()->code());
    }

    return $this->response;

  }

  /**
   * Register a new hook
   *
   * @param string/array $hook The name of the hook
   * @param closure $callback
   */
C:\wwwroot\reichwein-weimar.de\index.php
<?php

define('DS', DIRECTORY_SEPARATOR);

// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');

// check for a custom site.php
if(file_exists(__DIR__ . DS . 'site.php')) {
  require(__DIR__ . DS . 'site.php');
} else {
  $kirby = kirby();
}

// render
echo $kirby->launch();

Environment & details:

Key Value
Kirby Toolkit v2.5.8
Kirby CMS v2.5.8
empty
empty
empty
empty
empty
Key Value
_FCGI_X_PIPE_ \\.\pipe\IISFCGI-f60a8e9a-ab7a-417a-90f2-b865d0d34f4b
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Windows\system32\config\systemprofile\AppData\Roaming
APP_POOL_CONFIG C:\inetpub\temp\apppools\kunden\kunden.config
APP_POOL_ID kunden
CommonProgramFiles C:\Program Files\Common Files
CommonProgramFiles(x86) C:\Program Files (x86)\Common Files
CommonProgramW6432 C:\Program Files\Common Files
COMPUTERNAME WEBRZ02
ComSpec C:\Windows\system32\cmd.exe
LOCALAPPDATA C:\Windows\system32\config\systemprofile\AppData\Local
NUMBER_OF_PROCESSORS 12
OS Windows_NT
Path C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Users\JNAdmin\AppData\Local\Microsoft\WindowsApps;C:\Users\JNAdmin\AppData\Local\Microsoft\WindowsApps;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE AMD64
PROCESSOR_IDENTIFIER Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 3f02
ProgramData C:\ProgramData
ProgramFiles C:\Program Files
ProgramFiles(x86) C:\Program Files (x86)
ProgramW6432 C:\Program Files
PSModulePath C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC C:\Users\Public
SystemDrive C:
SystemRoot C:\Windows
TEMP C:\Windows\TEMP
TMP C:\Windows\TEMP
USERDOMAIN WORKGROUP
USERNAME WEBRZ02$
USERPROFILE C:\Windows\system32\config\systemprofile
windir C:\Windows
ORIG_PATH_INFO /index.php
URL /index.php
SERVER_SOFTWARE Microsoft-IIS/10.0
SERVER_PROTOCOL HTTP/1.1
SERVER_PORT_SECURE 1
SERVER_PORT 443
SERVER_NAME reichwein-weimar.de
SCRIPT_NAME /index.php
SCRIPT_FILENAME C:\wwwroot\reichwein-weimar.de\index.php
REQUEST_URI /Verkehrsbauwerke/L-Fahrversuchsstrecke
REQUEST_METHOD GET
REMOTE_USER
REMOTE_PORT 38010
REMOTE_HOST 54.210.85.205
REMOTE_ADDR 54.210.85.205
QUERY_STRING
PATH_TRANSLATED C:\wwwroot\reichwein-weimar.de\index.php
LOGON_USER
LOCAL_ADDR 87.118.75.45
INSTANCE_META_PATH /LM/W3SVC/36
INSTANCE_NAME REICHWEIN-WEIMAR.DE
INSTANCE_ID 36
HTTPS_SERVER_SUBJECT CN=reichwein-weimar.de
HTTPS_SERVER_ISSUER C=US, O=Let's Encrypt, CN=R3
HTTPS_SECRETKEYSIZE 2048
HTTPS_KEYSIZE 256
HTTPS on
GATEWAY_INTERFACE CGI/1.1
DOCUMENT_ROOT C:\wwwroot\reichwein-weimar.de
CONTENT_TYPE
CONTENT_LENGTH 0
CERT_SUBJECT
CERT_SERIALNUMBER
CERT_ISSUER
CERT_FLAGS
CERT_COOKIE
AUTH_USER
AUTH_PASSWORD
AUTH_TYPE
APPL_PHYSICAL_PATH C:\wwwroot\reichwein-weimar.de\
APPL_MD_PATH /LM/W3SVC/36/ROOT
IIS_UrlRewriteModule 7,1,1993,2351
UNENCODED_URL /Verkehrsbauwerke/L-Fahrversuchsstrecke
IIS_WasUrlRewritten 1
HTTP_X_ORIGINAL_URL /Verkehrsbauwerke/L-Fahrversuchsstrecke
HTTP_USER_AGENT claudebot
HTTP_HOST reichwein-weimar.de
HTTP_ACCEPT */*
HTTP_CONTENT_LENGTH 0
HTTP_CONNECTION close
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711720501.9515
REQUEST_TIME 1711720501
empty
0. Whoops\Handler\PrettyPageHandler