Thumbnail generation is skipped for files with future modification timestamps
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 libnemo-private/nemo-thumbnails.c 中针对 info->original_file_mtime 的 RECENT_MTIME_COOLDOWN 检查开始。用一个 mtime 比当前时间快 24 小时的 JPEG 复现,然后调整条件,使 cooldown 仅在 mtime 不在未来时生效。完成的标准是:mtime 在未来的文件能获得缩略图,而最近修改过的文件仍然遵守现有的 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
- Create or select a JPEG image.
- Set its modification timestamp approximately 24 hours into the future.
- Open the containing directory in Nemo.
- Observe that the thumbnail is not generated or displayed.
- 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
mtimeapproximately 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-largethumbnail 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
- Create or select a JPEG image.
- Set its modification timestamp approximately 24 hours into the future.
- Open the containing directory in Nemo.
- Observe that the thumbnail is not generated or displayed.
- 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 小时
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxmint/nemo 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Copy dialog: Enter key accidentally cancels file copy可能已有人在做 @jackjusko 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
linuxmint/nemo#3838 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
linuxmint/nemo#3805 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Claude:NeedsReview GPT:ConfirmedBug GPT:NeedsReview triage
难度 2/5 1-3 小时 新手友好度 66/100
open5gs/open5gs#5114 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
owntone/owntone-server#2071 ·
-
triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复