summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/lib/viewgif.ps
diff options
context:
space:
mode:
authorReinhard Kotucha <reinhard.kotucha@web.de>2013-02-18 22:54:24 +0000
committerReinhard Kotucha <reinhard.kotucha@web.de>2013-02-18 22:54:24 +0000
commit152319ccddf48a345b38cc725bf839467fd9d57d (patch)
treeccf35a4c175f9b536ac4f32207690e8e355c0526 /Master/tlpkg/tlgs/lib/viewgif.ps
parent8bf3f3c636bf1dee1cb1b3cfcdaa951c3879c937 (diff)
tlgs: update gs-9.05 -> gs-9.07
git-svn-id: svn://tug.org/texlive/trunk@29151 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlgs/lib/viewgif.ps')
-rw-r--r--Master/tlpkg/tlgs/lib/viewgif.ps32
1 files changed, 25 insertions, 7 deletions
diff --git a/Master/tlpkg/tlgs/lib/viewgif.ps b/Master/tlpkg/tlgs/lib/viewgif.ps
index 78c45bdb221..f39588230b9 100644
--- a/Master/tlpkg/tlgs/lib/viewgif.ps
+++ b/Master/tlpkg/tlgs/lib/viewgif.ps
@@ -1,4 +1,5 @@
-% Copyright (C) 1989, 1992, 1993, 1998 Aladdin Enterprises. All rights reserved.
+% Copyright (C) 2001-2012 Artifex Software, Inc.
+% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
% implied.
@@ -7,13 +8,11 @@
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
%
-% For more information about licensing, please refer to
-% http://www.ghostscript.com/licensing/. For information on
-% commercial licensing, go to http://www.artifex.com/licensing/ or
-% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
-% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
+% Refer to licensing information at http://www.artifex.com or contact
+% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
+% CA 94903, U.S.A., +1(415)492-9861, for further information.
+%
-% $Id$
% viewgif.ps
% Display a GIF file.
@@ -158,3 +157,22 @@
ifelse
saved end end end restore
} bind def
+
+% This lets you do stuff on the command line like:
+% gs -sDEVICE=pdfwrite -o stuff%03d.pdf viewgif.ps -c "(image.gif) << /PageSize 2 index viewGIFgetsize 2 array astore >> setpagedevice viewGIF"
+% so the output size is influenced by the original image.
+/viewGIFgetsize % <file|string> ==> [width height]
+{
+ save 20 dict begin
+ /saved exch def
+ dup type /stringtype eq { (r) file } if
+ /F exch def
+ F readGIFheader /Header exch def
+ currentdict Header end begin begin
+ VGIFDEBUG { Header { exch == == } forall (----------------\n) print flush } if
+ F readGIFimageHeader /ImageHeader exch def
+ currentdict ImageHeader end begin begin
+ F 0 setfileposition % reset file pointer
+ Width Height
+ saved end end end restore
+} bind def