add image cropping support

This commit is contained in:
Albert Yi
2018-05-16 17:13:36 -07:00
parent df73c682db
commit 64446d49e1
20 changed files with 150 additions and 471 deletions

View File

@@ -5,6 +5,7 @@ class StorageManager::Local < StorageManager
temp_path = dest_path + "-" + SecureRandom.uuid + ".tmp"
FileUtils.mkdir_p(File.dirname(temp_path))
io.rewind
bytes_copied = IO.copy_stream(io, temp_path)
raise Error, "store failed: #{bytes_copied}/#{io.size} bytes copied" if bytes_copied != io.size