Thumbnail generation is skipped for files with future modification timestamps

Offen Anfängerfreundlich
#3,907 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
c
Bereich
desktop

Rechercherichtung

Beginne in libnemo-private/nemo-thumbnails.c bei der RECENT_MTIME_COOLDOWN-Prüfung gegen info->original_file_mtime. Reproduziere das mit einem JPEG, dessen mtime 24 Stunden in der Zukunft liegt, und passe dann die Bedingung so an, dass der Cooldown nur greift, wenn die mtime nicht in der Zukunft liegt. Fertig bedeutet: Dateien mit zukünftiger mtime bekommen Thumbnails, während kürzlich geänderte Dateien weiterhin den bestehenden Cooldown einhalten; baue Nemo neu und wiederhole den beschriebenen Test.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Distribution

Linux Mint 22.3 Zena

Package version

6.6.3+zena

Frequency

Always

Bug description

Problem description

Nemo may indefinitely skip thumbnail generation for files whose modification timestamp (mtime) is in the future.

The current code applies the recent-modification cooldown using the following condition:

if (current_time < info->original_file_mtime + RECENT_MTIME_COOLDOWN) {

If a file's mtime is later than the current system time, this condition remains true until the current time reaches the file's modification timestamp plus RECENT_MTIME_COOLDOWN. As a result, Nemo does not attempt to generate a thumbnail during that period.

This can occur, for example, when files are copied from a device or filesystem that uses a different clock or timestamp convention.

Expected behavior

Files with future modification timestamps should not be blocked by the recent-modification cooldown. Nemo should proceed with thumbnail generation.

The cooldown should continue to apply to files modified within the existing cooldown period.

Proposed fix

Check that the file's modification timestamp is not in the future before applying the cooldown:

if (info->original_file_mtime <= current_time &&
    current_time < info->original_file_mtime + RECENT_MTIME_COOLDOWN) {

This preserves the existing cooldown behavior for recently modified files while allowing thumbnail generation for files with future timestamps.

Steps to reproduce

  1. Create or select a JPEG image.
  2. Set its modification timestamp approximately 24 hours into the future.
  3. Open the containing directory in Nemo.
  4. Observe that the thumbnail is not generated or displayed.
  5. Apply the proposed change, rebuild Nemo, and repeat the test.

Test results

Tested on Linux Mint 22.3 Zena with Nemo 6.6.3+zena.

  • Created a JPEG test image and set its mtime approximately 24 hours into the future.
  • Confirmed that the original version of Nemo did not display the thumbnail.
  • Rebuilt and installed Nemo with the proposed change.
  • Confirmed that the patched version successfully generated and displayed the thumbnail.
  • Removed an outdated xx-large thumbnail cache entry and confirmed that Nemo regenerated a valid thumbnail.
  • Verified that the patch applies cleanly in both forward and reverse directions.

Proposed patch

The attached patch modifies libnemo-private/nemo-thumbnails.c.

nemo-future-mtime-thumbnail-fix.patch

Steps to reproduce
  1. Create or select a JPEG image.
  2. Set its modification timestamp approximately 24 hours into the future.
  3. Open the containing directory in Nemo.
  4. Observe that the thumbnail is not generated or displayed.
  5. Apply the proposed change, rebuild Nemo, and repeat the test.
Expected behavior

Files with modification timestamps in the future should still have their thumbnails generated normally.

The recent-modification cooldown should only apply when the file's modification timestamp is not later than the current system time.

The existing cooldown behavior for recently modified files should remain unchanged.

Additional information

The issue was reproduced on Linux Mint 22.3 Zena with Nemo 6.6.3+zena.

The proposed fix has been built and tested locally. Thumbnail generation works as expected for a JPEG file with an mtime approximately 24 hours in the future after applying the patch.

The patch has been verified by applying it in both forward and reverse directions.

The fix has not yet been tested against the latest upstream development branch.

Vorherrschende Sprache
C
Sterne
1.6k
Forks
391
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus linuxmint/nemo

Alle Issues in linuxmint/nemo

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.