CATROID-1646 Restore full-resolution session screenshots for visual placement#5194
Conversation
There was a problem hiding this comment.
Pull request overview
Restores full-resolution stage screenshots for visual placement by writing an additional session-local screenshot into the app cache while keeping persisted project/scene screenshots thumbnail-sized to avoid inflating project storage and exports.
Changes:
- Added a session screenshot cache path and made visual placement background loading prefer session-local full-res screenshots.
- Updated screenshot saving to write both persisted thumbnail screenshots and an extra full-resolution session screenshot to cache.
- Added an Android regression test verifying persisted screenshots remain low-res while session-local cache screenshots keep framebuffer resolution.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| catroid/src/main/java/org/catrobat/catroid/utils/ProjectManagerExtensions.kt | Adds session screenshot file resolution and preference logic in getProjectBitmap(). |
| catroid/src/main/java/org/catrobat/catroid/stage/ScreenshotSaver.kt | Writes an additional full-resolution screenshot to cache and refactors bitmap saving into a helper. |
| catroid/src/androidTest/java/org/catrobat/catroid/test/stage/ScreenshotSaverResolutionRegressionTest.kt | Adds regression coverage for persisted-vs-session screenshot resolution behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the SonarCloud reliability finding from the latest Quality Gate failure in The issue was the ignored boolean return value of Local verification:
|
|
Thanks! @wslany for the changes . It seems the activity can end up only partially initialized in the test environment, leading to a crash before the screenshot assertions complete. This doesn’t appear related to the screenshot logic itself, but it does mean the regression test is currently not passing as an instrumented test on my setup.
|
|
@harshsomankar123-tech Thanks again for catching the test-harness failure. I addressed it in Local emulator verification now passes on I also rebuilt and installed the app/test APKs locally before running the instrumentation command: |
harshsomankar123-tech
left a comment
There was a problem hiding this comment.
@wslany Thanks! LGTM
|




Visual placement uses the saved stage screenshot as its background image. Since #4852, that screenshot has been reduced to thumbnail resolution before being written, which makes thin pen/plot/cut/engrave lines disappear or look fuzzy in visual placement.
https://catrobat.atlassian.net/browse/CATROID-1646
This PR keeps the persisted screenshot thumbnail-sized so project storage and exported
.catrobatfiles stay small, but also writes a full-resolution screenshot to app cache for the current session. Visual placement now prefers that session-local cache image.It also adds a regression test that verifies the intended split:
Your checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.