Skip to content

Commit

Permalink
(3.41) Fixed error when no filename is specified nor available in the…
Browse files Browse the repository at this point in the history
… exported figure (issue #381)
  • Loading branch information
altmany committed Nov 29, 2023
1 parent 47ab1f9 commit a665328
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
% 15/05/23: (3.38) Fixed endless recursion when using export_fig in Live Scripts (issue #375); don't warn about exportgraphics/copygraphics alternatives in deployed mode
% 30/05/23: (3.39) Fixed exported bgcolor of uifigures or figures in Live Scripts (issue #377)
% 06/07/23: (3.40) For Tiff compression, use AdobeDeflate codec (if available) instead of Deflate (issue #379)
% 29/11/23: (3.41) Fixed error when no filename is specified nor available in the exported figure (issue #381)
%}

if nargout
Expand Down Expand Up @@ -424,7 +425,7 @@
[fig, options] = parse_args(nargout, fig, argNames, varargin{:});

% Check for newer version and exportgraphics/copygraphics compatibility
currentVersion = 3.40;
currentVersion = 3.41;
if options.version % export_fig's version requested - return it and bail out
imageData = currentVersion;
return
Expand Down Expand Up @@ -2086,6 +2087,7 @@ function notify(filename)
% Use the figure's FileName property as the default export filename
if isempty(options.name)
options.name = get(ancestor(fig(1),'figure'),'FileName'); %fix issue #372
options.name = char(options.name); %fix issue #381
options.name = regexprep(options.name,'[*?"<>|]+','-'); %remove illegal filename chars, but not folder seperators!
if isempty(options.name)
% No FileName property specified for the figure, use 'export_fig_out'
Expand Down

0 comments on commit a665328

Please sign in to comment.