Add mutation options for the update API (rotate, greyscale, etc) #484

Open
jmathai opened this Issue Feb 1, 2012 · 5 comments

2 participants

@jmathai
Trovebox Community Edition member

I'm not sure if there are other mutations we want to make to photos but we should have an API for them all. Seems to make sense to add this functionality to the /photo/:id/update.json and /photos/update.json APIs. We won't touch the original but the mutations are applied to the base version of the photo which all other versions are generated from.

We should add these parameters

  1. mutations, a comma delimited string of mutations (i.e. mutations=rotate(90),greyscale)

Steps to verify

  1. Pass mutations into the update APIs
  2. Validate that the proper method is called from the Photo model to perform the mutations
@mattdm

Please make sure to make any JPEG rotations lossless where possible.

@jmathai
Trovebox Community Edition member
@mattdm

If the exif rotation information is wrong (sometimes happens with weird angles), there's no reason a second rotation couldn't be lossless (unless the image is also cropped to an odd not-multiple-of-8 size, which is unlikely).

@jmathai
Trovebox Community Edition member
@jmathai
Trovebox Community Edition member

Added lossless jpeg rotation and should implement lossy rotation if exiftran is not available on the system. Leaving open for that feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment