Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot cache contains many large files #4899

Open
1 task done
low-batt opened this issue Apr 27, 2024 · 4 comments · May be fixed by #4903
Open
1 task done

Screenshot cache contains many large files #4899

low-batt opened this issue Apr 27, 2024 · 4 comments · May be fixed by #4903

Comments

@low-batt
Copy link
Contributor

low-batt commented Apr 27, 2024

System and IINA version:

  • macOS 14.4.1
  • IINA 1.3.4

Expected behavior:
Disk caches are bounded in size.

Actual behavior:
@hugepower reports in this comment:

I am using PNG format for my screenshots, and each one occupies approximately 2MB of space. Surprisingly, in the ~/Library/Caches/com.colliderli.iina/screenshot_cache directory, IINA has stored nearly 10GB of past screenshot images. I am puzzled by this as I don't understand the need to retain so many screenshots, which seem to be taking up a significant amount of unnecessary storage space.

Steps to reproduce:

  • Start IINA

  • Click on Settings… under the IINA menu

  • The settings panel appears

  • Scroll down to the Screenshots section

  • Uncheck the Save to setting

  • Uncheck the Show previews after taking screenshots

  • Start playing a video

  • Take a screenshot

  • Notice a file still remains in the ~/Library/Caches/com.colliderli.iina/screenshot_cache directory

  • MPV does not have this problem.

How often does this happen?
Every time with the settings shown above.

@hugepower
Copy link

System and IINA version:

macOS Sonoma 14.4.1
IINA 1.3.4

In IINA's screenshot settings, when only the "Copy to Clipboard" function is enabled, each screenshot taken will be automatically saved to the designated directory.

image

@low-batt
Copy link
Contributor Author

Reproduced for me. This is a defect.

When the Save to screenshot setting is disabled IINA uses the ~/Library/Caches/com.colliderli.iina/screenshot_cache cache directory. That is expected. The defect is that the code that removes the temporary file is not executed if the Show previews after taking screenshots setting is disabled.

At least that is my analysis after a quick investigation. Do you have Show previews after taking screenshots unchecked?

@hugepower
Copy link

Reproduced for me. This is a defect.

When the Save to screenshot setting is disabled IINA uses the ~/Library/Caches/com.colliderli.iina/screenshot_cache cache directory. That is expected. The defect is that the code that removes the temporary file is not executed if the Show previews after taking screenshots setting is disabled.

At least that is my analysis after a quick investigation. Do you have Show previews after taking screenshots unchecked?

Yes. I did not enable this feature.

image

low-batt added a commit that referenced this issue Apr 28, 2024
This commit will change the screenshotCallback method in PlayerCore to
remove the cached screenshot file when not displaying a preview.
@low-batt low-batt linked a pull request Apr 28, 2024 that will close this issue
2 tasks
@low-batt low-batt linked a pull request Apr 28, 2024 that will close this issue
2 tasks
@low-batt
Copy link
Contributor Author

Thank you so much for reporting this problem and providing the additional information. I was initially confused by this report as I didn't know IINA had a screenshot cache. Wasting disk space is a critical problem that must be fixed. I have added this issue as a high priority fix for the next release.

svobs pushed a commit to svobs/iina-advance that referenced this issue May 2, 2024
This commit will change the screenshotCallback method in PlayerCore to
remove the cached screenshot file when not displaying a preview.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants