how to extract camera related information from image

╄→尐↘猪︶ㄣ 提交于 2019-12-08 06:03:40

问题


How can I extract camera related information (eg. camera model, date taken etc) from an image stored in the database? For example, I resized an image and uploaded it and saved its path in database. I want to display basic camera information while displaying the image, therefore I want to extract the information. Thanks.


回答1:


You want to read the EXIF data. For PHP, use exif_read_data. Sample:

<?php
$exif = exif_read_data('img.jpg');
$model = $exif['Model'];
$iso = $exif['ISOSpeedRatings'];
$taken = $exif['DateTime'];



回答2:


What is the image type? What language are you using?

Assuming, for example, you're talking about JPG images then what you're probably trying to do is read the EXIF data from the file. If you're using, for example, Java then there are various libraries such as this one to help you.

Google will uncover many, many more depending on your language/environment.




回答3:


What you want to obtain is the EXIF data.

Take a look here for some suggestions about libraries/etc...

http://en.wikipedia.org/wiki/Exchangeable_image_file_format#Program_support

PHP has an EXIF library: http://php.net/manual/en/book.exif.php



来源:https://stackoverflow.com/questions/4485119/how-to-extract-camera-related-information-from-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!