mirror of
https://github.com/discourse/discourse.git
synced 2025-09-08 12:06:51 +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:
parent
a5c4ddd334
commit
9641d2413d
27 changed files with 391 additions and 483 deletions
|
@ -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?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue