Tag: exif

如何在Rails应用程序中使用mini_magick获取EXIF关键字?

我正在尝试为具有EXIF“关键字”属性值的图像提取EXIF信息。 我已经使用mini_magick成功读取了EXIF信息,只需打开图像并使用: image[“EXIF:Model”] 出于某种原因,以下所有内容都不会返回我知道的图像的关键字: image[“EXIF:Keywords”] image[“EXIF:XPKeywords”] image[“EXIF:Subject”] 我已使用此实用程序确认相关图像确实包含此信息: http : //regex.info/exif.cgi mini_magick只能访问某些EXIF值吗? 看起来很奇怪,我可以访问某些EXIF信息但不能访问其他信息。

exif图像旋转问题使用carrierwave和rmagick上传到s3

我的rails应用程序中有一个照片上传function。 该应用程序通过rmagick和雾直接通过carrierwave上传到s3。 我遇到的问题是通过手机上的“拍照选项”上传照片时(注意这是iphone,但我相信Android有同样的问题)。 上传后,图像在手机上显示正常,但在桌面上查看时,图像会旋转90度。 通过我的研究,它看起来是exif的一个问题。 此stackoverflow响应程序概述了2个可能的解决方案。 这个要点也看起来很有希望。 到目前为止,我发现了一些解决方案,但没有一个有效。 理想情况下,我希望将照片作为肖像保存到s3,然后按原样显示图像。 任何建议都很受欢迎。 以下是我的代码 应用程序/上传/ image_uploader.rb class ImageUploader < CarrierWave::Uploader::Base include CarrierWaveDirect::Uploader include CarrierWave::RMagick # Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility: include Sprockets::Helpers::RailsHelper include Sprockets::Helpers::IsolatedHelper include CarrierWave::MimeTypes process :fix_exif_rotation process :set_content_type version :thumb do process resize_to_fill: [200, 200] end def extension_white_list %w(jpg jpeg png) […]