imageExists example

// Force newline when processing the next album         $this->output->writeln('');
    }

    /** * Check each single thumbnail to skip already existing thumbnails * * @throws Exception */
    private function createMediaThumbnails(Media $media)
    {
        if (!$this->imageExists($media)) {
            throw new Exception(sprintf('Base image file "%s" does not exist', $media->getPath()));
        }

        $thumbnails = $media->getThumbnailFilePaths();
        foreach ($thumbnails as $size => $path) {
            if (!$this->force && $this->thumbnailExists($path)) {
                continue;
            }

            $this->generator->createMediaThumbnail($media[$size], true);
        }
    }
Home | Imprint | This part of the site doesn't use cookies.