Sha256: 87da76eca124abeb8a610ec44655cda88c398f76afa24384a8d5b1956b713249

Contents?: true

Size: 471 Bytes

Versions: 14

Compression:

Stored size: 471 Bytes

Contents

module Pageflow
  module LinkmapPage
    module PaperclipProcessors
      class ImageDimensions < Paperclip::Processor
        def make
          store_dimensions(file)
          file
        end

        private

        def store_dimensions(file)
          geometry = Paperclip::Geometry.from_file(file)

          attachment.instance_write('width', geometry.width)
          attachment.instance_write('height', geometry.height)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pageflow-linkmap-page-2.10.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.9.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.8.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.7.1 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.7.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.6.1 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.6.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.5.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.4.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.3.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.2.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-1.5.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.1.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb
pageflow-linkmap-page-2.0.0 lib/pageflow/linkmap_page/paperclip_processors/image_dimensions.rb