0

This is such a strange issue so just posting in case anywhere knows where to investigate next as I'm completely stumped.

I have a Cordova Ionic (v6) app that uses ngx-image-cropper npm plugin to crop images.

If I run the app without ionic-deploy, the ngx-image-cropper plugin works perfect. You select an image, the image shows up, you crop it & I upload the cropped image. If I close the app out of the background & open it back up, still works as normal.

If I run the app with ionic-deploy it goes as follows:

  1. App opens up, grabs newest version from code-deploy, applies it and the image cropper works as expected still.
  2. This is where it gets weird: If I close the app out of the background and open it back up, it's still on the same code-deploy version so there's nothing new to download/apply, however when the image-cropper gets the imageChangedEvent, the image doesn't show up on the cropper.

I'm baffled at what is happening, I've checked in Safari Develop console log & there's no error messages.

I put a bunch of console logs throughout and they all seem normal (passing the image around, file input change events, etc.

Does anyone have any idea what to look into next?

EDIT: I noticed on the first launch when it works vs the 2nd launch when it doesn't work the base64 being inserted into the image-cropper is different...

enter image description here

UPDATE: I changed my code to match what this comment showed and now it works.... it's going veryyyyyy slow and acting buggy but it works.. I will look into this more on Monday but for anyone that stumbles across this: https://github.com/danielsogl/awesome-cordova-plugins/issues/505#issuecomment-1110622354

DanielRead
  • 2,288
  • 1
  • 23
  • 34
  • 1
    I presume you've tried the ionic community forums? –  Feb 03 '23 at 19:56
  • 1
    In your updated screenshots, I see "working" is JPG and "not working" is PNG. Are these not expected to be the same resource file? –  Feb 03 '23 at 19:57
  • @E.Maggini I haven't asked on ionic community forums I will post there as well. And I just noticed the same thing.... it's the same image I'm testing with in both instances. How/why would it change from a jpeg to a png just by rebooting the app..... peculiar – DanielRead Feb 03 '23 at 20:00
  • Possible it is something in Ionic cloud build which doesn't happen locally. Possible it is something in your initialization routines. Hard to say without seeing the code. –  Feb 03 '23 at 20:02

0 Answers0