All Projects β†’ ctessier β†’ Nova Advanced Image Field

ctessier / Nova Advanced Image Field

Licence: mit
πŸŒ„πŸ“ A Laravel Nova advanced image field with cropping and resizing using Cropper.js and Intervention Image

Projects that are alternatives of or similar to Nova Advanced Image Field

Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+1980.6%)
Mutual labels:  image, crop, resize
Docker Nginx Image Proxy
on the fly image cropping with gravity, resize and compression microservice
Stars: ✭ 79 (+17.91%)
Mutual labels:  image, crop, resize
Imaging
Imaging is a simple image processing package for Go
Stars: ✭ 4,023 (+5904.48%)
Mutual labels:  image, crop, resize
Lipo
πŸ‘„ Free image manipulation API service built on top of Sharp (an alternative to Jimp, Graphics Magic, Image Magick, and PhantomJS)
Stars: ✭ 101 (+50.75%)
Mutual labels:  image, crop, resize
Mergi
go library for image programming (merge, crop, resize, watermark, animate, ease, transit)
Stars: ✭ 127 (+89.55%)
Mutual labels:  image, crop, resize
Gimage
A PHP library for easy image handling. πŸ–Ό
Stars: ✭ 148 (+120.9%)
Mutual labels:  image, crop, resize
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+31438.81%)
Mutual labels:  image, crop, resize
Flutter image cropper
A Flutter plugin for Android and iOS supports cropping images
Stars: ✭ 723 (+979.1%)
Mutual labels:  image, crop
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+1037.31%)
Mutual labels:  image, crop
Laravel Image Optimizer
Optimize images in your Laravel app
Stars: ✭ 873 (+1202.99%)
Mutual labels:  laravel, image
Php Image Resize
PHP library to resize, scale and crop images. Cloud solution available at:
Stars: ✭ 955 (+1325.37%)
Mutual labels:  crop, resize
Laravel Imageup
Auto Image & file upload, resize and crop for Laravel eloquent model using Intervention image
Stars: ✭ 646 (+864.18%)
Mutual labels:  laravel, image
Imagemagick
πŸ§™β€β™‚οΈ ImageMagick 7
Stars: ✭ 6,400 (+9452.24%)
Mutual labels:  image, resize
Cdpimagecrop
CDPImageCrop can zoom,move and crop a image and automatically save into the album,details see demo.
Stars: ✭ 6 (-91.04%)
Mutual labels:  image, crop
React Native Image Crop Picker
iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
Stars: ✭ 5,261 (+7752.24%)
Mutual labels:  image, crop
Smartcircle
βœ‚οΈAutomatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-56.72%)
Mutual labels:  image, crop
Fmphotopicker
A modern, simple and zero-dependency photo picker with an elegant and customizable image editor
Stars: ✭ 428 (+538.81%)
Mutual labels:  image, crop
Instagrid Js
A Javascript library to do exactly what Instagram Layout application does
Stars: ✭ 13 (-80.6%)
Mutual labels:  image, crop
Nova Laravel Update Card
Check if you're running the latest Laravel version right from your Nova dashboard.
Stars: ✭ 34 (-49.25%)
Mutual labels:  laravel, nova
Nova Time Field
Laravel Nova Time Field
Stars: ✭ 45 (-32.84%)
Mutual labels:  laravel, nova

Nova Advanced Image Field

StyleCI Latest Version on Packagist Total Downloads License

This package provides an advanced image field for Nova resources allowing you to upload, crop and resize any image.

It uses Cropper.js with vue-cropperjs in the frontend and Intervention Image in the backend.

screenshot of the advanced image field

Requirements

To work correctly, this package requires the following components:

  • Laravel & Nova (2 or 3)
  • Fileinfo Extension

And one of the following libraries:

  • GD Library >=2.0 (used by default)
  • Imagick PHP extension >=6.5.7

See Intervention requirements for more details.

Installation

Install the package into a Laravel application with Nova using Composer:

composer require ctessier/nova-advanced-image-field

If you want to use Imagick as the default image processing library, follow the Intervention documentation for Laravel. This will provide you with a new configuration file where you can specify the driver you want.

Usage

AdvancedImage extends from Image so you can use any methods that Image implements. See the documentation here.

<?php

namespace App\Nova;

// ...
use Illuminate\Http\Request;
use Ctessier\NovaAdvancedImageField\AdvancedImage;

class Post extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            // Simple image upload
            AdvancedImage::make('Photo'),

            // Show a cropbox with a free ratio
            AdvancedImage::make('Photo')->croppable(),

            // Show a cropbox with a fixed ratio
            AdvancedImage::make('Photo')->croppable(16/9),

            // Resize the image to a max width
            AdvancedImage::make('Photo')->resize(1920),

            // Resize the image to a max height
            AdvancedImage::make('Photo')->resize(null, 1080),

            // Show a cropbox and resize the image
            AdvancedImage::make('Photo')->croppable()->resize(400, 300),

            // Override the image processing driver for this field only
            AdvancedImage::make('Photo')->driver('imagick')->croppable(),

            // Store to AWS S3
            AdvancedImage::make('Photo')->disk('s3'),

            // Specify a custom subdirectory
            AdvancedImage::make('Photo')->croppable()->disk('s3')->path('image'),

            // Store custom attributes
            AdvancedImage::make('Photo')->croppable()->store(function (Request $request, $model) {
                return [
                    'photo' => $request->photo->store('/', 's3'),
                    'photo_mime' => $request->photo->getMimeType(),
                    'photo_name' => $request->photo->getClientOriginalName(),
                ];
            }),
        ];
    }
}

The resize option uses Intervention Image resize() with the upsize and aspect ratio constraints.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].