Weave 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

Laravel Imgproxy Laravel Package

hosmelq/laravel-imgproxy

Laravel integration for imgproxy that generates signed, on-the-fly image processing URLs. Configure sources, keys, and presets, then build resizing and cropping links directly from your models, Blade views, and storage disks with a clean, fluent API.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit This package is a thin, opinionated Laravel adapter over hosmelq/imgproxy, giving the framework three things: a fluent URL builder (Imgproxy::), filesystem macros on configured disks (imgproxyInfo(), plus extension/encoding arguments), and config-driven signing/encryption. That shape fits a standard Laravel architecture well: image transformation stays out of the app runtime (no GD/Imagick in-process), URLs are generated at render time or persisted for API responses, and configuration lives in config/ with env overrides. The v3.0.0 additions—infoBuilder()/imgproxyInfo() for image-info URLs, plus presets-only mode and option aliases—push it further toward a governed image-delivery layer rather than a convenience wrapper.

Integration feasibility Low-to-moderate effort. There is no prior assessment, so this is a greenfield evaluation: a team can adopt v3.0.0 directly with no v2 migration burden. The main integration work is environmental, not code: a running imgproxy instance, key/salt (or encrypted-source keys and IVs), and a decision on disk-macro mapping. imgproxyInfo() requires imgproxy Pro—verify licensing before any design work assumes it.

Technical risk

  • Transitive breaking changes. v3 requires hosmelq/imgproxy ^2.0, and identical builder calls may now emit different URLs. Any URL-equality test, snapshot test, or golden-fixture will break, and previously published URLs must be treated as untrusted until regenerated.
  • Encrypted-source padding fix. Encrypted URLs generated by earlier versions are now invalid; ciphertext is padded once instead of twice. If encrypted sources are in scope, this is a forced rotation with a hard cutover (old URLs fail signature/decryption at the imgproxy layer).
  • format() semantics. Dropping implicit extension means any caller relying on format('webp') alone produces an extension-less path. This is a silent behavioral regression risk for teams porting v2 code snippets straight from documentation or blog posts.
  • New fail-loud validation. Unknown source_encoding, invalid custom IVs, and invalid encryption keys now throw. This is the right behavior, but it converts previously degraded output into 500s, so config validation must move earlier in the request lifecycle.
  • Pro feature coupling. Image-info URLs create a commercial dependency and a second code path to test.

Key questions

  • Which imgproxy server versions are supported alongside hosmelq/imgproxy ^2.0, and what is our pinned server version?
  • Do we hold an imgproxy Pro license, and is infoBuilder() actually needed for the product?
  • Are generated URLs persisted (DB columns, API payloads, mobile clients) or computed per request?
  • What is our CDN/edge cache invalidation capability, given that signed URLs will change?
  • Are encrypted sources in use, and who owns key/IV rotation?
  • What is the PHP/Laravel support matrix? The release notes don't state it—confirm against composer.json.
  • Do we want presets-only mode on by default as a governance control?

Integration Approach

Stack fit Fits any Laravel app using the filesystem abstraction for media. The disk-macro surface is the low-friction path: existing Storage::disk('images')->url() call sites become ->imgproxyUrl(...)-style calls without restructuring controllers. Option aliases reduce vendor lock-in by letting the team standardize on internal argument names.

Migration path Greenfield: adopt v3.0.0 directly; skip v2 entirely. Brownfield (v2 already in place, or hosmelq/imgproxy v1 pinned elsewhere): pin the underlying library first, then bump this package in the same commit—never separately, since the two version constraints are coupled.

Compatibility

  • Verify PHP and Laravel constraints against the installed framework before scheduling.
  • Confirm imgproxy server support for the new arguments (separator, source chunk size/filename) — older server builds may reject or ignore them.
  • Audit every format() call site and every encrypted-source generation path before upgrading.
  • Treat v3 as a URL-contract change: any consumer holding a URL (email templates, PDFs, third-party webhooks, mobile caches) is a compatibility surface.

Sequencing

  1. Confirm server version, Pro license status, and PHP/Laravel matrix.
  2. Land config changes (separator, trusted signature, presets-only, aliases) with validation and tests before the code upgrade.
  3. Upgrade package + underlying library together in a branch; run the full suite.
  4. Diff generated URLs old-vs-new for a representative sample; classify diffs as expected or defects.
  5. Convert format() to build(extension: ...) (and encoding on macros) across the codebase.
  6. If encrypted sources exist: regenerate all stored URLs, purge caches, and cut over atomically.
  7. Ship behind a flag where URL generation is centralized; monitor imgproxy 4xx/5xx after release.

Operational Impact

Maintenance Small, single-maintainer-style packages carry bus-factor risk; the hard dependency on a second package (hosmelq/imgproxy) doubles the upgrade surface. Budget a recurring review each time either project tags a major. Config-file drift between environments is the most likely source of day-two incidents.

Support Escalation path runs through two upstreams plus the imgproxy vendor (especially for Pro image-info). Internal runbook should cover: signature mismatch, unknown source_encoding, invalid IV/key, and imgproxy server version mismatch.

Scaling Positive: transformation load is entirely offloaded to imgproxy, which scales horizontally and independently. Our side is string-building, so app-side cost is negligible. Watch two things: presets-only mode limits request cardinality (a real CDN-hit-rate win), and image-info URLs add a second, typically uncached, round trip—cache them deliberately or they will become a latency and cost hotspot.

Failure modes

  • Silent URL changes after upgrade → cache misses and 404s at the edge.
  • Invalid IV/key config → thrown exceptions at render time (500s) rather than broken images; better, but blast radius is larger per request.
  • Padded-ciphertext fix → all pre-upgrade encrypted URLs permanently invalid.
  • Pro dependency lapse → imgproxyInfo() fails while everything else keeps working; isolate that call path.
  • Implicit format() removal → extension-less paths served with wrong content type.

Ramp-up Low for a Laravel developer already comfortable with the filesystem API—roughly a day to be productive with the builder and macros. Add half a day for signing/encryption concepts and an hour for the v3 specifics (build(extension:), throwing validation, presets-only). If the team is new to imgproxy itself, budget additional time on the server-side config and Pro feature boundaries.

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.
laravel2580/idehelpers
delatbabel/viewpages
anavel/gettext
muhamadrezaar/highcharts
delatbabel/keylists
frankkessler/salesforce-laravel-oauth2-rest
anavel/foundation
wdmtech/enviricons
eii/laravel-captcha
muka/shape-reader
tdt/json
refinery29/php-cs-fixer-config
hotmeteor/eco-env
mvaliolahi/hydrate
wearede/tbcpay-php
parsnick/steak
thibaud-dauce/mattermost-php
multilinguals/apollo-client
antaresbr/collection
kr0lik/phpstan-rules