Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Webp Converter

Webp Converter Laravel Package

codebuds/webp-converter

Lightweight PHP 7.4+ WebP converter for Symfony apps. Convert JPEG/PNG/GIF/BMP to WebP from a file path or Symfony File, with options like quality, saveFile, force, output naming/path, and clear exceptions for invalid types or options.

View on GitHub
Deep Wiki
Context7

A service that uses php GD to convert Jpeg, Png, Gif and Bmp into webP

Frequently asked questions about Webp Converter
How do I install this package in a Laravel project?
Run `composer require codebuds/webp-converter` to install the package. No additional Laravel-specific setup is required, though you may need to enable PHP’s GD extension in your `php.ini` file.
Does this package work with Laravel’s Storage facade for file handling?
Yes, you can use Laravel’s Storage facade to pass file paths or uploads. For example, use `$request->file('image')->getRealPath()` with the `createWebpImage()` method to convert uploaded files.
What Laravel versions does this package support?
This package is framework-agnostic but tested with PHP 7.4+. It works seamlessly with Laravel 8+ and Symfony 5+, leveraging Laravel’s filesystem and request handling features.
How can I handle large batches of image conversions efficiently?
For high-throughput environments, dispatch conversions as Laravel queue jobs using `dispatch()` with `WebPConverter::createWebpImage()`. This offloads processing to background workers like Horizon.
What happens if GD is not installed on the server?
The package will throw an exception if GD is missing. Document this requirement in your deployment checklist or provide a fallback (e.g., Imagick or an external API) for environments where GD isn’t available.
Can I customize the output filename or path for converted WebP images?
Yes, use the `filename`, `filenameSuffix`, and `savePath` options in the `createWebpImage()` method. For example, set `'filename' => 'converted_' . $userId` to generate unique filenames.
How do I handle errors like invalid file types or missing dependencies?
Wrap the `createWebpImage()` call in a `try-catch` block. Exceptions include invalid file types, missing GD, or invalid options. Log these errors with context (e.g., file path) for debugging.
Does this package support async processing or Laravel Queues?
While the package itself is synchronous, you can integrate it with Laravel Queues by dispatching conversions as jobs. This prevents blocking requests during high-traffic periods.
What are the supported input formats and quality options?
The package converts JPEG, PNG, GIF, and BMP to WebP. Use the `quality` option (1–100) to control compression. For example, `['quality' => 80]` sets 80% quality.
Are there alternatives to this package for Laravel?
Alternatives include `rosell-dk/webp-convert` (supports more formats) or `intervention/image` (feature-rich but heavier). This package is lightweight (~100 lines) and ideal for GD-based WebP conversions.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity