Skip to content

Download sample images for image objects that exists in databases (from dumps) but not on disk.

Notifications You must be signed in to change notification settings

PixNyb/silverstripe-picsum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silverstripe Picsum

This module provides a simple way to load images for an existing database dump. It uses the Lorem Picsum API to fetch images.

Installation

composer require pixnyb/silverstripe-picsum --dev

Usage

After importing your database dump, you can run the following task to fetch images for all instances of the image class. It will store the images in the assets directory in local storage.

sake dev/tasks/download-sample-images

Configuration

You can configure the assets directory in order to comply with custom configurations, use prefetching and set the prefetching limit.

Below are the default configuration values:

PixNyb\Picsum\Tasks\DownloadSampleImageTask:
  assets_directory: 'assets'
  prefetch: true
  prefetch_limit: 10

Note

The prefetching feature will remove the need to download a new image for each instance of the image class. It will download a set number of images and reuse them for all instances. This does mean that the images won't be unique, but it will speed up the task significantly.

About

Download sample images for image objects that exists in databases (from dumps) but not on disk.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages