[poppler] Cannot open in poppler 0.22.1 a file saved after large file support patches
Albert Astals Cid
aacid at kde.org
Thu May 16 11:50:58 PDT 2013
El Dijous, 25 d'abril de 2013, a les 22:57:17, Fabio D'Urso va escriure:
> On Saturday, February 16, 2013 10:57:36 AM Adrian Johnson wrote:
> > On 16/02/13 09:53, Fabio D'Urso wrote:
> > > Hi,
> > >
> > > I'm not able to open files saved by git-master poppler in poppler 0.22:
> > > Syntax Error: Couldn't find trailer dictionary
> > > Syntax Error: Couldn't read xref table
> > >
> > > I noticed that large file support patches changed how we write
> > > incremental
> > > updates of XRef streams. In particular I'm referring to
> > > XRef::XRefStreamWriter::writeEntry and XRef::writeStreamToBuffer.
> > >
> > > Previously we used to write 4-bytes offsets in XRef streams, now we
> > > always
> > > write 8-bytes offsets (sizeof(Goffset)).
> > > If I understand correctly older poppler versions are not able to read
> > > those files because they don't have large file support.
> > >
> > > In other words, even if the files we create are good, all previous
> > > poppler
> > > versions (including 0.22.1) are not able to open them back.
> >
> > Could you open a bug to track this issue.
>
> Sorry, I haven't opened a bug. But I've written patches :)
>
> > > Maybe we had better keep emitting 4-bytes entries for compatibility when
> > > possible (i.e. if no offset exceeds the 4GB limit), what do you think?
> >
> > Yes it would be best to check if all offsets in the xref stream are less
> > than 4GB and if so, write 4 byte offsets.
>
> This is done in the first attached patch.
>
> I've also attached two other patches that fix a printf format specifier (%i
> should now be %lli because it refers to a Goffset).
> The second patch adds the printf-format attribute to OutStream::printf, so
> the compiler can spot this kind of errors. The third one is the actual fix.
> This fixes the startxref value being sometimes negative on little-endian
> cpus where int is 32-bit, and zero on big-endian cpus where int is 32-bit.
Commited.
Cheers,
Albert
>
> Fabio
More information about the poppler
mailing list