[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious gzipped images

From: Lars Magne Ingebrigtsen
Subject: Re: Mysterious gzipped images
Date: Mon, 12 Aug 2013 16:05:35 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Sure, renaming from `decompress-gzipped-region' to something more
>> prefixey would make sense.  Do you prefer zlib (which is what the zlib
>> people call it), or libz (which is what all other people call their
>> libraries)?
> If (random 2) return 1, then "libz-" is the clear winner, but if it
> returns 0 then "zlib-" is way better.

`zlib' won.  I've now renamed the function.

> I have Elisp code that reads a PDF file and returns the number of pages
> it has (I use it in doc-view to determine the last page without having
> to render the whole file), but it doesn't work in recent PDFs because
> the index is now compressed using some kind of gzip but without the
> usual file header, kind of like the gzip compression used in ssh.

Hm...  could it be a DEFLATE format thing?  Uhm...  RFC1951, apparently,
according to the manual:


zlib should support decompressing that, too -- I think the only thing
that should need twiddling is the inflateInit2 call, which takes magical
badly documented parameters to tell it what to do...

I think.  The real documentation is in /usr/include/zlib.h.  Read the
bit about inflateInit2 and scratch your head...

> This PDF-reading code is only in my local changes because without
> support for current PDFs it's pretty useless.  But its absence in trunk
> also makes it harder (read: not installed yet) to provide good support
> for lazy-rendering (i.e. only render those pages you look at), which is
> a feature I use a lot and that some users have requested.

If you have some test files, I can try to see if I can get zlib to do
the right thing.

(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]