Return correct file
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -59,15 +59,13 @@ export class EditImageModalComponent implements OnInit {
|
||||
|
||||
save() {
|
||||
if(this.croppedImage) {
|
||||
if(this.saveImage) {
|
||||
var body = this.croppedImage.substr(23);
|
||||
this.imageService.putImage(this.endpointUrl,this.imageService.b64toBlob(body,"image/jpeg")).subscribe(() => {
|
||||
var blob = this.imageService.dataUrltoBlob(this.croppedImage);
|
||||
if(this.saveImage) {
|
||||
this.imageService.putImage(this.endpointUrl,blob).subscribe(() => {
|
||||
this.changed.emit({});
|
||||
});
|
||||
} else {
|
||||
var selectedImage = (this.imageChangedEvent.target.files && this.imageChangedEvent.target.files[0]) ?
|
||||
this.imageChangedEvent.target.files[0] : null;
|
||||
this.changed.emit({ "croppedImage": this.croppedImage, "selectedImage": selectedImage } );
|
||||
this.changed.emit({ "croppedImage": this.imageService.blobToFile(blob,"croppedimage.jpg")} );
|
||||
}
|
||||
this.modalService.dismissAll("Save");
|
||||
}
|
||||
|
Reference in New Issue
Block a user