Skip to content

Instantly share code, notes, and snippets.

View lukejohnjones's full-sized avatar

Luke Jones lukejohnjones

View GitHub Profile
@lukejohnjones
lukejohnjones / parse_thumbnail
Created November 4, 2014 05:45
Parse.com thumbnail creation retaining aspect ratio
var Image = require("parse-image");
Parse.Cloud.beforeSave("_User", function(request, response) {
var user = request.object;
if (!user.get("profilePhoto")) {
response.error("Users must have a profile photo.");
return;
}
if (!user.dirty("profilePhoto")) {