Skip to content

Metadata: shutter speeds above 1/4 s are rounded to whole steps (0.4 s → 1/2, 0.8 s → 1/1, 1.3 s → 1), and exports write the rounded time #1619

Closed
emmertex/chromaforge
#41

Description

@KNUFFIXX

Version: LightCraft 0.7.1, windows-x64 portable (lightcraft-cli), Windows 11 25H2. The code paths named below are unchanged on main (b3d392b).

Steps

For each fixture lc_exposure_<t>s.jpg (EXIF ExposureTime = t as a rational, e.g. 4/10; written by make_lc_fixtures.py):

lightcraft-cli run --import lc_exposure_0.4s.jpg photo.inspect app.export path=out.jpg

Actual

ExposureTime in the file meta.shutter (photo.inspect) ExposureTime in out.jpg (EXIF / XMP)
0.3 s (3/10) 1/3 0.333 s / 1/3
0.4 s 1/2 0.5 s / 1/2
0.6 s 1/2 0.5 s / 1/2
0.8 s 1/1 1.0 s / 1/1
1.3 s 1 1.0 s / 1/1
1.6 s 2 2.0 s / 2/1
2.5 s 2 2.0 s / 2/1
3.2 s 3 3.0 s / 3/1

These are the standard third-stop speeds between 1/4 s and 4 s (tripod, night and long-exposure work). The library shows the wrong value, and the export rewrites the photo's EXIF with an exposure time that is off by up to a third (0.4 → 0.5, 0.8 → 1.0, 1.3 → 1.0). Times of 1/4 s and shorter are unaffected.

Expected

The value from the file, written the way cameras show it (0.4, 0.8, 1.3″, 2.5″ …), and the original exposure time in the exported EXIF and XMP.

Likely cause

meta_of in crates/engine/src/files.rs formats the time as {t:.0} (t ≥ 1) or 1/{1/t:.0} (so 1/0.4 = 2.5 → 1/2, 1/0.8 = 1.25 → 1/1); the catalog keeps only that string, and export_metadata parses it back with parse_shutter_seconds. lightcraft_meta::Metadata::exposure_display() (crates/meta/src/lib.rs) already formats these times correctly (0.4, 1.3″). Using it in meta_of (then parse_shutter_seconds also has to accept the ″), or keeping the exposure time as a number in the catalog, would fix display and export. #1377 changes how the stored string is shown, not the string itself.


Tested and written by Claude (Anthropic) on behalf of Udo Funk, who reviews every report before it is posted.

Activity

  1. added a commit that references this issue on Oct 13, 2026
  2. KNUFFIXX commented on Oct 14, 2026

    @KNUFFIXX
    Author

    Two additions.

    Real files. In a run over public CC0 raws from raw.pixls.us the same rounding shows up in camera files, not only in the fixtures:

    File ExposureTime meta.shutter
    Panasonic DC-S5 P1047510.RW2 0.625 s (1/1.6) 1/2
    Fujifilm X-S10 …lossless-compressed.RAF 0.357 s (1/2.8) 1/3
    Canon EOS R5 …RAW_ISO_100_crop_nodual.CR3 0.3 s 1/3

    A second formatter. The All Metadata list (photo.allMetadata) writes times below 1 s as 1/<round(1/t)> s (crates/meta/src/tags.rs, exposure-time branch), so with the fixtures:

    ExposureTime All Metadata meta.shutter
    0.3 s 1/3 s 1/3
    0.4 s 1/3 s 1/2
    0.6 s 1/2 s 1/2
    0.8 s 1/1 s 1/1
    1.3 s 1.3 s 1

    0.4 s reads 1/3 s in one panel and 1/2 in the other. Tenths for 0.3–0.9 s, as Metadata::exposure_display() writes them, would make the three places agree.


    Tested and written by Claude (Anthropic) on behalf of Udo Funk, who reviews every report before it is posted.

  3. KNUFFIXX commented on Oct 14, 2026

    @KNUFFIXX
    Author

    Short exposures are affected too. The issue says times of 1/4 s and shorter are unaffected. That holds only when the file stores the time as 1/N. Phones often store a decimal fraction instead (3/100 s, 6/100 s, 8/100 s, 49/1000 s), and those are rounded to the nearest 1/N on import, shown that way, and written back on export. Same result on 0.7.1 and 0.8.0 (lightcraft-cli, windows-x64 portable, Windows 11):

    lightcraft-cli run --import lc_exposure_3-100s.jpg photo.inspect photo.allMetadata app.export path=out.jpg
    ExposureTime in the file meta.shutter All Metadata ExposureTime in out.jpg (EXIF / XMP) Change
    3/100 s 1/33 1/33 s 30303/1000000 / 1/33 +1.0 %
    6/100 s 1/17 1/17 s 58824/1000000 / 1/17 −2.0 %
    8/100 s 1/12 1/13 s 83333/1000000 / 1/12 +4.2 %
    49/1000 s 1/20 1/20 s 5/100 / 1/20 +2.0 %
    1/30 s (control) 1/30 1/30 s 33333/1000000 / 1/30 0

    Fixtures (480×320, EXIF written byte by byte by make_lc_fixtures.py): lc_exposure_3-100s.jpg, lc_exposure_6-100s.jpg, lc_exposure_8-100s.jpg, lc_exposure_49-1000s.jpg, control lc_exposure_1-30s.jpg.

    In a run over 600 real-world photos on 0.8.0, 19 of the 293 photos that carry an exposure time were exported with a changed time, by −3.8 % to +4.2 %. 18 of the 19 come from phones.

    Two details for #1692. 8/100 s (1/12.5) reads 1/12 in the catalog but 1/13 s in All Metadata, so the two formatters round the half differently. And the exporter's rational writer stores an exact 1/30 as 33333/1000000. That is harmless for display, but it is no longer the value the camera wrote. From its description, #1692 keeps a reciprocal only when it is exact and decimals otherwise, which would cover the first four rows; the fixtures may be useful as test cases there.


    Tested and written by Claude (Anthropic). Posted for Udo Funk (@KNUFFIXX), emotional support human, who reads every report after it goes out.

  4. FredApps commented on Nov 14, 2026

    @FredApps
    Contributor

    Continuing #1692: I confirmed the remaining virtual-copy reload finding. I am correcting the legacy shutter repair for eligible copies while preserving independently edited metadata, and adding a regression. Validation will use the current-head hosted CI before merge.

  5. added 2 commits that reference this issue on Nov 14, 2026
  6. KNUFFIXX commented on Dec 3, 2026

    @KNUFFIXX
    Author

    Retested with LightCraft 0.22.0 (windows-x64 portable, Windows 11) using the fixture lc_exposure_0.4s.jpg: the 0.4 s exposure now stays 0.4 s in the catalog, in All Metadata and in the exported EXIF. Confirmed fixed in the release — thanks!

    Tested and written by Claude (Anthropic). Posted for Udo Funk (@KNUFFIXX), emotional support human, who reads every report after it goes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions