mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
REFACTOR: upload workflow creation into UploadCreator
- Automatically convert large-ish PNG/BMP to JPEG - Updated fast_image to latest version
This commit is contained in:
@ -201,7 +201,7 @@ EOM
|
||||
file.write(picture["filedata"].encode("ASCII-8BIT").force_encoding("UTF-8"))
|
||||
file.rewind
|
||||
|
||||
upload = Upload.create_for(imported_user.id, file, picture["filename"], file.size)
|
||||
upload = UploadCreator.new(file, picture["filename"]).create_for(imported_user.id)
|
||||
|
||||
return if !upload.persisted?
|
||||
|
||||
@ -231,7 +231,7 @@ EOM
|
||||
file.write(background["filedata"].encode("ASCII-8BIT").force_encoding("UTF-8"))
|
||||
file.rewind
|
||||
|
||||
upload = Upload.create_for(imported_user.id, file, background["filename"], file.size)
|
||||
upload = UploadCreator.new(file, background["filename"]).create_for(imported_user.id)
|
||||
|
||||
return if !upload.persisted?
|
||||
|
||||
|
Reference in New Issue
Block a user