peterpeterparker / web-photo-filter

A Web Component to apply Instagram-like WebGL filters to photos
https://webphotofilter.com
MIT License
117 stars 22 forks source link

when i use web-kit-filter where can i found the filtered image #1

Closed pradeepaanumalla closed 6 years ago

pradeepaanumalla commented 6 years ago

I am using ionic3 and i followed the process that u described,but where can i found the filtered image.As i want to display the filtered image My ts will look like this import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { Camera, CameraOptions } from '@ionic-native/camera'; import { ImagePicker } from '@ionic-native/image-picker'; import { Crop } from '@ionic-native/crop'; import 'web-photo-filter';

/**

@IonicPage() @Component({ selector: 'page-edit', templateUrl: 'edit.html', }) export class EditPage { newPhoto:any; photonew:any; filter:string='null'; constructor(public navCtrl: NavController, public navParams: NavParams, private camera:Camera, private imagePicker:ImagePicker, private crop: Crop) { }

ionViewDidLoad() { console.log('ionViewDidLoad EditPage'); }

pickPhoto(){ const options: CameraOptions = { quality: 70, destinationType: this.camera.DestinationType.DATA_URL, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, saveToPhotoAlbum:true, allowEdit:true } this.imagePicker.getPictures(options).then((results) => { for (var i = 0; i < results.length; i++) { console.log('Image URI: ' + results[i]); } this.newPhoto=results[0]; }, (err) => { }); }

cropPhoto(pic){ this.crop.crop(pic, {quality: 75}) .then( newImage => { console.log('new image path is: ' + newImage); this.photonew=newImage; }, error => console.error('Error cropping image', error) ); } effectOne(){ console.log(this.newPhoto); console.log("one"); this.filter="sepia";
}effectTwo(){ console.log(this.newPhoto); console.log("two"); this.filter="blue_monotone";
}effectThree(){ console.log(this.newPhoto); console.log("three"); this.filter="violen_tomato";
} }

My html file is

capture

If u respond as soon as possible it will be helpful,thanks

peterpeterparker commented 6 years ago

could you plz edit your issue, format your code (four spaces begin of each lines), add the missing html code and the images you uploaded aren't displayed

pradeepaanumalla commented 6 years ago

yeah, added it,please check

peterpeterparker commented 6 years ago

you still didn't format your code...

anyway

<web-photo-filter src="{{newPhoto}}" filter="{{filter}}"></web-photo-filter>

would be correct. you could also encapsulate it in a div till newPhoto would be defined, for example

<div *ngIf="newPhoto != null">
      <web-photo-filter src="{{newPhoto}}" filter="{{filter}}"></web-photo-filter>
</div>

check in your Google Chrome debugger for example that the component is correctly rendered in the DOM

also correct the default value of your filter, not 'null' but null

 filter: string = null;

I close this issue since it isn't an issue but a support question. Feel free to open a question and Stackoverflow or the Ionic Forum and to link it here

pradeepaanumalla commented 6 years ago

Where can I find this filtered image,like for this new photo Iam applying the filter.so,it will store somewhere else or what ?

On 15-Apr-2018 11:59 PM, "David Dal Busco" notifications@github.com wrote:

Closed #1 https://github.com/peterpeterparker/web-photo-filter/issues/1.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/peterpeterparker/web-photo-filter/issues/1#event-1575054381, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj9T1zn28lih2Dq0Mc2MoPJFPLZCWaqgks5to5GAgaJpZM4TVlOb .

peterpeterparker commented 6 years ago

have a look to the DOM and you will understand.

you provide an image/photo to the component, the component create a canvas where the style will be applied

pradeepaanumalla commented 6 years ago

If I given the filter value as null and as well as in some functions I defined 'sepia' but that sepia filter is also not working

On 15-Apr-2018 11:59 PM, "David Dal Busco" notifications@github.com wrote:

you still didn't format your code...

anyway

would be correct. you could also encapsulate it in a div till newPhoto would be defined, for example

check in your Google Chrome debugger for example that the component is correctly rendered in the DOM

also correct the default value of your filter, not 'null' but null

filter: string = null;

I close this issue since it isn't an issue but a support question. Feel free to open a question and Stackoverflow or the Ionic Forum and to link it here

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/peterpeterparker/web-photo-filter/issues/1#issuecomment-381427447, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj9T1zn28lih2Dq0Mc2MoPJFPLZCWaqgks5to5GAgaJpZM4TVlOb .

pradeepaanumalla commented 6 years ago

Ok, I will try

On 16-Apr-2018 12:03 AM, "David Dal Busco" notifications@github.com wrote:

have a look to the DOM and you will understand.

you provide an image/photo to the component, the component create a canvas where the style will be applied

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/peterpeterparker/web-photo-filter/issues/1#issuecomment-381427760, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj9T12HMgmyaq_ovVoC1TXI_xha27N5Jks5to5KNgaJpZM4TVlOb .