Prawn pdf在Table Cell中旋转图像

时间:2015-09-04 13:40:20

标签: ruby-on-rails ruby ruby-on-rails-4 rubygems prawn

如何使用prawn旋转表格单元格内的图像。

images.each_with_index do |image,index|
      my_image = {:image => open("#{image.authenticated_url}"), image_width: 220}
        row += [my_image]
        table([row], :cell_style => {:border_width => 0, :rotate => 90, :rotate_around => :center})
end

1 个答案:

答案 0 :(得分:0)

我的问题是,当我用ipad / iphone拍照时,prawn根据exif数据不会自动旋转图像。 我试图在大虾中旋转图像,它没有用,但现在我只是在将图像上传到S3(aws服务器)之前删除这些exif数据

...
has_attached_file :image,
                    :storage => :s3,
                    :styles => { :original => ''},
...

这最后一行只是覆盖:原始样式与另一个没有它的exif数据

相关问题