Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion example/src/screens/CaptureResolutionTestScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ const analyze = async (
c: ResolutionCase,
sourceDp: Size,
): Promise<CaseResult> => {
const data = await Skia.Data.fromURI(uri);
// iOS tmpfile results are bare paths; Skia's loader needs a file:// URL
// (a scheme-less NSURL reads nothing).
const data = await Skia.Data.fromURI(
uri.startsWith('/') ? `file://${encodeURI(uri)}` : uri,
);
const image = Skia.Image.MakeImageFromEncoded(data);
if (!image) throw new Error('could not decode capture');
const width = image.width();
Expand Down
Loading