Skip to content

Commit

Permalink
removed cropping
Browse files Browse the repository at this point in the history
  • Loading branch information
bergben committed Dec 16, 2016
1 parent 0f63799 commit 36b1bdc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng2-img-max",
"version": "0.2.5",
"version": "1.0.0",
"description": "Angular 2 module to resize images down to a certain width and height or to reduce the quality to fit a certain maximal filesize - all in the browser.",
"repository": {
"type": "git",
Expand Down
28 changes: 0 additions & 28 deletions src/img-crop.service.ts

This file was deleted.

15 changes: 1 addition & 14 deletions src/ng2-img-max.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Injectable } from '@angular/core';
import { Subject, Observable } from 'rxjs';
import { ImgCropService } from './img-crop.service';
import { ImgMaxSizeService } from './img-max-size.service';
import { ImgMaxPXSizeService } from './img-maxpx-size.service';

@Injectable()
export class Ng2ImgMaxService {
constructor(private imgMaxSizeService: ImgMaxSizeService, private imgMaxPXSizeService: ImgMaxPXSizeService, private imgCropService: ImgCropService) {
constructor(private imgMaxSizeService: ImgMaxSizeService, private imgMaxPXSizeService: ImgMaxPXSizeService) {
}
public compress(files: File[], maxSizeInMB: number, logExecutionTime: Boolean = false): Observable<any> {
let compressedFileSubject: Subject<any> = new Subject<any>();
Expand All @@ -26,18 +25,6 @@ export class Ng2ImgMaxService {
});
return resizedFileSubject.asObservable();
}
public crop(files: File[], toWidth: number, toHeight: number, startX: number = 0, startY: number = 0): Observable<any> {
let croppedFileSubject: Subject<any> = new Subject<any>();
files.forEach((file) => {
this.cropImage(file, toWidth, toHeight, startX, startY).subscribe((value) => {
croppedFileSubject.next(value);
});
});
return croppedFileSubject.asObservable();
}
public cropImage(file: File, toWidth: number, toHeight: number, startX: number = 0, startY: number = 0): Observable<any> {
return this.imgCropService.cropImage(file, toWidth, toHeight, startX, startY);
}
public compressImage(file: File, maxSizeInMB: number, logExecutionTime: Boolean = false): Observable<any> {
return this.imgMaxSizeService.compressImage(file, maxSizeInMB, logExecutionTime);
}
Expand Down

0 comments on commit 36b1bdc

Please sign in to comment.