| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 45 | public function save(string $outputFile) : string |
||
| 46 | { |
||
| 47 | $sourceFileName = pathinfo($this->sourceFile, PATHINFO_BASENAME); |
||
| 48 | |||
| 49 | $cacheDir = sys_get_temp_dir(); |
||
| 50 | |||
| 51 | $glideServer = ServerFactory::create([ |
||
| 52 | 'source' => dirname($this->sourceFile), |
||
| 53 | 'cache' => $cacheDir, |
||
| 54 | 'driver' => config('laravel-glide.driver'), |
||
| 55 | ]); |
||
| 56 | |||
| 57 | $conversionResult = $cacheDir.'/'.$glideServer->makeImage($sourceFileName, $this->modificationParameters); |
||
| 58 | |||
| 59 | rename($conversionResult, $outputFile); |
||
| 60 | |||
| 61 | return $outputFile; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |