Download the PHP package vipertecpro/image-cropper without Composer

On this page you can find all versions of the php package vipertecpro/image-cropper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package image-cropper

ImageCropper — a native image cropper & editor for NativePHP Mobile

Packagist Version Total Downloads PHP Version

Open a fully native crop & edit screen from PHP — the user drags, pinch-zooms and two-finger-rotates the image behind a crop frame, then you get a real cropped file back. Written in SwiftUI (iOS) and Jetpack Compose (Android), with one simple PHP API and zero third-party native libraries.

Features

Requirements

Installation

Requiring with Composer is not enough — an unregistered plugin does nothing. Always run native:plugin:register and confirm with native:plugin:list.

Usage

Call the facade from a NativeComponent, then handle the result event.

Display the result with native:image, e.g. a round avatar:

On NativePHP Mobile v3, the #[On] attribute isn't available — listen for the events with #[OnNative(...)] (from Native\Mobile\Attributes\OnNative) instead. Everything else is identical; the plugin itself is unchanged across v3 and v4.

Getting an image to crop

The plugin's input is a file path to an existing image or an http(s) URL — it does not capture or pick photos itself, so it has no hard dependency on any camera plugin. Any source works: the filesystem, a bundled asset, a picker of your choice, or a remote image.

Only croppable image formats are accepted (jpg, jpeg, png, gif, webp, bmp, heic, heif, avif): a source with any other extension throws an InvalidArgumentException immediately, and the native side additionally verifies the actual content decodes as an image (extensions can lie) — undecodable content fires CropCancelled, as do download failures.

If you need a picker, nativephp/mobile-camera is convenient (listed under suggest, not require). Install and register it separately, then hand its result path to ImageCropper::open().

API

The crop experience is configurable so one plugin covers many use cases.

Option Values Default
preset profile (circle), square, portrait, landscape, cover, banner, story —
shape circle | rect (overrides the preset) rect
aspectRatio width / height, e.g. 16/9 (overrides the preset) 1.0
tools any of ['zoom', 'rotate'] — which crop fine-tune rulers show both
modes any of ['crop', 'adjust', 'filter'] — editor modes offered; opens on the first all three
presets preset keys offered in the in-screen selector; [] hides it & locks the crop all
outputSize longest edge of the output, px 1024
theme hex colors to match YOUR app — background, text, accent (Done), highlight (active states); omitted keys keep the system-adaptive default system light/dark
id correlation id echoed back on the event null

When modes omits crop, the editor drops the crop frame entirely, shows the whole image, and exports the full photo (longest edge = outputSize) with the colour baked in.

Events

Event Payload Fired when
Vipertecpro\ImageCropper\Events\ImageCropped string $path, ?string $id The user confirms — $path is the new cropped file.
Vipertecpro\ImageCropper\Events\CropCancelled ?string $id The user cancels, or the source couldn't be read.

Pass an id option when several crops could be in flight, to correlate the event.

Legacy web-view apps

A JS bridge is shipped at resources/js/imageCropper.js. Because the result is async, subscribe to the native events with the #nativephp On() helper — see the file header for an example.

Demo app

A full sample NativePHP app showcases the plugin with five ready-made examples (full studio, locked profile avatar, locked cover, adjust-only, filter-only) — each a tiny NativeComponent you can copy from:

👉 vipertecpro/supernativephp-image-manipulation

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for local setup, the project layout, how it works, and how to extend the crop editor.

Changelog

See CHANGELOG.md for the full version history.

License

MIT — see LICENSE.


All versions of image-cropper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
nativephp/mobile Version ^3.0|^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vipertecpro/image-cropper contains the following files

Loading the files please wait ...