File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/PhpPresentation/Writer Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,12 @@ private function getImageMimeType($pFile = '')
161161 $ pImgFile = substr ($ pFile , strpos ($ pFile , '# ' ) + 1 );
162162 $ oArchive = new \ZipArchive ();
163163 $ oArchive ->open ($ pZIPFile );
164- $ image = getimagesizefromstring ($ oArchive ->getFromName ($ pImgFile ));
164+ if (!function_exists ('getimagesizefromstring ' )) {
165+ $ uri = 'data://application/octet-stream;base64, ' . base64_encode ($ oArchive ->getFromName ($ pImgFile ));
166+ $ image = getimagesize ($ uri );
167+ } else {
168+ $ image = getimagesizefromstring ($ oArchive ->getFromName ($ pImgFile ));
169+ }
165170 } else {
166171 $ image = getimagesize ($ pFile );
167172 }
Original file line number Diff line number Diff line change @@ -180,7 +180,12 @@ private function getImageMimeType($pFile = '')
180180 $ pImgFile = substr ($ pFile , strpos ($ pFile , '# ' ) + 1 );
181181 $ oArchive = new \ZipArchive ();
182182 $ oArchive ->open ($ pZIPFile );
183- $ image = getimagesizefromstring ($ oArchive ->getFromName ($ pImgFile ));
183+ if (!function_exists ('getimagesizefromstring ' )) {
184+ $ uri = 'data://application/octet-stream;base64, ' . base64_encode ($ oArchive ->getFromName ($ pImgFile ));
185+ $ image = getimagesize ($ uri );
186+ } else {
187+ $ image = getimagesizefromstring ($ oArchive ->getFromName ($ pImgFile ));
188+ }
184189 } else {
185190 if (!File::fileExists ($ pFile )) {
186191 throw new \Exception ("File $ pFile does not exist " );
You can’t perform that action at this time.
0 commit comments