最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Figure out with which device was a picture taken from - Is it possible? - Stack Overflow

programmeradmin3浏览0评论

This might seem a bit odd to ask, but I couldn't get an answer through Google - maybe because I wasn't using the correct keywords, but is there a way to find out (either through javascript, jQuery, PHP or any other way) from what device a picture was taken (For example: via webcam or phone or camera etc)?

I'm not sure if this is the right place to ask this question, but please excuse if I'm at the wrong place.

Thanks in advance.

This might seem a bit odd to ask, but I couldn't get an answer through Google - maybe because I wasn't using the correct keywords, but is there a way to find out (either through javascript, jQuery, PHP or any other way) from what device a picture was taken (For example: via webcam or phone or camera etc)?

I'm not sure if this is the right place to ask this question, but please excuse if I'm at the wrong place.

Thanks in advance.

Share Improve this question asked Oct 3, 2012 at 9:55 asprinasprin 9,84312 gold badges70 silver badges125 bronze badges 2
  • What information are you starting with? Just the photo file? – ColBeseder Commented Oct 3, 2012 at 9:57
  • I'm using flash to capture a screenshot. – asprin Commented Oct 3, 2012 at 9:58
Add a ment  | 

3 Answers 3

Reset to default 6

You can use exif_read_data

$exif = exif_read_data('a.jpg');
var_dump($exif);

Please note that the Device information is not always available

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

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

The above is from the following stackoverflow post by Alexn

https://www.php/manual/en/function.exif-read-data.php

But that will only work for JPEG or TIFF according to the documentation.

PS: Javascript or JQuery? JQuery is Javascript (sort of).

发布评论

评论列表(0)

  1. 暂无评论