empowerhack / DrawMyLife-Service

API and Admin system for the Draw My Life initiative - Volunteers: check README and GitHub Projects to get started.
https://github.com/empowerhack/DrawMyLife-Service/projects
MIT License
13 stars 0 forks source link

Add thumb size to paperclip image styles #67

Closed krissy closed 8 years ago

krissy commented 8 years ago

What this does

Adds a centre-cropped square thumbnail of 100x100 dimensions to Paperclip's image upload styles. This means we'll have a set of: original, medium, thumb.

Dev notes

These sizes can be called with drawing.image.url(:thumb).

To regenerate all images that aren't already existing locally, run the rake task:

rake paperclip:refresh:missing_styles (might have to prefix with bundle exec.

These will generate a thumb folder per image where your local images are stored, i.e. in public/system/... and in equivalent S3 folders on live.

Best read-up for more background here: https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation

krissy commented 8 years ago

cc @tanyapowell