summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/lib/viewjpeg.ps
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlgs/lib/viewjpeg.ps')
-rw-r--r--Master/tlpkg/tlgs/lib/viewjpeg.ps76
1 files changed, 38 insertions, 38 deletions
diff --git a/Master/tlpkg/tlgs/lib/viewjpeg.ps b/Master/tlpkg/tlgs/lib/viewjpeg.ps
index 9ba1b61f9a6..7de234015eb 100644
--- a/Master/tlpkg/tlgs/lib/viewjpeg.ps
+++ b/Master/tlpkg/tlgs/lib/viewjpeg.ps
@@ -2,18 +2,18 @@
%
% 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.
-%
+%
% 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.
-% $Id: viewjpeg.ps 6300 2005-12-28 19:56:24Z giles $
+% $Id$
% View JPEG files with Ghostscript
%
% This PostScript code relies on level 2 features.
@@ -30,7 +30,7 @@
% pstack exec quit | voice +49/89/29160728
% ------------------------------+ tm@muc.de http://www.muc.de/~tm/
%
-% $Id: viewjpeg.ps 6300 2005-12-28 19:56:24Z giles $
+% $Id$
% Updated by L. Peter Deutsch 20-May-1997:
% move the usage example to the beginning
% Updates by Tom Lane 6-Sep-1995
@@ -58,7 +58,7 @@ JPEGdict begin
% read one byte from file F
% - ==> int --or-- stop context
-/NextByte {
+/NextByte {
F read not { (Read error in ViewJPEG!\n) print flush stop } if
} bind def
@@ -72,38 +72,38 @@ JPEGdict begin
5 dict begin
{ % loop: read JPEG marker segments until we find SOFn marker or EOF
- NextByte
- 16#FF eq { % found marker
- /markertype NextByte def
- % Is it S0F0=baseline, SOF1=extended sequential, SOF2=progressive ?
- markertype dup 16#C0 ge exch 16#C2 le and {
- NextByte pop NextByte pop % segment length
- % Ghostscript and Adobe PS accept only data precision 8
- NextByte 8 ne {
- (Error: not 8 bits per component!\n) print flush stop
- } if
-
- % Read crucial image parameters
- /height NextByte 8 bitshift NextByte add def
- /width NextByte 8 bitshift NextByte add def
- /colors NextByte def
-
- VJPGDEBUG { currentdict { exch == == } forall flush } if
- exit
- } if
-
- % detect several segment types which are not compatible with PS
- NotSupportedMarkers {
- markertype eq {
- (Marker ) print markertype ==
- (not supported!\n) print flush stop
- } if
- } forall
-
- % Skip segment if marker has parameters associated with it
- true NoParamMarkers { markertype eq {pop false exit} if } forall
- { SkipSegment } if
- } if
+ NextByte
+ 16#FF eq { % found marker
+ /markertype NextByte def
+ % Is it S0F0=baseline, SOF1=extended sequential, SOF2=progressive ?
+ markertype dup 16#C0 ge exch 16#C2 le and {
+ NextByte pop NextByte pop % segment length
+ % Ghostscript and Adobe PS accept only data precision 8
+ NextByte 8 ne {
+ (Error: not 8 bits per component!\n) print flush stop
+ } if
+
+ % Read crucial image parameters
+ /height NextByte 8 bitshift NextByte add def
+ /width NextByte 8 bitshift NextByte add def
+ /colors NextByte def
+
+ VJPGDEBUG { currentdict { exch == == } forall flush } if
+ exit
+ } if
+
+ % detect several segment types which are not compatible with PS
+ NotSupportedMarkers {
+ markertype eq {
+ (Marker ) print markertype ==
+ (not supported!\n) print flush stop
+ } if
+ } forall
+
+ % Skip segment if marker has parameters associated with it
+ true NoParamMarkers { markertype eq {pop false exit} if } forall
+ { SkipSegment } if
+ } if
} loop
currentdict dup /markertype undef
@@ -114,7 +114,7 @@ end % JPEGdict
% read image parameters from JPEG file and display the image
/viewJPEG { % <file|string> ==> -
- save
+ save
JPEGdict begin
/saved exch def
/scratch 1 string def