Ren'Py Android version errors on some devices

lawfullame

Active Member
Game Developer
Aug 6, 2019
669
986
Hi, I am using the tools integrated in the Ren'Py SDK to create an Android version of my visual novel.


On my old tablet, the Android version works fine and I can play it to the end .
I can install my visual novel on my newer phone, I can play it, but at some point Ren'Py reports an error and I can't continue.
That error occurs on the line where I load a scene.
That scene is just an ordinary JPG image. That scene works fine on my older device and PC version.
Any tricks to avoid these problems?
 

scrumbles

Well-Known Member
Jan 12, 2019
1,069
1,096
Are you sure it is a JPG? Despite the file extension, the image type could be different.
Anyway, I think you could just convert it into a WebP, assuming the file type is the problem.
 

lawfullame

Active Member
Game Developer
Aug 6, 2019
669
986
Are you sure it is a JPG? Despite the file extension, the image type could be different.
Anyway, I think you could just convert it into a WebP, assuming the file type is the problem.

I'll try to investigate. All images in my VN are JPG or PNG directly from DAZ, or JPG exports from GIMP if I do spot renders and edit images.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
In order to help it would be good to know exactly what error you have, uploading a screenshot or better, attaching the error log :p
 

lawfullame

Active Member
Game Developer
Aug 6, 2019
669
986
In order to help it would be good to know exactly what error you have, uploading a screenshot or better, attaching the error log :p
You don't have permission to view the spoiler content. Log in or register now.



It's weird, on my old Huawei Mediapad M2 with Android 5.1 it works. And these bugs appear on the Galaxy s10e with Android 10.
 

lawfullame

Active Member
Game Developer
Aug 6, 2019
669
986
So, I opened the image mentioned in the error log in Mspaint and saved it again. I created a new Android build.
The image will now load and the same error will occur later when loading another image.
Is it possible that the GIMP export creates some corrupt JPG files?

Other image editors and viewers have no problem with these images, and it works fine on some android devices.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
Since rewriting the JPG file with another program has worked well for you, if you haven't altered anything else (such as the size or name of the file) it would appear to be an error in the JPG file itself.

I don't use GIMP but it would be strange that it saves files badly, and if it came to any of the JPG saving options you would have that same problem with many more files.

I don't know, but maybe to avoid those errors in the future you could switch to WEBP format, it works really well :p
 

scrumbles

Well-Known Member
Jan 12, 2019
1,069
1,096
Maybe Gimp doesn't corrupt the images, but it alters their color profile, their precision (color depth) or some other parameter. And, who knows, some of them become too heavy for some devices.
Just out of curiosity, could you upload two copies of a "broken" image (before and after being edited on Gimp)?

That said, I'd take the PNGs from DAZ and convert them into WebPs. The format supports both the lossy and lossless compression and also the partial transparency.
 

lawfullame

Active Member
Game Developer
Aug 6, 2019
669
986
Maybe Gimp doesn't corrupt the images, but it alters their color profile, their precision (color depth) or some other parameter. And, who knows, some of them become too heavy for some devices.
Just out of curiosity, could you upload two copies of a "broken" image (before and after being edited on Gimp)?

That said, I'd take the PNGs from DAZ and convert them into WebPs. The format supports both the lossy and lossless compression and also the partial transparency.
I don't have a version before editing in GIMP.
When I make images where only the expression on the character's face changes, I save the spot render under the name of the image, open the spot render and the original image in GIMP, replace part of the original with spot render and overwrite the spot render file.


Here's one of the examples of those broken images. But I don't know if f95zone image upload does not change the file.

living_room_bg3_2.jpg
 

lawfullame

Active Member
Game Developer
Aug 6, 2019
669
986
So, it looks like some devices don't like the images I generated in GIMP. When I use XnConvert and convert all the image files in the game folder. (jpg to jpg, 100% quality), it seems to solve the problem.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
That file takes up a lot of space for a JPG, because you've used 100% quality... as you get more and more images in the game that size per image will make your game take up a lot of space.

I recommend you to save your renders in PNG, and do the editing in PNG... when you are sure that will be the final image use a format converter to convert all your PNG to JPG or WEBP (this is free: )
Using 90% quality you won't notice quality loss but the image size will be much smaller (you should be able to reduce the size of that image by half).
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
So, it looks like some devices don't like the images I generated in GIMP. When I use XnConvert and convert all the image files in the game folder. (jpg to jpg, 100% quality), it seems to solve the problem.
As mentioned above, don't use JPG for editing, even if you use 100% quality JPG format is not lossless.
It's true that you would have to rewrite a JPG at 100% quality a lot to notice a loss, but as a rule, JPG is not an editing format, but a publishing format. Have Daz save your files in PNG (a lossless format) and then, when the image is edited and you're happy with it, use a converter.
 
  • Like
Reactions: lawfullame

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,188
Since rewriting the JPG file with another program has worked well for you, if you haven't altered anything else (such as the size or name of the file) it would appear to be an error in the JPG file itself.
What was also said by the traceback :
Exception: Could not load image 'images/chapter1/living_room_bg3_2.jpg': error('JPEG loading error',)
JPEG is a format that had many extension among the time. If the library isn't the same on his tablet and on his phone, then one can understand this version of the format, while the other can't.


So, it looks like some devices don't like the images I generated in GIMP.
The problem isn't exactly this, but that they don't like how you asked GIMP to generate those images.
When you export an image with GIMP, you can change a lot of options (under "Advanced Options"). For an use with Ren'py, only one is really useful, "optimize". So try with keeping only this one. And if one device can't still load the images, then also try without it.