how to extract camera related information from ima

2019-06-04 05:01发布

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.

3条回答
聊天终结者
2楼-- · 2019-06-04 05:22

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'];
查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-06-04 05:35

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

查看更多
神经病院院长
4楼-- · 2019-06-04 05:40

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.

查看更多
登录 后发表回答