- What is smottt/wideimage used for in Laravel projects?
- smottt/wideimage is a maintained fork of the WideImage PHP image manipulation library built on GD. It provides a fluent, object-oriented API for resizing, cropping, rotating, flipping, watermarking, and applying filters such as grayscale, brightness, contrast, and blur. Laravel projects use it for thumbnails, watermarks, and dynamic image output, but it is a standalone PHP library rather than a Laravel-native package. Treat it as an infrastructure detail behind an application-owned image service.
- How do I install smottt/wideimage with Composer?
- Install the package with Composer using the smottt/wideimage package name, then confirm that your PHP runtime has the GD extension enabled. There is no first-party Laravel service provider, facade, or configuration file, so you will need to bind a wrapper service or adapter in Laravel's container. Pin the exact package version and verify it on your PHP and Laravel version matrix before adopting it.
- Does smottt/wideimage support Laravel 10 and Laravel 11?
- smottt/wideimage is not Laravel-native, so Laravel 10 and Laravel 11 support must be proven through your own compatibility spike rather than assumed from framework integration. The package has no service provider, facade, config, queue integration, or storage abstraction. Test it against the specific PHP 8.x versions and Laravel releases you need before relying on it in production.
- Is smottt/wideimage a good alternative to Intervention Image for Laravel?
- For greenfield Laravel media pipelines, Intervention Image, Glide, or cloud image transforms usually provide better framework integration and format coverage. smottt/wideimage is best treated as an encapsulated legacy adapter when you already depend on WideImage behavior. Avoid using it as the default choice for new image-processing code.
- How do I resize and crop images with smottt/wideimage?
- WideImage exposes a fluent API where you can chain operations such as resize, crop, and rotate with minimal code. In Laravel, keep those calls inside an application-owned ImageProcessor adapter rather than in controllers, models, jobs, or Blade views. That wrapper lets you validate inputs, handle errors consistently, and later replace the engine without changing call sites.
- Does smottt/wideimage support WebP, AVIF, and EXIF orientation?
- The library supports common formats such as JPEG, PNG, and GIF through GD, and the overview mentions additional formats via GD. WebP, AVIF, and automatic EXIF orientation are not guaranteed and depend on your GD build and package behavior, so verify them with representative images. Test corrupt files, large dimensions, animated images, and metadata-heavy uploads before production.
- How do I add watermarks with smottt/wideimage?
- smottt/wideimage supports text and image overlays with positioning, so you can implement watermarks through its fluent API. Keep watermark calls inside your adapter and validate image dimensions, overlay paths, and positioning values. Add regression tests for different aspect ratios, transparency, and unsupported formats.
- What are the production risks of using smottt/wideimage?
- The package has low ecosystem momentum, a last release in January 2021, incomplete repository metadata, and a NOASSERTION license that requires legal review. Risks include abandonment, unpatched security issues, PHP-version breakage, image-parser or resource-exhaustion vulnerabilities, and unsupported formats. Budget for dependency auditing, security patching, PHP upgrades, and an exit plan to a maintained engine.
- How should I test smottt/wideimage transformations in Laravel?
- Use golden-image regression tests and contract tests around your adapter so behavior is pinned before and after any migration. Cover corrupt files, large dimensions, animated images, metadata-heavy uploads, memory limits, and missing GD extensions. Dual-run WideImage and any replacement in staging and compare outputs before moving call sites.
- How do I run smottt/wideimage safely in Laravel queued jobs?
- Image manipulation is CPU- and memory-bound, so run transformations in queued workers rather than synchronous web requests. Enforce upload-size and dimension limits, cap concurrency, set timeouts, clean temporary files, and cache derivatives in object storage or a CDN. For horizontal scaling, use shared storage and make derivative generation idempotent.