/** * 미디어에서 사진 추출 * * @param Media $media image instance * @return string 이미지 content * @throws WrongInstanceException */ public function getPicture(Media $media) { if (!$media instanceof Image) { throw new WrongInstanceException(); } return $media->getContent(); }
/** * 동적으로 생성된 미디어 파일 반환 * * @param Media $media media instance * @return Collection|Media[] */ public function getDerives(Media $media) { $files = $media->getRawDerives(); foreach ($files as $key => $file) { $files[$key] = $this->is($file) ? $this->make($file) : null; } return $files->filter(); }
/** * 미디어에서 사진 추출 * * @param Media $media media instance * @return null|string 이미지 content * @throws WrongInstanceException */ public function getPicture(Media $media) { if (!$media instanceof Video) { throw new WrongInstanceException(); } $snapshot = $this->extension->getSnapshot($media->getContent(), $this->fromSecond); return $snapshot; }