Re: PDF to TIFF hash - Avoid date/time reference
Giacomo Boccardo <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.devel |
|---|---|
| Message-ID | <[email protected]> |
Chris Liddell wrote on 01/12/15 15:41: > On 1 December 2015 at 07:44, Giacomo Boccardo <[email protected]> wrote: >> Hi, >> I'm using Ghostscript to extract pages' images from a PDF using a >> command like: >> >> gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -dFirstPage=1 -dLastPage=1 >> -dBandHeight=100 -dNOPAUSE -sDEVICE=tiff12nc -r200 >> -dNumRenderingThreads=2 -dBandBufferSpace=500000000 >> -dBufferSpace=750000000 -sBandListStorage=memory -sOutputFile=page1.tiff >> input.pdf >> >> For caching purposes I need that the hash of each tiff must be the same >> if it's produced from the same page. Unfortunately, I noticed that a >> date/time reference is added at the "beginning" (prolog?) of each file. >> That's the only thing that alters the hash: if you produce images in the >> same second, the hash is the same. >> >> So, is it possible to avoid to add that time reference? >> If it's not possible, is there a way to test if two tiffs have the same >> "appearance", without considering the metadata? > You cannot disable that, to the best of my knowledge. I'm not even > sure it's something we have control over - I'd have to look at the > source, and I don't have time right now. > > libtiff comes with a few tools that exercise the library, one being > tiffcmp which compares the image samples byte-for-byte. That may > satisfy your requirements. Interesting, that commands confirms what I guessed: the only difference is the date/time. $ tiffcmp zzz.tiff zzz2.tiff DateTime: "2015:12:01 00:33:44" "2015:12:01 00:33:55" > On Linux distros, they're usually packaged under a name like "libtiff-tools". > >> I suppose the last chance is to change the source code and recompile it :) > When I have some time, I'll check the gs source, and see if it is > something we control, or if it's something libtiff does automagically Thanks, It would be very helpful. > - I certainly won't be changing the libtiff code! > > Chris Kind regards, Giacomo Boccardo _______________________________________________ gs-devel mailing list [email protected] http://ghostscript.com/cgi-bin/mailman/listinfo/gs-devel