Giter Site home page Giter Site logo

tduong992 / image_widget_crop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drupal-media/image_widget_crop

0.0 1.0 0.0 244 KB

Image widget crop module - https://www.drupal.org/sandbox/woprrr/2571403

CSS 0.30% JavaScript 11.87% PHP 87.83%

image_widget_crop's Introduction

ImageWidgetCrop module

Provides an interface for using the features of the Crop API. Module is still under heavy development.

Try me

You can Test ImageWidgetCrop in action directly with the sub-module, "ImageWidgetCrop example" to test different usecases of this module.

Installation

  1. Download and extract the module to your sites/all/modules/contrib folder.
  2. Enable the module on the Drupal Modules page (admin/modules) or using $ drush en

The module is currently using Cropper as a library to display the cropping widget. To properly configure it, do the following:

  • Local library:

    1. Download the latest version of Cropper at https://github.com/fengyuanchen/cropper.
    2. Copy the dist folder into:
      • /libraries/cropper or
      • /sites/default/libraries/cropper or
      • /sites/EXAMPLE/libraries/cropper or
      • /sites/all/libraries/cropper
    3. Enable the libraries module.
  • External library:

    1. Set the external URL for the minified version of the library and CSS file in Image Crop Widget settings (/admin/config/media/crop-widget), found at https://cdnjs.com/libraries/cropper.

NOTE: The external library is set by default when you enable the module.

Configuration

  • Create a Crop Type (admin/structure/crop)
  • Create ImageStyles
    • add Manual crop effect, using your Crop Type, (to apply your crop selection).
  • Create an Image field.
  • In its form display, at admin/structure/types/manage/page/form-display:
    • set the widget for your field to ImageWidgetCrop
    • at select your crop types in the Crop settings list. You can configure the widget to create different crops on each crop types. For example, if you have an editorial site, you need to display an image on different places. With this option, you can set an optimal crop zone for each of the image styles applied to the image
  • Set the display formatter Image and choose your image style, or responsive image styles.
  • Go add an image with your widget and crop your picture, by crop types used for this image.

image_widget_crop's People

Contributors

slashrsm avatar mbovan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.