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 = '')
161
161
$ pImgFile = substr ($ pFile , strpos ($ pFile , '# ' ) + 1 );
162
162
$ oArchive = new \ZipArchive ();
163
163
$ 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
+ }
165
170
} else {
166
171
$ image = getimagesize ($ pFile );
167
172
}
Original file line number Diff line number Diff line change @@ -180,7 +180,12 @@ private function getImageMimeType($pFile = '')
180
180
$ pImgFile = substr ($ pFile , strpos ($ pFile , '# ' ) + 1 );
181
181
$ oArchive = new \ZipArchive ();
182
182
$ 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
+ }
184
189
} else {
185
190
if (!File::fileExists ($ pFile )) {
186
191
throw new \Exception ("File $ pFile does not exist " );
You can’t perform that action at this time.
0 commit comments