awcodes / filament-curator

A media picker plugin for Filament Panels.
MIT License
324 stars 86 forks source link

S3 Uploads: Image source not readable #491

Closed SanthoshSivan-Dev closed 4 months ago

SanthoshSivan-Dev commented 4 months ago

Filament Version

v3.0.39

Plugin Version

v3.0

PHP Version

PHP 8.1.0

Problem description

Attempting to upload media to S3 using the CuratorPicker component throws the following exception.

Intervention \ Image \ Exception \ NotReadableException - Image source not readable

The visibility of this media is set to private however the bucket was also made public just to ensure there are no issues with access. I'm no AWS expert so it's possible I've missed something super obvious, so apologies if that is the case.

In the linked reproduction repo the following steps in order were taken

  1. Created a new Laravel App, installed latest Filament Panels v3 (stable)
  2. Setup an S3 bucket & IAM user
  3. Attach AmazonS3FullAccess permissions to the user, implement basic policy on bucket (see below)
  4. Generated aws keys, added to .env
  5. Added a simple Blog model with title and content
  6. composer require awcodes/filament-curator & php artisan curator:install & npm install -D cropperjs
  7. Generated a filament theme, imported the css mentioned in the documentation and updated tailwind.config.js
  8. Included plugin in AdminPanelProvider
  9. Generated a BlogResource and added CuratorPicker & FileUpload to the schema

Screenshot from 2024-05-27 15-06-12

Expected behavior

Upload should not throw the exception. Expect the newly uploaded image to appear in the "media library" output for selection.

Steps to reproduce

  1. create new project, install dependencies
  2. Login as user, go to Media
  3. Attempt to create a new Media model via the form, observe exception
  4. Navigate to Blogs, edit an existing blog
  5. Upload a file to the S3 Upload input, wait for upload, save
  6. Observe no issues
  7. Add media, attempt to upload images via the right-hand side
  8. Observe exception

Reproduction repository

No response

Relevant log output

No response

markpavia commented 3 weeks ago

I am experiencing this too today, I deployed my project via Laravel Vapor. When uploading using the FileUpload input, there are no issues. But when using the CuratorPicker I receive an error.

Screenshot 2024-09-11 at 11 48 50 PM