You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ended up implementing a simple wrapper that fixes the issue:
privateclassVideoDecoderFixed:ImageDecoding,@uncheckedSendable{privateletdecoder:ImageDecoders.VideovarisAsynchronous:Bool{ decoder.isAsynchronous }init?(context:ImageDecodingContext){
guard let decoder =ImageDecoders.Video(context: context)else{returnnil}self.decoder = decoder
}func decode(_ data:Data)throws->ImageContainer{
if let image = decoder.decodePartiallyDownloadedData(data){return image }returntry decoder.decode(data)}func decodePartiallyDownloadedData(_ data:Data)->ImageContainer?{
decoder.decodePartiallyDownloadedData(data)}}
Is it expected that decode(_ data: Data) function returns an empty image?
Do you think it could use the same logic as in decodePartiallyDownloadedData(_ data: Data)?
Does the workaround described above seem fine?
Thanks!
The text was updated successfully, but these errors were encountered:
I have several local video files and I need to display a grid of thumbnails.
I registered the video decoder like this:
But it doesn't work, thumbnails are not loaded.
I noticed that
decode(_ data: Data)
function of theImageDecoders.Video
class always returns an empty image.But
decodePartiallyDownloadedData(_ data: Data)
implementation looks just fine.I ended up implementing a simple wrapper that fixes the issue:
Is it expected that
decode(_ data: Data)
function returns an empty image?Do you think it could use the same logic as in
decodePartiallyDownloadedData(_ data: Data)
?Does the workaround described above seem fine?
Thanks!
The text was updated successfully, but these errors were encountered: