Skip to content

Commit

Permalink
(3.37) Fixed run-time error with old Matlab releases (issue #374); -n…
Browse files Browse the repository at this point in the history
…otify console message about exported image now displays black (STDOUT) not red (STDERR)
  • Loading branch information
altmany committed Apr 23, 2023
1 parent 6e3e426 commit 293f808
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions export_fig.m
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
% 23/03/23: (3.34) Fixed error when exporting axes handle to clipboard without filename (issue #372)
% 11/04/23: (3.35) Added -n,-x,-s options to set min, max, and fixed output image size (issue #315)
% 13/04/23: (3.36) Reduced (hopefully fixed) unintended EPS/PDF image cropping (issues #97, #318); clarified warning in case of PDF/EPS export of transparent patches (issues #94, #106, #108)
% 23/04/23: (3.37) Fixed run-time error with old Matlab releases (issue #374); -notify console message about exported image now displays black (STDOUT) not red (STDERR)
%}

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

% Check for newer version and exportgraphics/copygraphics compatibility
currentVersion = 3.36;
currentVersion = 3.37;
if options.version % export_fig's version requested - return it and bail out
imageData = currentVersion;
return
Expand Down Expand Up @@ -804,7 +805,7 @@
% Change alpha from [0:255] uint8 => [0:1] single from here onward:
alpha = single(alpha) / 255;
% Clamp the image's min/max size (if specified)
sz = size(A,1:2);
sz = size(A); sz(3:end) = []; %sz=size(A,1:2); %issue #374 & X. Xu PM
szNew = options.min_size;
if numel(szNew) == 2
szNew(isinf(szNew)) = 0;
Expand Down Expand Up @@ -1618,7 +1619,7 @@

% Notify user about a successful file export
function notify(filename)
fprintf(2, 'Exported screenshot image to %s\n', filename)
fprintf('Exported screenshot image to %s\n', filename)
exported_files = exported_files + 1;
end
end
Expand Down

0 comments on commit 293f808

Please sign in to comment.