Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Versa Lite - Image works on emulator, not device, works on other devices

ANSWERED

I have spent hours on trying to find the issue I'm having with Versa Lite. Here are as many details as I have:

ISSUE: I have a routine that sets the background image. It works for Ionic, and Vera, but the very same images used for Versa (300x300 png) do not appear on the Versa Lite, but DO work on the Versa Lite simulator.

In the index.gui I define bgImage as an image:

<image id="bgImage" x="0" y="0" />

In the styles.css I turn on pointer events:

#bgImage {
  pointer-events: visible;
}

Early in the code, I create the const object for bgImage:

const bgImage = document.getElementById("bgImage");

I pass the device name ("Ionic", "Versa", or "Versa Lite") and the month (0-11) to the following routine:

function setBgImage(watch, mo)
{
  
  if (watch == "Versa Lite")
  {
    watch = "Versa";
  }

  bgImage.href = "img/" + watch + "_image_" + mo + ".png";
}

Under resources/img/ I have 24 .png files, 12 of them formatted for Ionic (348x250), and 12 of them for Versa/Versa Lite (300x300). For example, for the month of May, there are two files:

 

Ionic_image_4.png

Versa_image_4.png

 

So the IF condition merely tells the code to use the 300x300 formatted images if the watch is a Versa OR a Versa Lite. There is no other point where this variable is used.
I have also tried fully-qualifying the path to the images:

bgImage.href = "/mnt/assets/resources/img/" + watch + "_image_" + mo + ".png";


What's so frustrating is that it works fine in the emulator, and works fine for both Versa and Ionic, but simply doesn't work for the Versa Lite device.
Any thoughts/ideas on this would be very appreciated! Thank you!

EDIT: I have also tried .jpg files. I have also tried isolating the watch variable in this manner:

function setBgImage(watch, mo)
{
  
  let tmpWatch = watch;
  
  if (watch == "Versa Lite")
  {
    tmpWatch = "Versa";
  }

  bgImage.href = "img/" + tmpWatch + "_image_" + mo + ".png";
}
Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Of course, the moment I go through the trouble of typing all that out, I find the fix.

I simply pulled the bgImage.href update line out of the function. It means repeating a bit of code, but it's a small price to make it work.

This was very frustrating because it was working in the emulator, AND on the other devices, but not the Versa Lite device only. Is this worthy of a bug report? IS it a bug at all?

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

Of course, the moment I go through the trouble of typing all that out, I find the fix.

I simply pulled the bgImage.href update line out of the function. It means repeating a bit of code, but it's a small price to make it work.

This was very frustrating because it was working in the emulator, AND on the other devices, but not the Versa Lite device only. Is this worthy of a bug report? IS it a bug at all?

Best Answer
0 Votes

The correct problem was that the Versa Lite returns "Versa L" instead of "Versa Lite" as it does in the simulator. My understanding is that this will be fixed.

Best Answer
0 Votes