Checking for corrupted JPEG files

10 ビュー (過去 30 日間)
Radka Tezaur
Radka Tezaur 2021 年 2 月 10 日
回答済み: KSSV 2021 年 2 月 10 日
When reading JPEG files using imread, I sometimes get the warning
Warning: JPEG library error (8 bit), "Corrupt JPEG data: premature end of data segment".
I get an image that has correct size, but its content is messed up and causes trouble down the line, when it gets processed. I need to weed out these images automatically. Is there any way to get instead of the displayed warning some flag that could be used for logical operations? Imread help does not mention anything of that sort. :-(

採用された回答

KSSV
KSSV 2021 年 2 月 10 日
You may capture the warning and skip the processing, if you get warning. Refer on how to capture the warning.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by