1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class Attachment_thumbnailAction extends AttachmentAction
- {
- protected $thumb_w = null;
- protected $thumb_h = null;
- protected $thumb_c = null;
- protected function doPreparation()
- {
- parent::doPreparation();
- $this->thumb_w = $this->int('w');
- $this->thumb_h = $this->int('h');
- $this->thumb_c = $this->boolean('c');
- }
- public function showPage()
- {
-
- try {
- $thumbnail = $this->attachment->getThumbnail($this->thumb_w, $this->thumb_h, $this->thumb_c);
- } catch (UseFileAsThumbnailException $e) {
- common_redirect($e->file->getUrl());
- }
- common_redirect($thumbnail->getUrl());
- }
- }
|