Thumbnail generation is skipped for files with future modification timestamps

オープン 初心者向け
#3,907 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
desktop

調査の方向性

libnemo-private/nemo-thumbnails.c の、info->original_file_mtime に対する RECENT_MTIME_COOLDOWN チェックから始めてください。mtime が 24 時間先の JPEG で再現し、その後、mtime が未来でない場合にのみ cooldown が適用されるように条件を調整してください。完了とは、mtime が未来のファイルは thumbnail を取得し、最近変更されたファイルは引き続き既存の cooldown に従うことです。Nemo を再ビルドし、説明したテストを繰り返してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C
スター
1.6k
フォーク
391
平均マージ
2日 19時間
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

linuxmint/nemo のほかの issue

linuxmint/nemo の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。