Image previews: add nsfw variant
commitbfa5230fa834dbc4d5d0a6529b6997467bab2305
authorxiongchiamiov <xiong.chiamiov@gmail.com>
Thu, 21 May 2015 19:00:49 +0000 (21 12:00 -0700)
committerxiongchiamiov <xiong.chiamiov@gmail.com>
Tue, 26 May 2015 18:47:57 +0000 (26 11:47 -0700)
tree5a1fecb9772b3b1bb46aca400e3f248c787c66c0
parent0702bc4886fb358c1f8af47e5d7df63493265d68
Image previews: add nsfw variant

We'd like to be able to show some sort of preview for NSFW images, rather than
just a placeholder image.  Thanks to imgix, it's easy for us to create
pixellated versions of the preview images for app developers to display.

We went back and forth a bit on whether a NSFW image should have the censored
version in the main image block (with the uncensored version as a variant), or
have the censored version be the variant.  We settled on the latter because an
app that doesn't build in NSFW link support will perhaps just shock a few
users, as opposed to preventing NSFW-seeking users from obtaining the content
they want.  It's also less of a backwards-compatibility change.
r2/r2/lib/jsontemplates.py
r2/r2/lib/providers/image_resizing/__init__.py
r2/r2/lib/providers/image_resizing/imgix.py
r2/r2/lib/providers/image_resizing/no_op.py
r2/r2/lib/providers/image_resizing/unsplashit.py
r2/r2/tests/unit/lib/providers/image_resizing/imgix_test.py