B4J Question ABMaterial | Changes and extensions added to jpg images do not appear in the ABMaterial server app

johnerikson

Active Member
Licensed User
Longtime User
I use a B4j app to add extensions (text) to jpg images.
Drawing works satisfactorily in a Bfj desk-top app, but the extensions do not appear in the ABMaterial server app.
The same problem applies if I make additions to the image with the Microsoft app for editing-
The extensions are shown in the B4j app but not in the ABMaterial app.
In previous versions this has worked.
Uses B4XCanvas-lib in B4j for adding text!
Has anyone encountered similar problems, or tips on a variant of technique for adding text to images?
Have the latest B4J-version 10.50, java 19.0.2 and ABMaterial 5,15
 

DonManfred

Expert
Licensed User
Longtime User
I don´t see how anyone could help here if your do not post your code, what is your code in the desktop app? How are you saving the edits?
How do you show the edited image in abmaterial app?

Edut the image, save the result to a new file on disk.
Make sure to copy that image to a folder your abmaterial has access to.
make sure the file is successfully saved and looks ok (including the edits).
on abmaterial your browser should not cache old images. make sure you loaded the rigth one from disc

Hiding your code is the best way not to get help.
 
Last edited:
Upvote 0

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
I am not sure I understand your problem 100%, but I will have a go at it.

Here is what I understand from your description:
You have some images (jpg) that appear fine in your ABM app.
Then you edit these images with an image editing program and you save them (with the same image name) in the appropriate ABM app folder.
However, the ABM app does not show the new version of the images - it keeps showing the old version of the images.

If this is the case, then it is something that happens often and it is caused by image caching. Your ABM app sees that it needs to load an image which it has already loaded in cache (since the name is the same). So, it ends up loading the cached version (which is the previous version of your image).

Clearing the cache is not a viable solution, as you have no control over what each user does at their browser.

My solution: I change the name of the image temporarily (e.g by creating a temporary copy, adding datetime info in the image name) and tell the ABM app to load this new image.
 
Upvote 1

johnerikson

Active Member
Licensed User
Longtime User
EUREKA!
Quite right!
If the image is saved with the same name, the image's data is not read from the source during direct use!
Isn't it an optimization on the high side, but that's how it is!
In and of itself, very easy to fix but not so easy to detect!
Thank you so much for the tips! ☕
 
Upvote 0
Top