Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Setting generateThumbnail to true causes App to crash #280

Copy link
Copy link
@chrisweight

Description

@chrisweight
Issue body actions

It appears as though the NextLevelPhotoConfiguration.avcaptureDictionary() function tries to add the kCVPixelBufferPixelFormatTypeKey if available in the __availablePreviewPhotoPixelFormatTypes, however it also adds the
AVVideoCodecKey, which causes a consuming app to crash with this callstack:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[AVCapturePhotoSettings photoSettingsWithFormat:] kCVPixelBufferPixelFormatTypeKey and AVVideoCodecKey may not both be specified'
*** First throw call stack:
(0x1a17ccf20 0x199686018 0x1be7bf638 0x1024d0c9c 0x1024d098c 0x102491bc8 0x102465b58 0x102461ae4 0x1a6fb4cc8 0x1a6a0d528 0x1a57ff4e8 0x1a5801bec 0x1a57ff4e8 0x1a57fc7d0 0x1a57fbe48 0x1a6fdabd8 0x1a6dd7bb8 0x1a6dd61b8 0x1a6dd6344 0x1a3b4caf4 0x1a3a5b560 0x1a3b4fb40 0x1a3d06680 0x1a3d05944 0x1a3b869e0 0x1a3b881d4 0x1a3b90ecc 0x1a3b8f740 0x1a179f834 0x1a179f7c8 0x1a179d298 0x1a179c484 0x1a179bcd8 0x1e664c1a8 0x1a3dd490c 0x1a3e889d0 0x1a598c148 0x1a5938714 0x1a59444d0 0x1024828a4 0x102482950 0x1c4e4de4c)
libc++abi: terminating due to uncaught exception of type NSException

I'm guessing because those two keys are mutually exclusive according to the docs :)

This is on both iOS15 and iOS 17

ref:
https://github.com/NextLevel/NextLevel/blame/d0dbca9aa865c105bd3208652d490ecd17f764da/Sources/NextLevelConfiguration.swift#L461

I would also note that the NextLevel property of generateThumbnail is probably mis-named and should be generatePreview, given that Previews and Thumbnails are actually different things according to the docs here: https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/1648696-previewphotoformat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.