rekalogika/file-image
Adds image support to rekalogika/file: image files are identified, validated, and can be resized or converted into derivatives such as thumbnails. Works with the file abstraction, so dimensions, MIME type, and metadata are available wherever files are used in your PHP app.
rekalogika/file + Doctrine attachment ecosystem; outside it, the build cost of reproducing a max-dimension + square-crop filter on top of an established imaging library is a few days of engineering.rekalogika/file monorepo. That matters for procurement: patches and issues belong upstream, so any fork your team maintains is a fork of the monorepo, not this repo. Adopting it means accepting a single-maintainer dependency in a code path users see.Consider it when all of the following hold:
rekalogika/file with Doctrine entities for attachments. This package's entire value is that it plugs into that file abstraction; the resize logic itself is not the differentiator.Look elsewhere when any of the following hold:
srcset, WebP/AVIF negotiation, and Accept-header-driven format selection are table stakes for image performance. This package does not address them.intervention/image, spatie/image, glide, or liip/imagine-bundle cover cropping strategies, filters, and format control with far broader usage. For scale and offload, imgproxy, Cloudinary, or imgix move resizing off your application servers entirely — usually the right answer once image traffic is material.rekalogika/file. Adopting a file-abstraction library and its filter plugin to get resizing inverts the build/buy calculus; a standalone imaging library is the shorter path.For executives (one paragraph): Image resizing is a commodity capability, not a differentiator, so the goal is to spend as little as possible on it while keeping the option to change approach later. This package is a small, MIT-licensed helper that produces resized copies of uploaded images inside an existing PHP file-handling stack. It would let us ship thumbnail and avatar features quickly at effectively zero licensing cost. The caveats are honest ones: it is maintained by a single author, has essentially no adoption, and does not handle modern image formats or caching. My recommendation is to treat it as a tactical utility — use it to unblock near-term work only if we are already on the underlying file library, and put it behind our own image-service interface so that replacing it with a hosted resizing service later is a contained change rather than a rewrite. I would not build a long-term media strategy on it.
For engineering: The API is deliberately narrow — caller supplies a maximum width or height plus a square-crop flag, and gets a filtered result. That intent-based shape is the good part: it keeps sizing policy at the call site and out of stored data. The gaps you will have to fill are the ones that actually cost money: persistence and lifecycle of derived files, cache keys and invalidation when the source or the requested bounds change, and delivery (CDN, srcset, format negotiation). Note the repository is a read-only split of the upstream monorepo, so upstream is where issues and patches go. Recommended integration: define a small ImageTransformer port in our domain, implement it with this package, and keep the option of an imgproxy/Cloudinary adapter behind the same port. That costs an interface and buys us a clean exit.
How can I help you explore Laravel packages today?