Issue #50: Fix of 00007.pdf

This commit is contained in:
Jakub Melka 2023-04-30 15:59:53 +02:00
parent 37dd55a361
commit 0b47464241
1 changed files with 10 additions and 5 deletions

View File

@ -523,12 +523,17 @@ QByteArray PDFFlateDecodeFilter::uncompress(const QByteArray& data)
default:
{
if (errorMessage.isEmpty())
{
errorMessage = PDFTranslationContext::tr("zlib code: %1").arg(error);
}
const bool ignoreError = error == Z_DATA_ERROR && errorMessage == "incorrect data check";
throw PDFException(PDFTranslationContext::tr("Error decompressing by flate method: %1").arg(errorMessage));
if (!ignoreError)
{
if (errorMessage.isEmpty())
{
errorMessage = PDFTranslationContext::tr("zlib code: %1").arg(error);
}
throw PDFException(PDFTranslationContext::tr("Error decompressing by flate method: %1").arg(errorMessage));
}
}
}