PATH:
usr
/
share
/
ghostscript
/
lib
% Copyright (C) 2001-2018 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or % implied. % % This software is distributed under license and may not be copied, % modified or distributed except as expressly authorized under the terms % of the license contained in the file LICENSE in this distribution. % % Refer to licensing information at http://www.artifex.com or contact % Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, % CA 94945, U.S.A., +1(415)492-9861, for further information. % % viewgif.ps % Display a GIF file. /read1 % <file> read1 <int> { read pop } bind def /read2 % <file> read2 <int> { dup read1 exch read1 8 bitshift add } bind def /readGIFheader % <file> readGIFheader <dict> { 20 dict begin dup 6 string readstring pop dup (GIF87a) eq exch (GIF89a) eq or not { (Not a GIF file.\n) print cleartomark stop } if dup read2 /Width exch def dup read2 /Height exch def dup read1 dup 128 ge /GlobalColor exch def dup -4 bitshift 7 and 1 add /BitsPerPixel exch def %***BOGUS?*** dup 8 and 0 ne /PaletteSorted exch def 7 and 1 add dup /BitsPerPixel exch def 1 exch bitshift /PaletteSize exch def dup read1 /BackgroundIndex exch def dup read1 15 add 64 div /AspectRatio exch def GlobalColor { PaletteSize 3 mul string readstring pop /GlobalPalette exch def } if currentdict end } bind def /readGIFimageHeader % <file> readGIFimageHeader <dict> % Note: GIF header must be on dict stack { 10 dict begin { dup read1 dup (!) 0 get ne { exit } if pop % extension dup read1 pop { dup read1 dup 0 eq { pop exit } if { dup read1 pop } repeat } loop } loop (,) 0 get ne { (Not a GIF image.\n) print stop } if dup read2 /Left exch def dup read2 /Top exch def dup read2 /Width exch def dup read2 /Height exch def dup read1 dup 128 ge /LocalColor exch def dup 64 and 0 ne /Interlaced exch def LocalColor { 7 and 1 add /BitsPerPixel exch def 1 BitsPerPixel bitshift 3 mul string readstring pop /Palette exch def } { pop pop /Palette GlobalPalette def } ifelse currentdict end } bind def /imageGIF % <imagedict> imageGIF { /ImageOut where { pop % We know BitsPerComponent = 8, Decode = [0 255]. % and there is only a single data source which is % either a filter or a string whose size is exactly % the width of the row. dup /DataSource get dup type /stringtype eq { ImageOut exch writestring } { pop dup /Width get string 1 index /Height get { 1 index /DataSource get 1 index readstring pop ImageOut exch writestring } repeat pop pop } ifelse } { image } ifelse } bind def /viewGIF % <file|string> viewGIF - { save 20 dict begin /saved exch def dup type /stringtype eq { (r) file } if /F exch def /ImageOutFile where { /ImageOut ImageOutFile (w) file def } if 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 VGIFDEBUG { ImageHeader { exch == == } forall (----------------\n) print flush } if /D F << /InitialCodeLength F read1 /FirstBitLowOrder true /BlockData true /EarlyChange 0 >> /LZWDecode filter def [/Indexed /DeviceRGB 1 BitsPerPixel bitshift 1 sub Palette] setcolorspace matrix currentmatrix 0 1 3 { 2 copy get dup 0 ne { dup abs div } if 3 copy put pop pop } for setmatrix << /ImageType 1 /ImageMatrix [1 0 0 -1 0 Height] /BitsPerComponent 8 /Decode [0 255] Interlaced { /Width Width /Height 1 /row Width string def /DataSource row >> /I exch def /inter % <num> <denom> inter - { /denom exch def /num exch def gsave /lines Height denom 1 sub add num sub denom idiv def 0 1 lines 1 sub { Height exch denom mul num add sub I /ImageMatrix get 5 3 -1 roll put D row readstring pop pop I imageGIF } for grestore } bind def 0 8 inter 4 8 inter 2 4 inter 1 2 inter } { /Width Width /Height Height /DataSource D >> imageGIF } 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
[-] rollconv.ps
[edit]
[-] acctest.ps
[edit]
[-] bjc610b7.upp
[edit]
[-] viewps2a.ps
[edit]
[-] ras3.upp
[edit]
[-] stc1520h.upp
[edit]
[-] stc800p.upp
[edit]
[-] PM820p.upp
[edit]
[-] st640ih.upp
[edit]
[-] stc_l.upp
[edit]
[-] bj8gc12f.upp
[edit]
[-] bj8oh06n.upp
[edit]
[-] viewmiff.ps
[edit]
[-] docie.ps
[edit]
[-] viewgif.ps
[edit]
[-] gs_wl2_e.ps
[edit]
[-] printafm.ps
[edit]
[-] Stp720p.upp
[edit]
[-] st640plg.upp
[edit]
[-] sipixa6.upp
[edit]
[-] lines.ps
[edit]
[-] caption.ps
[edit]
[-] bjc610a0.upp
[edit]
[-] cbjc600.ppd
[edit]
[-] pphs.ps
[edit]
[-] bjc6000a1.upp
[edit]
[-] dnj750m.upp
[edit]
[-] cdj690ec.upp
[edit]
[-] viewpbm.ps
[edit]
[-] Stp720pl.upp
[edit]
[-] cdj550.upp
[edit]
[-] Stc670p.upp
[edit]
[+]
..
[-] gs_il2_e.ps
[edit]
[-] ras24.upp
[edit]
[-] gs_t.xpm
[edit]
[-] bjc610b6.upp
[edit]
[-] stocht.ps
[edit]
[-] viewpcx.ps
[edit]
[-] gs_l_m.xbm
[edit]
[-] gs_s.xbm
[edit]
[-] image-qa.ps
[edit]
[-] landscap.ps
[edit]
[-] dmp_site.ps
[edit]
[-] bjc610a4.upp
[edit]
[-] necp2x.upp
[edit]
[-] align.ps
[edit]
[-] ps2epsi.ps
[edit]
[-] gslp.ps
[edit]
[-] stc740ih.upp
[edit]
[-] bj8.rpd
[edit]
[-] gs_ce_e.ps
[edit]
[-] st640ihg.upp
[edit]
[-] ghostpdf.ppd
[edit]
[-] stc600ih.upp
[edit]
[-] Stc680pl.upp
[edit]
[-] stc.upp
[edit]
[-] stcany_h.upp
[edit]
[-] gs_t_m.xbm
[edit]
[-] stcinfo.ps
[edit]
[-] gs_wl5_e.ps
[edit]
[-] stc500ph.upp
[edit]
[-] gs_wl1_e.ps
[edit]
[-] stc300bl.upp
[edit]
[-] gs_l.xpm
[edit]
[-] ras32.upp
[edit]
[-] winmaps.ps
[edit]
[-] stc500p.upp
[edit]
[-] bjc6000b1.upp
[edit]
[-] mkcidfm.ps
[edit]
[-] pdf2dsc.ps
[edit]
[-] bjc610b8.upp
[edit]
[-] pf2afm.ps
[edit]
[-] s400b1.upp
[edit]
[-] traceimg.ps
[edit]
[-] traceop.ps
[edit]
[-] Stc760pl.upp
[edit]
[-] stc300bm.upp
[edit]
[-] st640pg.upp
[edit]
[-] stc600p.upp
[edit]
[-] st640p.upp
[edit]
[-] Stc777p.upp
[edit]
[-] uninfo.ps
[edit]
[-] ps2ai.ps
[edit]
[-] gs_l.xbm
[edit]
[-] bjc610a2.upp
[edit]
[-] gs_t.xbm
[edit]
[-] bj8hg12f.upp
[edit]
[-] Stp870pl.upp
[edit]
[-] prfont.ps
[edit]
[-] bj8pa06n.upp
[edit]
[-] gs_lgo_e.ps
[edit]
[-] gs_ksb_e.ps
[edit]
[-] stc800pl.upp
[edit]
[-] gs_kanji.ps
[edit]
[-] font2pcl.ps
[edit]
[-] Stc740p.upp
[edit]
[-] stc200_h.upp
[edit]
[-] bjc610a8.upp
[edit]
[-] viewjpeg.ps
[edit]
[-] pfbtopfa.ps
[edit]
[-] bjc610b2.upp
[edit]
[-] necp2x6.upp
[edit]
[-] gs_s.xpm
[edit]
[-] jispaper.ps
[edit]
[-] ppath.ps
[edit]
[-] ras4.upp
[edit]
[-] bjc610a1.upp
[edit]
[-] Stc777pl.upp
[edit]
[-] Stc760p.upp
[edit]
[-] stc300.upp
[edit]
[-] stcany.upp
[edit]
[-] gs_s_m.xbm
[edit]
[-] stc_h.upp
[edit]
[-] ras8m.upp
[edit]
[-] bjc610a6.upp
[edit]
[-] gs_m_m.xbm
[edit]
[-] gs_m.xpm
[edit]
[-] stc600pl.upp
[edit]
[-] stc2s_h.upp
[edit]
[-] bjc610a7.upp
[edit]
[-] PM820pl.upp
[edit]
[-] cid2code.ps
[edit]
[-] bjc610a5.upp
[edit]
[-] stc640p.upp
[edit]
[-] ht_ccsto.ps
[edit]
[-] cdj690.upp
[edit]
[-] st640pl.upp
[edit]
[-] PDFX_def.ps
[edit]
[-] bjc610a3.upp
[edit]
[-] zeroline.ps
[edit]
[-] dmp_init.ps
[edit]
[-] Stc680p.upp
[edit]
[-] PM760p.upp
[edit]
[-] bjc610b3.upp
[edit]
[-] PM760pl.upp
[edit]
[-] sharp.upp
[edit]
[-] stc2_h.upp
[edit]
[-] bj8ts06n.upp
[edit]
[-] stc800ih.upp
[edit]
[-] bjc610b4.upp
[edit]
[-] dnj750c.upp
[edit]
[-] bj8pp12f.upp
[edit]
[-] stc2.upp
[edit]
[-] s400a1.upp
[edit]
[-] bjc610b1.upp
[edit]
[-] viewcmyk.ps
[edit]
[-] PDFA_def.ps
[edit]
[-] cbjc800.ppd
[edit]
[-] ras1.upp
[edit]
[-] gs_lgx_e.ps
[edit]
[-] Stp870p.upp
[edit]
[-] escp_24.src
[edit]
[-] stcolor.ps
[edit]
[-] Stc740pl.upp
[edit]
[-] gs_m.xbm
[edit]
[-] Stc670pl.upp
[edit]
[-] gsnup.ps
[edit]