Allow uploads of images up to 8000x8000 but shrink to 2000x2000
This commit is contained in:
parent
3116fb6b4d
commit
aca9df2910
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
class ImageUploader < Shrine
|
class ImageUploader < Shrine
|
||||||
ALLOWED_TYPES = %w[image/jpeg image/png image/webp]
|
ALLOWED_TYPES = %w[image/jpeg image/png image/webp]
|
||||||
MAX_SIZE = 5*1024*1024 # 5 MB
|
MAX_SIZE = 5*1024*1024 # 5 MB
|
||||||
MAX_DIMENSIONS = [4000, 4000] # 2000x2000
|
MAX_DIMENSIONS = [8000, 8000] # larger than 2000x2000 will be resized
|
||||||
|
|
||||||
plugin :remove_attachment
|
plugin :remove_attachment
|
||||||
plugin :pretty_location
|
plugin :pretty_location
|
||||||
|
|
@ -29,7 +29,7 @@ class ImageUploader < Shrine
|
||||||
thumb: magick.resize_to_limit!(160,120),
|
thumb: magick.resize_to_limit!(160,120),
|
||||||
small: magick.resize_to_limit!(320, 240),
|
small: magick.resize_to_limit!(320, 240),
|
||||||
#medium: magick.resize_to_limit!(800, 600),
|
#medium: magick.resize_to_limit!(800, 600),
|
||||||
large: magick.composite!('public/logo/watermark.png', gravity: 'east')
|
large: magick.resize_to_limit(2000,2000).composite!('public/logo/watermark.png', gravity: 'east')
|
||||||
}
|
}
|
||||||
# GenerateThumbnail.call(original, width, height) # lib/generate_thumbnail.rb
|
# GenerateThumbnail.call(original, width, height) # lib/generate_thumbnail.rb
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue