From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Mysterious gzipped images Date: Mon, 12 Aug 2013 16:05:35 +0200 Message-ID: References: <87mwoul8sz.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376316365 31575 80.91.229.3 (12 Aug 2013 14:06:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Aug 2013 14:06:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 12 16:06:08 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V8sl4-0001AC-AD for ged-emacs-devel@m.gmane.org; Mon, 12 Aug 2013 16:06:06 +0200 Original-Received: from localhost ([::1]:56282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8sl3-0008Fe-KJ for ged-emacs-devel@m.gmane.org; Mon, 12 Aug 2013 10:06:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8skv-0008FG-RR for emacs-devel@gnu.org; Mon, 12 Aug 2013 10:06:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8skq-00077V-DB for emacs-devel@gnu.org; Mon, 12 Aug 2013 10:05:57 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:44867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8skp-00076t-H6 for emacs-devel@gnu.org; Mon, 12 Aug 2013 10:05:52 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1V8skZ-00049m-FX; Mon, 12 Aug 2013 16:05:35 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+/sT8643ckznxsla1 WA78233996T4ym3KkFLuAAACbklEQVQ4jU2US6/TMBBGzSb7ASXdIjul69oU73MDrH3RXG9rJMyW NjL++3xjpxWjREp9Og/PS63/y6K1vFrPi+o/5xVH+HLVOe+c0x5gMc5Z3cRYx0TMsRYA7WvdNKiW rxoo0cgMYGqsVrSM84UZKgGkAa72BGvOVTkWEbCYWqI+1gqlQlNukp7gEjezuYLzq4JkAvAlRHvm u9/crYOshkmtxjFv9sg/agNKDddhyAAvAK/LkUuNVjQGsZQEVKJqLwg96vPUPIBktRhPqdzPB89s Aa5PoH1AFs5jYL4fp+ZaKZha9EVudMbLP067gkoZ4V4IF7rV8RCdedud/JrkHgAU9PyqF8T+USmw 9CYAMY50ie+t07euMdCbRBWmnNJEvDn3t7sQIMklyRuNs/7+ZQcZGicpDawhKHcr3fcwVpi63+gg 4APHEHcXBHCyfp2X+ev6eZlfjNc/T/OniYo453E9oBFePt/tuqyvav0mhQIoY80c7N0sR0Muq99/ rjtgSjkRHZj8nsMUANyFaZySdADq06MllgoWDq05RtpTqFJCzTWahiqJRngAJcCgSyiKKXpqqHeh AWYpFiQPu/OBxVThceNJKjUNe8mlE7VkEc8obZv3ilMQgIsA4LxOvQ+HnHtUaHdu8gSpa2xVQHkA KBxuANL+tewaItc8RaREgBcCT6EPQZ4Yppam0SVQn46xzaAMp++AcU+cpzFWGWcBnYTQMxA33wFG G70jMxjGQFwx7WJKu4d4CfsJ1qVFJvvA1VJk/P1m1GOHWHlMi0/+otVzu7SVIeG18wfA4mjifAtC 60X9t5Hgy2osDllL6z+UZgTgqHuVfwAAAABJRU5ErkJggg== X-Now-Playing: Joy Division's _Atmosphere_: "Atmosphere" X-Hashcash: 1:23:130812:monnier@iro.umontreal.ca::HU2gsqqr7bBfOMNN:0000000000000000000000000000000000000PxSr X-Hashcash: 1:23:130812:emacs-devel@gnu.org::EZXYL5nHRO4AiZlM:000000000000000000000000000000000000000001By3g In-Reply-To: (Stefan Monnier's message of "Sun, 11 Aug 2013 20:54:31 -0400") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1V8skZ-00049m-FX MailScanner-NULL-Check: 1376921135.79036@qsw45DVhIuWBv1NZlhV8DA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162613 Archived-At: Stefan Monnier 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: http://www.zlib.net/manual.html 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