Skip to content

Instantly share code, notes, and snippets.

@richardtifelt
Created August 27, 2012 09:35
Show Gist options
  • Save richardtifelt/3486960 to your computer and use it in GitHub Desktop.
Save richardtifelt/3486960 to your computer and use it in GitHub Desktop.
Cloudinary::Migrator.new(
db_file: "tmp/cloudinary_resource_images.db",
threads: 1,
retrieve: ->(id) {
resource = Resource.find(id)
if (resource.size || resource.image.size) > 19.megabytes
file = open(resource.image.url)
`convert #{file.path} -quality 85 jpg:-`
else
resource.url
end
},
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment