generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
I'm getting a 404 on a fresh installation with Spatie Media library when accessing an image transform URL
I'm sure it's something I've done wrong but I can't quite figure it out
How to reproduce the bug
I have an image stored at /storage/app/public/29/content.png
With the config set to 'public_path' => env('IMAGE_TRANSFORM_PUBLIC_PATH', 'storage'), as the comment suggests, however going to /image-transform/width=250,quality=80,format=webp,blur=50/29/content.png serves a 404
Diving into the package code and dd'ing
dd(public_path($pathPrefix.'/'.$path), $publicPath);
Gives me
"/Users/mason/Sites/library/public/storage/29/content.png"
"/Users/mason/Sites/library/storage/app/public/29/content.png"
But if I change the line
$publicPath = realpath(public_path($pathPrefix.'/'.$path));
into
$publicPath = public_path($pathPrefix.'/'.$path);
I get
"/Users/mason/Sites/library/public/storage/29/content.png"
"/Users/mason/Sites/library/public/storage/29/content.png"
and it works fine
Package Version
0.4.0
PHP Version
8.4.8
Laravel Version
12.19.3
Which operating systems does this happen with?
macOS
Notes
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working