-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix infoPanel crashes when loading incompatible images, that also nee…
…d to be stretched (#1418) 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. --------- Co-authored-by: XK <[email protected]> Co-authored-by: Aemiii91 <[email protected]>
- Loading branch information
1 parent
9459f80
commit 575a70d
Showing
7 changed files
with
74 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
static/packages/App/Gallery (Screenshot viewer)/App/Screenshots_Viewer/launch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
#!/bin/sh | ||
echo ":: Gallery - Screenshots Viewer ::" | ||
|
||
/mnt/SDCARD/.tmp_update/bin/infoPanel -d /mnt/SDCARD/Screenshots --show-theme-controls | ||
infoPanel -d /mnt/SDCARD/Screenshots --show-theme-controls | ||
ec=$? | ||
|
||
# cancel or success from infoPanel | ||
if [ $ec -eq 255 ] || [ $ec -eq 0 ] ; then | ||
if [ $ec -eq 255 ] || [ $ec -eq 0 ]; then | ||
exit 0 | ||
elif [ $ec -eq 1 ]; then | ||
infoPanel -t Gallery -m "No screenshots found" | ||
else | ||
# something went wrong | ||
infoPanel -t Gallery -m "An error occurred - code: $ec" | ||
fi | ||
|
||
/mnt/SDCARD/.tmp_update/bin/infoPanel -t Gallery -m "No screenshots found" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
infoPanel --images-json /mnt/SDCARD/App/Onion_Manual/images.json --show-theme-controls | ||
infoPanel --images-json /mnt/SDCARD/App/Onion_Manual/images.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters