How to retrieve EXIF information of an image in Rails

后端 未结 4 1053
囚心锁ツ
囚心锁ツ 2021-02-12 12:23

I am using Rails paperclip for displaying the images in my page. I want to know how to retrieve EXIF information of an image(like dimensions, camera model,height,width., etc).Ca

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 12:28

    after_photo_post_process :copy_exif_data 
      private 
      def copy_exif_data 
        exif =EXIFR::JPEG.new(photo.queued_for_write[:original]) 
        self.exif_value = exif
      end 
    

    This is working code which i am used.

提交回复
热议问题