mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
JBIG2 - basic reading of segments
This commit is contained in:
@ -78,7 +78,7 @@ PDFBitReader::Value PDFBitReader::look(Value bits) const
|
||||
|
||||
void PDFBitReader::seek(qint64 position)
|
||||
{
|
||||
if (position < m_stream->size())
|
||||
if (position <= m_stream->size())
|
||||
{
|
||||
m_position = position;
|
||||
m_buffer = 0;
|
||||
@ -90,6 +90,22 @@ void PDFBitReader::seek(qint64 position)
|
||||
}
|
||||
}
|
||||
|
||||
void PDFBitReader::skipBytes(Value bytes)
|
||||
{
|
||||
// Jakub Melka: if we are lucky, then we just seek to the new position
|
||||
if (m_bitsInBuffer == 0)
|
||||
{
|
||||
seek(m_position + bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Value i = 0; i < bytes; ++i)
|
||||
{
|
||||
read(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PDFBitReader::alignToBytes()
|
||||
{
|
||||
const Value remainder = m_bitsInBuffer % 8;
|
||||
|
Reference in New Issue
Block a user