capacitor-community / photoviewer

PhotoViewer table images with fullscreen and sharing capabilities
MIT License
49 stars 12 forks source link

Where are the pictures? #21

Closed Th-Barth closed 1 year ago

Th-Barth commented 1 year ago

Hi,

I created a blank app to follow the instructions for this Photoviewer to see if it works in the browser. But I dont get to see the images. I only get the console-output "echo Hello from PhotoViewer" and the appropriate toast message. I added a few other outputs to see where the code stops. The last output I get is "here 1". I dont get to see the output "after show ret...", "here 2" or "here 5". When "here 2" is missing then there should be a catch, but no output "here 5" from the catch block.

So what is happening with the call "const result = await show(this.imageList, this.mode, this.startFrom, this.options);"?

Any chance to fix this?

code from your example:

const echo = await PhotoViewer.echo({value:'Hello from PhotoViewer'}); console.log(echo ${echo.value}`);

if(!echo.value) { await showToast('no value to echo'); } else { await showToast(echo ${echo.value}); }

try {

 this.mode = "one";
 this.startFrom = 2;
 //
 this.options.maxzoomscale = 3;
 this.options.compressionquality = 0.6;
 this.options.movieoptions = {mode: 'portrait', imagetime: 3};
 // **************************************
 // here you defined url or Base64 images
 // **************************************
 // comment or uncomment as you wish
 // http images call

 console.log("here 1");
 const result = await show(this.imageList, this.mode, this.startFrom, this.options);
 console.log(`after show ret: ${JSON.stringify(result)}`);
 console.log("here 2");

 // base64 images call
 //const ret = await show(base64List, options);

 if(!result.result) {
   console.log("here 3");
   await showToast(JSON.stringify(result));
 }

 if(result.result && Object.keys(result).includes('message')) {
  console.log("here 4");
     await showToast(JSON.stringify(result));
 }

} catch (err) { console.log("here 5"); console.log("in catch before toast err: ", err); await showToast(err);

 if(this.platform === 'web' || this.platform === 'electron') {
   window.location.reload();
 }

}

}`

My System Angular CLI: 14.2.1 Node: 16.17.0 Package Manager: npm 8.18.0 OS: win32 x64

Angular: 14.2.0 ... common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router

Package Version

@angular-devkit/architect 0.1402.1 @angular-devkit/build-angular 14.2.1 @angular-devkit/core 14.2.1 @angular-devkit/schematics 14.2.1 @angular/cli 14.2.1 @schematics/angular 14.2.1 rxjs 7.5.6 typescript 4.8.2

jepiqueau commented 1 year ago

@Th-Barth Thanks for using the plugin. you should be looking at angular-photoviewer-app) to see how it works

jepiqueau commented 1 year ago

@Th-Barth any progress on this or i will close the issue