Skip to content

Commit

Permalink
Minor fix to the commit for issue altmany#179 from 2 days ago, based …
Browse files Browse the repository at this point in the history
…on Abbie K's comment
  • Loading branch information
altmany committed Dec 13, 2016
1 parent fd80d71 commit b028120
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
% 17/05/16: Fixed case of image YData containing more than 2 elements (issue #151)
% 08/08/16: Enabled exporting transparency to TIF, in addition to PNG/PDF (issue #168)
% 11/12/16: Added alert in case of error creating output PDF/EPS file (issue #179)
% 13/12/16: Minor fix to the commit for issue #179 from 2 days ago
%}

if nargout
Expand Down Expand Up @@ -656,7 +657,11 @@
eps2pdf(tmp_nam, pdf_nam_tmp, 1, options.append, options.colourspace==2, options.quality, options.gs_options);
% Ghostscript croaks on % chars in the output PDF file, so use tempname and then rename the file
try
movefile(pdf_nam_tmp, pdf_nam, 'f');
% Rename the file (except if it is already the same)
% Abbie K's comment on the commit for issue #179 (#commitcomment-20173476)
if ~isequal(pdf_nam_tmp, pdf_nam)
movefile(pdf_nam_tmp, pdf_nam, 'f');
end
catch
% Alert in case of error creating output PDF/EPS file (issue #179)
if exist(pdf_nam_tmp, 'file')
Expand Down

0 comments on commit b028120

Please sign in to comment.