You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: image-source: an image replaced within the same second is never reloaded (upstream obsproject/obs-studio#10700) #547
Upstream OBS bug, reported by chocobclyn in obsproject/obs-studio#10700 (Windows 11): an Image source whose file is deleted and replaced by a new file of the same name keeps showing the old image. The reporter's workflow updates an overlay image from a spreadsheet tool (deleting the file and writing a new one). It is still open upstream, and the code is the same in this fork.
Location
plugins/image-source/image-source.cimage_source_tick() checks the file once a second and loads it again when get_modified_timestamp() changed. That returns st_mtime, the modification time in whole seconds.
A new file written in the same second as the version the source loaded (deleted and replaced, or overwritten) has the same st_mtime, so the source never notices it: the old image stays until the file changes again in a later second. Tools that update an image often, or write it right after deleting it, hit this regularly.
Class
Stale content on screen (wrong image shown indefinitely), no error.
How it is reached
Image source on a file that another program updates by deleting and rewriting it, or by overwriting it, when the new version is written within the same second as the version the source last loaded (after the source picked up the previous version within that second).
Reproduced in the current release
AppImage 33.0.0-beta6-799, headless, private config, obs-websocket (CreateInput image_source, GetSourceScreenshot to read the shown color):
Delete the file, wait 2 s, write a blue image: blue is shown (works).
Write a white image at the start of a second, wait until the source shows white (0.5 s in), then delete it and write a yellow image of the same size in that same second: the source still shows white 3.5 s later (and keeps showing it).
Proposed fix and failing test
Fix: compare the sub-second part of the modification time as well where stat() reports it (Linux, macOS, BSDs), and the file size (which also covers Windows' os_stat() and file systems that keep whole or two seconds whenever the new image differs in size). The comparison moves into a small helper (plugins/image-source/image-file-version.c) so it can be unit tested.
RED test (cmocka, test_image_file_version, no graphics, no display; sets file times with utimensat()):
a new file 0.4 s after the old one, same second, same size: must count as changed;
same time, different size: must count as changed;
controls: an untouched file is unchanged; deleting and recreating are changes; a missing file is stable.
@chocobclyn you reported this in obsproject/obs-studio#10700 (an Image source keeps showing the old picture after its file is replaced), so a heads-up: it's fixed here in obs-rust by #548, with a regression test.
Cause: the Image source checks its file once a second, but it compared the file's modification time in whole seconds only. When the file was deleted and replaced within the same second (which is what most tools that write an image in place do), the time looked unchanged and the old picture stayed. It now also compares the sub-second part of the time and the file size. In the obs-rust release on Linux, a white image replaced by a yellow one within the same second was still white 3.5 s later; with the fix the new image loads.
An important limit for your setup: on Windows, the file time OBS reads there only has whole seconds, so with this fix a same-second replacement is caught only when the new image file has a different size from the old one. If your overlay images are always the same size in bytes, this fix won't help yet on Windows; I've noted a follow-up to read Windows' finer file times as well.
Workaround on stock OBS: wait more than a second between removing the old file and writing the new one, or write the new image under a different name and point the source at it.
Activity
rdoupe commentedon Oct 13, 2026
Claiming: this issue.
test_image_file_version(2 of 5 failing), the file change check moved intoimage-file-version.[ch]with no behaviour change.PR today.
test/cmocka: Add failing test for an image replaced within a second
image-source: Reload an image replaced within the same second
image-source: Reload an image replaced within the same second (#548)
rdoupe commentedon Oct 13, 2026
@chocobclyn you reported this in obsproject/obs-studio#10700 (an Image source keeps showing the old picture after its file is replaced), so a heads-up: it's fixed here in obs-rust by #548, with a regression test.
Cause: the Image source checks its file once a second, but it compared the file's modification time in whole seconds only. When the file was deleted and replaced within the same second (which is what most tools that write an image in place do), the time looked unchanged and the old picture stayed. It now also compares the sub-second part of the time and the file size. In the obs-rust release on Linux, a white image replaced by a yellow one within the same second was still white 3.5 s later; with the fix the new image loads.
An important limit for your setup: on Windows, the file time OBS reads there only has whole seconds, so with this fix a same-second replacement is caught only when the new image file has a different size from the old one. If your overlay images are always the same size in bytes, this fix won't help yet on Windows; I've noted a follow-up to read Windows' finer file times as well.
Workaround on stock OBS: wait more than a second between removing the old file and writing the new one, or write the new image under a different name and point the source at it.
It will be in the next obs-rust daily release after 0.1.0-beta.20261012: https://github.com/obs-rust/obs-studio/releases (Windows, macOS and Linux builds; on Arch it's
obs-studio-rust-gitin the AUR). obs-rust is an AI-assisted fork of OBS.If you get a chance to try it, a reply here on whether the source now picks up the replaced image would really help.