Jake Vanderwerf
2026-08-30 87237f15618e2320967b9380c360b89f7323d2e9
inc/utility/Image.php
@@ -17,18 +17,14 @@
   public function __construct()
   {
      $this->cache = Cache::for('images')->connect('post');
      $this->imgData = Cache::for('imageData')->connect('post');
      if (JVB_TESTING) {
         $this->cache->flush();
         $this->imgData->flush();
      }
      $this->cache = Cache::for('images', 'post');
      $this->imgData = Cache::for('imageData', 'post');
   }
   public function formatImage(int $ID, string $start = 'tiny', string $replace = 'large', bool $addLink = true, ?string $postSlug = null):string
   {
      $return = $this->cache->remember(
         $this->cache->generateKey(['ID' => $ID, 'start' => $start, 'replace' => $replace]),
         ['ID' => $ID, 'start' => $start, 'replace' => $replace],
         function() use ($ID, $start, $replace) {
            // Define size order for progressive enhancement
            $sizeOrder = ['tiny', 'directory-preview', 'thumbnail', 'medium', 'large', 'full'];
@@ -188,9 +184,7 @@
   public static function SVG(string $slug):string
   {
      $cache = Cache::for('svgs');
      if (JVB_TESTING) {
         $cache->flush();
      }
      return $cache->remember(
         $slug,
         function() use ($slug) {