File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -321,14 +321,18 @@ private function renderImageDownloadTool(): void
321321 private function getFile (int $ page , array $ fileGrps ): array
322322 {
323323 $ file = [];
324+ $ physicalStructureInfo = $ this ->currentDocument ->physicalStructureInfo [$ this ->currentDocument ->physicalStructure [$ page ]] ?? null ;
324325 while ($ fileGrp = @array_pop ($ fileGrps )) {
325- $ physicalStructureInfo = $ this ->currentDocument ->physicalStructureInfo [$ this ->currentDocument ->physicalStructure [$ page ]];
326- $ fileId = $ physicalStructureInfo ['files ' ][$ fileGrp ];
327- if (!empty ($ fileId )) {
328- $ file ['url ' ] = $ this ->currentDocument ->getDownloadLocation ($ fileId );
329- $ file ['mimetype ' ] = $ this ->currentDocument ->getFileMimeType ($ fileId );
326+ if (isset ($ physicalStructureInfo ['files ' ][$ fileGrp ])) {
327+ $ fileId = $ physicalStructureInfo ['files ' ][$ fileGrp ];
328+ if (!empty ($ fileId )) {
329+ $ file ['url ' ] = $ this ->currentDocument ->getDownloadLocation ($ fileId );
330+ $ file ['mimetype ' ] = $ this ->currentDocument ->getFileMimeType ($ fileId );
331+ } else {
332+ $ this ->logger ->warning ('File not found in fileGrp " ' . $ fileGrp . '" ' );
333+ }
330334 } else {
331- $ this ->logger ->warning ('File not found in fileGrp " ' . $ fileGrp . '" ' );
335+ $ this ->logger ->warning ('fileGrp " ' . $ fileGrp . '" not found in Document mets:fileSec ' );
332336 }
333337 }
334338 return $ file ;
You can’t perform that action at this time.
0 commit comments