Error Reading Image With Image Intervention I tried uploading an image and JPG, jpeg and png work fine but there is this particular jpg that returns the error
Call to undefined function Intervention\Image\Drivers\Gd\Decoders\imagecreatefromavif()
code is
private function resizeImage()
{
//dd($this->image);
return Image::read($this->image->getRealPath())->cover(350, 350);
}
when i dd the image i get this
Livewire\Features\SupportFileUploads\TemporaryUploadedFile {#484 ▼ // app/Livewire/CustomerSelfieUpload.php:150
-originalName: "C6nc2umOsiTCVmqNMJxdK5BFjhERrQ-metaYmU5ZGE4MDQtNjNhMC00ZDVjLThhMDktYWYyOTIwOTEzM2NlLmpwZw==-.jpg"
-mimeType: "application/octet-stream"
-error: 0
-originalPath: "livewire-tmp/C6nc2umOsiTCVmqNMJxdK5BFjhERrQ-metaYmU5ZGE4MDQtNjNhMC00ZDVjLThhMDktYWYyOTIwOTEzM2NlLmpwZw==-.jpg"
-test: false
#hashName: null
#disk: "local"
#storage: Illuminate\Filesystem\LocalFilesystemAdapter {#490 ▶}
#path: "livewire-tmp/C6nc2umOsiTCVmqNMJxdK5BFjhERrQ-metaYmU5ZGE4MDQtNjNhMC00ZDVjLThhMDktYWYyOTIwOTEzM2NlLmpwZw==-.jpg"
path: "/Users/MAC/Herd/wallets/storage/app/livewire-tmp"
filename: "C6nc2umOsiTCVmqNMJxdK5BFjhERrQ-metaYmU5ZGE4MDQtNjNhMC00ZDVjLThhMDktYWYyOTIwOTEzM2NlLmpwZw==-.jpg"
basename: "php4b31co6ot4lgeIrzpHr"
pathname: "/Users/MAC/Herd/wallets/storage/app/livewire-tmp/C6nc2umOsiTCVmqNMJxdK5BFjhERrQ-metaYmU5ZGE4MDQtNjNhMC00ZDVjLThhMDktYWYyOTIwOTEzM2NlLmpwZw==-.jpg"
extension: ""
realPath: "/Users/MAC/Herd/wallets/storage/app/livewire-tmp/C6nc2umOsiTCVmqNMJxdK5BFjhERrQ-metaYmU5ZGE4MDQtNjNhMC00ZDVjLThhMDktYWYyOTIwOTEzM2NlLmpwZw==-.jpg"
aTime: 2025-02-11 17:41:52
mTime: 2025-02-11 17:41:52
cTime: 2025-02-11 17:41:52
inode: 2701847
size: 23390
writable: false
readable: false
executable: false
file: false
dir: false
link: false
}
What could be wrong?
I use Laravel Herd
Went through the link and i installed the libavif using brew cos i run Herd on Mac
brew install libavif
Still the error remains the same.
What is your PHP version?
@tykus 8.4 got same error downgrading to 8.1
@jsanwo64 did you confirm that the GD extension is installed and enabled?
@tykus
running phpinfo here is what i get
./configure' '--prefix=' '--with-valgrind=no' '--enable-shared=no' '--enable-static=yes' '--disable-all' '--disable-cgi' '--disable-phpdbg' '--enable-cli' '--enable-fpm' '--disable-embed' '--disable-micro' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--enable-intl' '--enable-pdo' '--with-sqlite3=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-pdo-sqlite' '--with-curl' '--with-zlib' '--with-openssl=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-openssl-dir=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-tokenizer' '--enable-bcmath' '--with-bz2=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-calendar' '--enable-dba' '--enable-ftp' '--with-iconv=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-mysqlnd' '--with-mysqli' '--enable-mbstring' '--enable-mbregex' '--enable-xml' '--enable-simplexml' '--enable-ctype' '--enable-dom' '--enable-filter' '--enable-session' '--enable-fileinfo' '--with-pdo-mysql' '--enable-posix' '--enable-sockets' '--enable-shmop' '--with-sodium' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-gd' '--with-freetype' '--with-jpeg' '--with-webp' '--with-zip=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-gmp=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-igbinary' '--enable-redis' '--enable-redis-session' '--enable-redis-igbinary' '--enable-redis-zstd' '--enable-redis-lz4' '--with-liblz4=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-xmlwriter' '--enable-phar' '--enable-exif' '--enable-xmlreader' '--with-readline=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-pcntl' '--enable-soap' '--with-libxml=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-imagick=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-ffi' '--enable-zend-signals' '--with-password-argon2=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-pgsql=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-pdo-pgsql=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-imap=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-imap-ssl=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-ldap=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-xsl=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-zstd' '--with-libzstd=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--with-gettext=/Users/runner/work/static-php-builder/static-php-builder/buildroot' '--enable-mongodb' '--with-mongodb-system-libs=no' '--with-mongodb-client-side-encryption=no' '--with-mongodb-sasl=no' '--with-mongodb-ssl=openssl' '--with-mongodb-icu=yes' '--with-mongodb-zstd=yes' '--with-mongodb-zlib=yes' '--enable-opcache' 'PKG_CONFIG=/Users/runner/work/static-php-builder/static-php-builder/buildroot/bin/pkg-config' 'PKG_CONFIG_PATH=/Users/runner/work/static-php-builder/static-php-builder/buildroot/lib/pkgconfig'
which confirm GD is installed and and enabled
@jsanwo64 yes, but the point is that the current version of PHP, while having GD enabled, does not have GD with AVIF support configured . Marcel says it will be configured like that for the next PHP update available through Herd
@tykus Oh! thanks.
Cos i was thinking it came along with the HERD update i did of recent.
Thanks. Will look forward to the next update and verify if it works.
Please sign in or create an account to participate in this conversation.