discourse/discourse — pull request #709 by ZogStriP (2013-04-14 23:08:34+00:00)
Title: automatically resize images

This pull request adds support for **automatically** resizing (ie. reducing) images when cooking a post.

**Note:** this uses `image_sorcery`, a wrapper aroung `Image Magick`, to create thumbnails of every images posted.

Uploaded images are *always* resized whereas images linked within a post are *only* resized when the `crawl_images?` site setting is enabled.

Cached images (ie. the ones that are downloaded from the links provided in posts) are stored in: `#{public_dir}/downloads/#{RailsMultisite::ConnectionManagement.current_db}` and are named after the first 16 characters of the SHA1 of their link.

Optimized images are stored & served from: `#{public_dir}/images/#{RailsMultisite::ConnectionManagement.current_db}`

I'll be writing the tests once this feature is validated by the core team :wink: