From 19218d758d4fc0f8f5db5a97eb9dcfdb5086f844 Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Sat, 25 Feb 2023 19:06:54 +0100 Subject: Remove path from repo Add start script --- api/export.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'api/export.php') diff --git a/api/export.php b/api/export.php index 77e36a2..625283e 100644 --- a/api/export.php +++ b/api/export.php @@ -1,6 +1,6 @@ setCellValue('A' . $row, $d["name"]); - $drawing = new Drawing(); - $drawing->setName($d["name"]); - $drawing->setPath("../imgs/" . $d["thumbnail"]); - $drawing->setHeight(200); - - $comment = $active_sheet->getComment('A' . $row); - $comment->setBackgroundImage($drawing); - $comment->setSizeAsBackgroundImage(); - + $path = "%PWD%imgs/" . $d["thumbnail"]; + if(file_exists($path)) { + $drawing = new Drawing(); + $drawing->setName($d["name"]); + $drawing->setPath($path); + $drawing->setHeight(200); + + $comment = $active_sheet->getComment('A' . $row); + $comment->setBackgroundImage($drawing); + $comment->setSizeAsBackgroundImage(); + } $active_sheet->setCellValue('B' . $row, $d["author"]); $active_sheet->setCellValue('C' . $row, $d["magazine"]); -- cgit v1.3.1