mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Bugfix - find inline image stream length
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "pdfimage.h"
|
||||
#include "pdfpattern.h"
|
||||
#include "pdfexecutionpolicy.h"
|
||||
#include "pdfstreamfilters.h"
|
||||
|
||||
#include <QPainterPathStroker>
|
||||
|
||||
@ -548,8 +549,21 @@ void PDFPageContentProcessor::processContent(const QByteArray& content)
|
||||
}
|
||||
else if (dictionary->hasKey("Filter"))
|
||||
{
|
||||
// We will use EI operator position to determine stream length
|
||||
dataLength = operatorEIPosition - startDataPosition;
|
||||
dataLength = -1;
|
||||
|
||||
// We will try to use stream filter hint
|
||||
PDFDocumentDataLoaderDecorator loader(m_document);
|
||||
QByteArray filterName = loader.readNameFromDictionary(dictionary, "Filter");
|
||||
if (!filterName.isEmpty())
|
||||
{
|
||||
dataLength = PDFStreamFilterStorage::getStreamDataLength(content, filterName, startDataPosition);
|
||||
}
|
||||
|
||||
if (dataLength == -1)
|
||||
{
|
||||
// We will use EI operator position to determine stream length
|
||||
dataLength = operatorEIPosition - startDataPosition;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user