Coder Social home page Coder Social logo

booms2p / ngx-image-editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hggeorgiev/ngx-image-editor

0.0 2.0 0.0 1.29 MB

Awesome image editor for Angular 5

Home Page: https://centroida.github.io/ngx-image-editor/

License: MIT License

TypeScript 100.00%

ngx-image-editor's Introduction

ngx-image-editor

Awesome editor for Angular 5 based on Angular Material

npm version Build Status

Live Demo

Getting started

Pre-requisites:

  npm install --save @angular/material
   npm install --save @angular/flex-layout
Step 1: Install cropperjs
    npm install --save cropperjs
Step 2: Add cropperjs file paths in your .angular-cli.json
        {
            "styles": [
              "../node_modules/cropperjs/dist/cropper.css"
            ],
            "scripts": [
              "../node_modules/cropperjs/dist/cropper.js"
            ]
        }

Properties

@Input() config: EditorOptions

@Output() close: EventEmitter

@Output() file: EventEmitter

Usage:

Step 1: Install ngx-image-editor:
     npm install --save ngx-image-editor
Step 2: Import the NgxImageEditorModule within your app:
      import {NgxImageEditorModule} from "ngx-image-editor";

      @NgModule({
        imports: [
          NgxImageEditorModule
        ]
      })

EditorOptions:

  • ImageName: String (required)
  • ImageUrl: String (optional)
  • ImageType: String (optional)
    • Default type is image/jpeg
  • File: File (optional)
  • AspectRatios: RatioType[] (optional)
    • '6:9' | '4:3' | '1:1' | '2:3' | 'Default'

Notes:

  • In the EditorOptions can pass either ImageUrl or File.

Example

<!--Html-->
<ngx-image-editor 
      [config]="config" 
      (close)="close($event)" 
      (file)="getEditedFile($event)">
</ngx-image-editor>
// Component
public config: EditorOptions = {
     ImageName: 'Some image',
     AspectRatios: ["4:3", "16:9"],
     ImageUrl: 'https://static.pexels.com/photos/248797/pexels-photo-248797.jpeg',
     ImageType: 'image/jpeg'
}

public close() {
    
}

public getEditedFile(file: File) {
    
}

TODO

  • Make close button optional.
  • Add support for fullscreen and make width of image placehoder to be auto.

ngx-image-editor's People

Contributors

hggeorgiev avatar

Watchers

James Cloos avatar acha.waramun 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.