From 6150ae1c788348d3a8450a721af1f21cbacd6bf4 Mon Sep 17 00:00:00 2001
From: Qianqian Fang <fangqq@gmail.com>
Date: Thu, 10 Feb 2022 18:16:36 -0500
Subject: [PATCH] handle uncompressed raw data (only base64 encoded) in
 jdatadecode

---
 jdatadecode.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jdatadecode.m b/jdatadecode.m
index 1310938..026d2cb 100644
--- a/jdatadecode.m
+++ b/jdatadecode.m
@@ -123,7 +123,7 @@ function newdata=jdatadecode(data,varargin)
             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;
@@ -131,7 +131,7 @@ function newdata=jdatadecode(data,varargin)
                     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);
-- 
GitLab