You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the addToMediaFromURL method, I'm receiving a Could Not Load Image error on the server, but not locally (I'm using Laravel Vapor) and not with other image formats.
The code below is where the error is occuring and that code is receiving an absolute file path to the image in s3, which is available.
public function addToMediaLibrary($file_path) { $media = $this->addMediaFromUrl($file_path) ->toMediaCollection("", 's3'); return $media; }
As an example the file path when logged out is https://s3.sitesforsaas.com/tenants/d221c93a-3757-466c-bf83-b74a9ee64c04/sites/9cfc24c7-cb2a-4c5a-8c0f-73ecdc79c166/2024/09/4e9854b0-4f2d-4931-a726-01f557bd7fc6.webp, but the error is looking for the image in local 'tmp' storage for some reason.
Could not load image at path /tmp/storage/tenantd221c93a-3757-466c-bf83-b74a9ee64c04/media-library/temp/j7pNMerUdReNx9MfAG5rKjcmGHWu4i99/LM2UYMTcYU0BO8sLsTfeOBpS9eXximejlarge.webp`",
The text was updated successfully, but these errors were encountered:
I'm not sure you have the same problem as me but I had to alter dockerfile used by Vapor runtime since webp support is not enabled by default. I have changed GD php extension to be compiled with webp support (and jpeg because jpeg somehow was disabled when I had enabled webp).
File: production.Dockerfile in the project root:
FROM laravelphp/vapor:php83
RUN apk --update add libwebp-dev
RUN apk --update add libjpeg-turbo-dev
RUN docker-php-ext-configure gd --with-webp --with-jpeg
RUN docker-php-ext-install gd
COPY . /var/task
When using the addToMediaFromURL method, I'm receiving a Could Not Load Image error on the server, but not locally (I'm using Laravel Vapor) and not with other image formats.
The code below is where the error is occuring and that code is receiving an absolute file path to the image in s3, which is available.
public function addToMediaLibrary($file_path) { $media = $this->addMediaFromUrl($file_path) ->toMediaCollection("", 's3'); return $media; }
As an example the file path when logged out is
https://s3.sitesforsaas.com/tenants/d221c93a-3757-466c-bf83-b74a9ee64c04/sites/9cfc24c7-cb2a-4c5a-8c0f-73ecdc79c166/2024/09/4e9854b0-4f2d-4931-a726-01f557bd7fc6.webp
, but the error is looking for the image in local 'tmp' storage for some reason.Could not load image at path
/tmp/storage/tenantd221c93a-3757-466c-bf83-b74a9ee64c04/media-library/temp/j7pNMerUdReNx9MfAG5rKjcmGHWu4i99/LM2UYMTcYU0BO8sLsTfeOBpS9eXximejlarge.webp`",The text was updated successfully, but these errors were encountered: