Skip to content
Snippets Groups Projects
Commit 6150ae1c authored by Qianqian Fang's avatar Qianqian Fang
Browse files

handle uncompressed raw data (only base64 encoded) in jdatadecode

parent 7e5e0ed6
Branches
No related tags found
No related merge requests found
...@@ -123,7 +123,7 @@ function newdata=jdatadecode(data,varargin) ...@@ -123,7 +123,7 @@ function newdata=jdatadecode(data,varargin)
if(isfield(data,N_('_ArrayZipType_'))) if(isfield(data,N_('_ArrayZipType_')))
zipmethod=data(j).(N_('_ArrayZipType_')); zipmethod=data(j).(N_('_ArrayZipType_'));
end end
if(ismember(zipmethod,{'zlib','gzip','lzma','lzip','lz4','lz4hc'})) if(ismember(zipmethod,{'zlib','gzip','lzma','lzip','lz4','lz4hc','base64'}))
decompfun=str2func([zipmethod 'decode']); decompfun=str2func([zipmethod 'decode']);
arraytype=data(j).(N_('_ArrayType_')); arraytype=data(j).(N_('_ArrayType_'));
chartype=0; chartype=0;
...@@ -131,7 +131,7 @@ function newdata=jdatadecode(data,varargin) ...@@ -131,7 +131,7 @@ function newdata=jdatadecode(data,varargin)
chartype=1; chartype=1;
arraytype='uint8'; arraytype='uint8';
end end
if(needbase64) if(needbase64 && strcmp(zipmethod,'base64')==0)
ndata=reshape(typecast(decompfun(base64decode(data(j).(N_('_ArrayZipData_')))),arraytype),dims); ndata=reshape(typecast(decompfun(base64decode(data(j).(N_('_ArrayZipData_')))),arraytype),dims);
else else
ndata=reshape(typecast(decompfun(data(j).(N_('_ArrayZipData_'))),arraytype),dims); ndata=reshape(typecast(decompfun(data(j).(N_('_ArrayZipData_'))),arraytype),dims);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment