Example: Given a path such as home/XYZ.fr/somepath/
From the browser open the image home/XYZ.fr/somepath/somefile.jpg
Save the image using SaveAs.
The folder dialog correctly defaults to home/XYZ.fr/somepath/ with the image name default to somefile.jpg
Name the new image newimage.jpg
XnView does not save the file to home/XYZ.fr/somepath/newimage.jpg
Instead it saves the file to home/XYZ.jpg
You need to parse the path from the end to find the delimiting dot, not from the start

Side effect: The browser loses the active folder during this operation.
Dietmar