| 41 | | $output = $this->getDirectory() . |
| 42 | | DIRECTORY_SEPARATOR . "$slug.$width.$height.$resizeType.$format"; |
| | 41 | // EDITED FOR ARBITRARY CROPPING |
| | 42 | $cropLeft = $request->getParameter('cropLeft'); |
| | 43 | $cropTop = $request->getParameter('cropTop'); |
| | 44 | $cropWidth = $request->getParameter('cropWidth'); |
| | 45 | $cropHeight = $request->getParameter('cropHeight'); |
| | 46 | |
| | 47 | if (!is_null($cropWidth) && !is_null($cropHeight) && !is_null($cropLeft) && !is_null($cropTop)) |
| | 48 | { |
| | 49 | $cropLeft = ceil($cropLeft + 0); |
| | 50 | $cropTop = ceil($cropTop + 0); |
| | 51 | $cropWidth = ceil($cropWidth + 0); |
| | 52 | $cropHeight = ceil($cropHeight + 0); |
| | 53 | // Explicit cropping always preempts any automatic cropping, so there's no difference between c and s, |
| | 54 | // and only the cropOriginal method actually supports cropping parameters, so |
| | 55 | $resizeType = 'c'; |
| | 56 | |
| | 57 | $output = $this->getDirectory() . |
| | 58 | DIRECTORY_SEPARATOR . "$slug.$cropLeft.$cropTop.$cropWidth.$cropHeight.$width.$height.$resizeType.$format"; |
| | 59 | } |
| | 60 | else |
| | 61 | { |
| | 62 | $cropLeft = null; |
| | 63 | $cropTop = null; |
| | 64 | $cropWidth = null; |
| | 65 | $cropHeight = null; |
| | 66 | $output = $this->getDirectory() . |
| | 67 | DIRECTORY_SEPARATOR . "$slug.$width.$height.$resizeType.$format"; |
| | 68 | } |
| | 69 | |