Skip to content

Commit a665328

Browse files
committed
(3.41) Fixed error when no filename is specified nor available in the exported figure (issue #381)
1 parent 47ab1f9 commit a665328

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

export_fig.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@
387387
% 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
388388
% 30/05/23: (3.39) Fixed exported bgcolor of uifigures or figures in Live Scripts (issue #377)
389389
% 06/07/23: (3.40) For Tiff compression, use AdobeDeflate codec (if available) instead of Deflate (issue #379)
390+
% 29/11/23: (3.41) Fixed error when no filename is specified nor available in the exported figure (issue #381)
390391
%}
391392

392393
if nargout
@@ -424,7 +425,7 @@
424425
[fig, options] = parse_args(nargout, fig, argNames, varargin{:});
425426

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

0 commit comments

Comments
 (0)