Close
The obvious cautions apply: test in a sandbox first, back up your database, etc. I'd suggest glancing over the code to sanity check it, too; this is the first time I've used Ruby.

Installation:

make -C lib/danbooru_image_resizer
RAILS_ENV=xxx rake db:add_sample_columns
mkdir public/data/sample

Create sample images:

RAILS_ENV=xxx nice rake sample_images:create_missing

This will take a long time; until a sample exists for an image, it'll fall back on the full image. You can stop and restart this and it'll pick up where it left off. If you change CONFIG["sample_XXX"] settings, run sample_images:update_outdated.

Users can turn this off with "Show Image Samples" in settings. It defaults on.

A "High resolution" link is added to post/show. Clicking it switches the view to high-res; it also links to the file, so save-as, copy-location, etc. work.

All images are resized; PNG files can be fairly large, even at wallpaper resolution. It might be a waste for smaller images, but those are uncommon on moe, so I didn't want to complicate the code for it yet.

The resolution can be tweaked. The default height of 1000 already targets 1920x1200, so I wouldn't go any higher. I think 300k is a good target file size.

Only LocalFlat and LocalHierarchy stores are tested. RemoteHierarchy partially tested, don't have anything to try warehousing with.