rake: fix images:manifest task to handle corrupted files.
This commit is contained in:
@@ -20,6 +20,16 @@ namespace :images do
|
||||
h: file.height,
|
||||
}
|
||||
|
||||
puts hash.to_json
|
||||
rescue StandardError => e
|
||||
hash = {
|
||||
path: File.absolute_path(path),
|
||||
name: File.basename(path, ".*"),
|
||||
md5: file.md5,
|
||||
size: file.file_size,
|
||||
error: e.message,
|
||||
}
|
||||
|
||||
puts hash.to_json
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user