Require GD for saving images in xls
GD is implicitly required for saving images anyway, this exception when it's not loaded simply gives more information on what to do if the execution flow reaches a places that depends on a function from GD.
This commit is contained in:
		
							parent
							
								
									408da0c17a
								
							
						
					
					
						commit
						1df5f97a5b
					
				| @ -454,6 +454,9 @@ class Xls extends BaseWriter implements IWriter | |||||||
|         // the BSE's (all the images)
 |         // the BSE's (all the images)
 | ||||||
|         foreach ($this->spreadsheet->getAllsheets() as $sheet) { |         foreach ($this->spreadsheet->getAllsheets() as $sheet) { | ||||||
|             foreach ($sheet->getDrawingCollection() as $drawing) { |             foreach ($sheet->getDrawingCollection() as $drawing) { | ||||||
|  |                 if (!extension_loaded('gd')) { | ||||||
|  |                     throw new \RuntimeException('Saving images in xls requires gd extension'); | ||||||
|  |                 } | ||||||
|                 if ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing) { |                 if ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing) { | ||||||
|                     $filename = $drawing->getPath(); |                     $filename = $drawing->getPath(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Alexander Kurilo
						Alexander Kurilo