I was trying to make a simple image composition to generate a gallery for social media, so I could process a lot of pictures automatically with a combination of “add” template and “snapshot”.
So the template is very simple and has no animation, just text “div”, svg images and a png picture of the subject with the background cutted away (just 400x480px).
The client will send the “update” command with the new values and a function is called to make the changes, very simple and straight forward.
The strange thing that I encounter is that quite often doesn’t render everything, sometimes the image and texts are missing, sometimes just the texts are missing, sometimes the image is rendered in half.
function main() {
Rider_FirstName_Field.innerHTML = Input_First_Name;
Rider_LastName_Field.innerHTML = Input_Last_Name;
Rider_Nationality_Field.innerHTML = Input_Nationality;
if (Input_Last_Name.length > 0) {
Rider_Face_Image.src = "../../_Images/Face/" + Input_Last_Name + "_" + Input_First_Name + ".png";;
Rider_Face_Image.style.opacity = 1;
} else {
Rider_Face_Image.src = "";
Rider_Face_Image.style.opacity = 0;
}
if (Input_Nationality.length > 0) {
Rider_Flag_Image.src = "../../_Images/Flag/" + Input_Nationality + ".svg";;
Rider_Flag_Image.style.opacity = 1;
} else {
Rider_Flag_Image.src = "";
Rider_Flag_Image.style.opacity = 0;
}
}
I’m not sure if that is normal or not, or if I’m doing something wrong in how I handle things.
I found a simple solution which is to call the function more than once with a setInterval, it is just for postproduction in this case so I don’t care that much, but I would like to know more about it.
The important I think, is that it is not a flaw or a bug in the server code