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

Fix infoPanel crashes when loading incompatible images, that also need to be stretched #1418

Merged
merged 8 commits into from Feb 24, 2024

Conversation

tGecko
Copy link
Member

@tGecko tGecko commented Feb 10, 2024

Closes #1386

The images that crashed the infoPanel were in a different format, which SDL_SoftStretch couldn't handle, leaving image_to_draw empty and subsequently crashing when drawing the empty image.
To safeguard against this, create a separate surface and check the return of SoftStretch for error.

Testing this showed that some of the stretched images looked horrible, so now only stretch images if they are too big to fit the screen. (MMv4 752x560 screenshots mainly)

Additionally, add some error handling to the Gallery launch script, so it would show "Error" instead of "No screenshots found" when infoPanel crashes to be less misleading.

To test, copy the screenshot folder from the issue #1386 to your SD/Screenshots and confirm it doesn't crash when loading the different screenshots.

only stretch images if they're too big, it can look horrible when stretching smaller ones
some extra error handling in Gallery/infoPanel
@tGecko tGecko self-assigned this Feb 10, 2024
@tGecko tGecko added this to the v4.3 milestone Feb 10, 2024
@tGecko tGecko added the bug in onion Something isn't working label Feb 10, 2024
@XK9274 XK9274 self-requested a review February 14, 2024 23:25
Copy link
Member

@XK9274 XK9274 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great success, tested w/ files from original issue - reproduced and confirmed this fixes.

@Aemiii91 Aemiii91 added this pull request to the merge queue Feb 24, 2024
Merged via the queue into main with commit 575a70d Feb 24, 2024
2 checks passed
@Aemiii91 Aemiii91 deleted the fix-gallery-not-finding-screenshots branch February 24, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in onion Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gallery App not finding any screenshots after Tweaks/Advanced/Reset Everything
3 participants