Skip to content

Commit

Permalink
Alert if ghostscript.m is required but not found on Matlab path
Browse files Browse the repository at this point in the history
  • Loading branch information
altmany committed Mar 22, 2020
1 parent 2c3359e commit 49b5bb4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions print2array.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
% 07/07/15: Fixed issue #83: use numeric handles in HG1
% 11/12/16: Fixed cropping issue reported by Harry D.
% 29/09/18: Fixed issue #254: error in print2array>read_tif_img
% 22/03/20: Alert if ghostscript.m is required but not found on Matlab path
%}

% Generate default input arguments, if needed
Expand Down Expand Up @@ -109,6 +110,10 @@
[A, err, ex] = read_tif_img(fig, res_str, renderer, tmp_nam);
if err, rethrow(ex); end
catch % error - try to print to EPS and then using Ghostscript to TIF
% Ensure that ghostscript() exists on the Matlab path
if ~exist('ghostscript','file') && isempty(which('ghostscript'))
error('export_fig:print2array:ghostscript', 'The ghostscript.m function is required by print2array.m. Install the complete export_fig package from https://www.mathworks.com/matlabcentral/fileexchange/23629-export_fig or https://github.com/altmany/export_fig')
end
% Print to eps file
if isTempDirOk
tmp_eps = [tempname '.eps'];
Expand Down

0 comments on commit 49b5bb4

Please sign in to comment.