SHRINE DEPRECATION WARNING: Width of the uploaded file is nil, and Shrine skipped the validation. In Shrine 3 the validation will fail if width is nil.
Shrine.plugin :activerecordShrine.plugin :logging, logger: Rails.loggerShrine.plugin :cached_attachment_dataShrine.plugin :validation_helpersShrine.plugin :remove_attachmentShrine.plugin :presign_endpointShrine.plugin :backgroundingmodule Uploaders class ImageUploader < Shrine include ImageProcessing::MiniMagick
plugin :determine_mime_type plugin :store_dimensions, analyzer: :mini_magick plugin :pretty_location plugin :default_url plugin :default_url_options, store: { public: true }, cache: { public: true }
plugin :processing plugin :versions
Attacher.validate do validate_max_size 2.megabyte, message: 'is too large (max is 2 MB)' if validate_mime_type_inclusion ['image/jpg', 'image/jpeg', 'image/png'] validate_min_width 800 end end
Attacher.promote { |data| ShrineWorkers::ShrinePromoteWorker.perform_async(data) } Attacher.delete { |data| ShrineWorkers::ShrineDeleteWorker.perform_async(data) }
process(:store) do |io, context| if context[:action] == :store { original: io, scaled: ImageProcessing::MiniMagick.resize_to_limit!(io.download, 800, nil), icon: ImageProcessing::MiniMagick.resize_and_pad(io.download, 120, 120), } end end
endend
--
You received this message because you are subscribed to the Google Groups "Shrine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-shrine+unsubscribe@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-shrine/9bc91a7c-8052-4ffe-8972-2bacf091fa5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.