comparison scripts/plot/private/__tight_eps_bbox__.m @ 11589:b0084095098e

missing semicolons in script files
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 18:26:09 -0500
parents c792872f8942
children 72c96de7a403
comparison
equal deleted inserted replaced
11588:d5bd2766c640 11589:b0084095098e
33 33
34 if (status == 0) 34 if (status == 0)
35 orig_bbox_line = get_bbox (output); 35 orig_bbox_line = get_bbox (output);
36 else 36 else
37 error ("print:noboundingbox", 37 error ("print:noboundingbox",
38 "print.m: no bounding box found in '%s'", eps_file_name) 38 "print.m: no bounding box found in '%s'", eps_file_name);
39 endif 39 endif
40 40
41 ghostscript_options = "-q -dBATCH -dSAFER -dNOPAUSE -dTextAlphaBits=4 -sDEVICE=bbox"; 41 ghostscript_options = "-q -dBATCH -dSAFER -dNOPAUSE -dTextAlphaBits=4 -sDEVICE=bbox";
42 cmd = sprintf ("\"%s\" %s \"%s\" 2>&1", opts.ghostscript.binary, 42 cmd = sprintf ("\"%s\" %s \"%s\" 2>&1", opts.ghostscript.binary,
43 ghostscript_options, eps_file_name); 43 ghostscript_options, eps_file_name);
46 if (status == 0) 46 if (status == 0)
47 tight_bbox_line = get_bbox (output); 47 tight_bbox_line = get_bbox (output);
48 else 48 else
49 warning ("print:nogsboundingbox", 49 warning ("print:nogsboundingbox",
50 "print.m: ghostscript failed to determine the bounding for '%s'", 50 "print.m: ghostscript failed to determine the bounding for '%s'",
51 eps_file_name) 51 eps_file_name);
52 endif 52 endif
53 53
54 ## Attempt to fix the bbox in place. 54 ## Attempt to fix the bbox in place.
55 fid = fopen (eps_file_name, "r+"); 55 fid = fopen (eps_file_name, "r+");
56 unwind_protect 56 unwind_protect
94 if (numel (n) > 1) 94 if (numel (n) > 1)
95 ## Only replace one instance. 95 ## Only replace one instance.
96 n = n(1); 96 n = n(1);
97 elseif (isempty (n)) 97 elseif (isempty (n))
98 error ("print:noboundingbox", ... 98 error ("print:noboundingbox", ...
99 "print.m: no bounding box found in '%s'.", eps_file_name) 99 "print.m: no bounding box found in '%s'.", eps_file_name);
100 endif 100 endif
101 m = numel (orig_bbox_line); 101 m = numel (orig_bbox_line);
102 data = horzcat (data(1:(n-1)), tight_bbox_line, data((n+m):end)); 102 data = horzcat (data(1:(n-1)), tight_bbox_line, data((n+m):end));
103 fid = fopen (eps_file_name, "w"); 103 fid = fopen (eps_file_name, "w");
104 unwind_protect 104 unwind_protect