App\Transformers\ContestEntryTransformer::includeArtMeta PHP Method

includeArtMeta() public method

    public function includeArtMeta(ContestEntry $entry)
    {
        if ($entry->contest->type !== 'art' || !presence($entry->entry_url)) {
            return $this->item($entry, function ($entry) {
                return [];
            });
        }
        return $this->item($entry, function ($entry) {
            $size = fast_imagesize($entry->entry_url);
            return ['width' => $size[0], 'height' => $size[1]];
        });
    }