Class: Pageflow::ImageFile
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Pageflow::ImageFile
- Defined in:
- app/models/pageflow/image_file.rb
Instance Method Summary collapse
-
#attachment_default_url ⇒ Object
UploadableFile-overrides ->.
- #attachment_styles(attachment) ⇒ Object
-
#attachments_path_name ⇒ Object
used in paperclip initializer to interpolate the storage path needs to be “processed_attachments” for images for legacy reasons.
- #original_url ⇒ Object
- #panorama_url ⇒ Object
- #thumbnail_url(*args) ⇒ Object
- #url ⇒ Object
Methods included from ImageAndTextTrackProcessingStateMachine
#failed?, #ready?, #retry!, #retryable?
Methods included from UploadableFile
#attachment, #attachment=, #attachments_for_export, #basename, #can_upload?, #direct_upload_config, #failed?, #publish!, #ready?, #retryable?
Methods included from ReusableFile
#attachments_for_export, #basename, #cache_key, #can_upload?, #failed?, #file_name, #file_type, #nested_files, #parent_allows_type_for_nesting, #parent_belongs_to_same_entry, #publish!, #ready?, #retry!, #retryable?
Instance Method Details
#attachment_default_url ⇒ Object
UploadableFile-overrides ->
30 31 32 |
# File 'app/models/pageflow/image_file.rb', line 30 def ':pageflow_placeholder' end |
#attachment_styles(attachment) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/models/pageflow/image_file.rb', line 34 def () panorama_format = File.extname(.original_filename) == '.png' ? :PNG : :JPG Pageflow .config.thumbnail_styles .merge( print: {geometry: '300x300>', format: :JPG, convert_options: '-quality 10 -interlace Plane'}, medium: {geometry: '1024x1024>', format: :JPG, convert_options: '-quality 70 -interlace Plane'}, large: {geometry: '1920x1920>', format: :JPG, convert_options: '-quality 70 -interlace Plane'}, ultra: {geometry: '3840x3840>', format: :JPG, convert_options: '-quality 90 -interlace Plane'}, panorama_medium: {geometry: '1024x1024^', format: panorama_format, convert_options: '-quality 90 -interlace Plane'}, panorama_large: {geometry: '1920x1080^', format: panorama_format, convert_options: '-quality 90 -interlace Plane'} ) end |
#attachments_path_name ⇒ Object
used in paperclip initializer to interpolate the storage path needs to be “processed_attachments” for images for legacy reasons
8 9 10 |
# File 'app/models/pageflow/image_file.rb', line 8 def 'processed_attachments' end |
#original_url ⇒ Object
21 22 23 |
# File 'app/models/pageflow/image_file.rb', line 21 def original_url .url if ready? end |
#panorama_url ⇒ Object
25 26 27 |
# File 'app/models/pageflow/image_file.rb', line 25 def panorama_url .url(:panorama_large) if ready? end |
#thumbnail_url(*args) ⇒ Object
14 15 16 17 18 19 |
# File 'app/models/pageflow/image_file.rb', line 14 def thumbnail_url(*args) unless ready? return Pageflow::PaperclipInterpolations::Support.pageflow_placeholder(, *args) end .url(*args) end |
#url ⇒ Object
61 62 63 |
# File 'app/models/pageflow/image_file.rb', line 61 def url .url(:large) if ready? end |