]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/ImageStorageDisk.php
Lexical: Updated tests for node changes
[bookstack] / app / Uploads / ImageStorageDisk.php
index 798b72abdbf9d9e0384b66c2508dccf89cf39530..8df702e0d94183b23248a441935e6723d199c4d1 100644 (file)
@@ -55,6 +55,15 @@ class ImageStorageDisk
         return $this->filesystem->get($this->adjustPathForDisk($path));
     }
 
+    /**
+     * Get a stream to the file at the given path.
+     * @returns ?resource
+     */
+    public function stream(string $path): mixed
+    {
+        return $this->filesystem->readStream($this->adjustPathForDisk($path));
+    }
+
     /**
      * Save the given image data at the given path. Can choose to set
      * the image as public which will update its visibility after saving.