MerginMaps / MerginMaps/mobile

Photo naming: Sequence number inserted at wrong position when filename contains multiple dots

Open
#4,135 0 comments 0 reactions 1 assignee View on GitHub

@xkello is already working on this.

Since Sep 15, 2026.

bug
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

Description
When attaching photos where the resulting (expression‑generated) filename already contains multiple dots, the sequence/index suffix (added to avoid duplicates on second/third attachments) is inserted after the first segment instead of just before the file extension. This produces awkward / inconsistent filenames and makes it harder to correlate related images.
Example:
Original (first photo): site.alpha.beta.jpg
Second photo expected: site.alpha.beta (1).jpg
Actual second photo: site (1).alpha.beta.jpg (sequence inserted too early in the name).
Tested in project: tester-ws-1/test_photo-sketches.

Environment
staging

Application (+ app version, build, operating system)

  • Mergin Maps Mobile (Android, iOS)
  • App versions:
    Android: 2025.6.0 (714011)
    iOS: 2025.6.0 (25.10.809611)

Steps to reproduce

  1. Open project tester-ws-1/test_photo-sketches on mobile device.
  2. Add new record in point_photo2_layer.
  3. Add (attach) the photos to the both photo widgets.
  4. Save record.
  5. Inspect generated filename for the second photo locally (e.g., via Local changes list or project folder after sync).

Actual results

  • The sequence/increment (e.g. (1)) is inserted after the first name token (before later dot-separated parts): twoPhotos/point_photo2_layer-rastislav (1).hudak020625-071025_1626.jpg.
  • This breaks the logical grouping of the base name and makes automated parsing harder.

Expected results

  • The sequence suffix should be inserted immediately before the extension, preserving the entire base name (all segments before the final dot).
    • Desired: twoPhotos/point_photo2_layer-rastislav.hudak020625-071025_1626 (1).jpg
  • Behavior should be consistent regardless of how many dots appear in the base portion.
  • If a collision still occurs (very unlikely), continue incrementing at the same position (before extension).

Screenshots or logs

Conclusion
Created by GitHub Copilot and supervised by a human test analyst.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.