Page MenuHomePhabricator

Prevent malformed images from crashing widgets
Closed, ResolvedPublic

Description

From: https://phabricator.wikimedia.org/T262355

Certain images will render correctly in the main app, but not the WidgetKit extension. This can potentially lead to a widget crashing. An example of an image with that behavior is attached (also zipped in case Phabricator's compression changes anything.)

When using SwiftUI's Image view to render this image, it displays correctly on device and Simulator in app. It also renders correctly on Simulator in a widget. BUT it doesn't render at all on device in a WidgetKit extension widget. All of the targets use the same SwiftUI Image view for display purposes. The console displays this error JPEGDecompressSurface : Picture decode failed: e00002d1 even in the cases above where the image renders correctly.

Guesses from some initial research is that the image decoding path the Simulator uses is different than the image decoding path used on device, and that's why the issue doesn't occur on the Simulator. I filed a Radar for this issue during the beta, and updated my feedback to Apple that this still occurs in the shipping version of iOS 14. If Apple is unable to resolve this issue on their end, we should figure out a way to deal with these problematic images in widgets.

320px-First_United_States_Labor_Day_Parade,_September_5,_1882_in_New_York_City 2.jpg (208×320 px, 34 KB)

Event Timeline

LGoto triaged this task as Low priority.Sep 28 2020, 6:49 PM
LGoto moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.
Dmantena claimed this task.

While my Radar for it remains open with no feedback from Apple, it appears that iOS 15 resolved this particular crash! It still occurs on iOS 14.6 though.

Closing this one as resolved.