Skip to content

Commit

Permalink
handle uncompressed raw data (only base64 encoded) in jdatadecode
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Feb 10, 2022
1 parent 7e5e0ed commit 6150ae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jdatadecode.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@
if(isfield(data,N_('_ArrayZipType_')))
zipmethod=data(j).(N_('_ArrayZipType_'));
end
if(ismember(zipmethod,{'zlib','gzip','lzma','lzip','lz4','lz4hc'}))
if(ismember(zipmethod,{'zlib','gzip','lzma','lzip','lz4','lz4hc','base64'}))
decompfun=str2func([zipmethod 'decode']);
arraytype=data(j).(N_('_ArrayType_'));
chartype=0;
if(strcmp(arraytype,'char') || strcmp(arraytype,'logical'))
chartype=1;
arraytype='uint8';
end
if(needbase64)
if(needbase64 && strcmp(zipmethod,'base64')==0)
ndata=reshape(typecast(decompfun(base64decode(data(j).(N_('_ArrayZipData_')))),arraytype),dims);
else
ndata=reshape(typecast(decompfun(data(j).(N_('_ArrayZipData_'))),arraytype),dims);
Expand Down

0 comments on commit 6150ae1

Please sign in to comment.