zoukankan      html  css  js  c++  java
  • 如何用 php 从 .jpg 图像中读取 exif

    简介:这是如何用 php 从 .jpg 图像中读取 exif的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

    class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=324412' scrolling='no'> read_exif_data
    (PHP 4 )

    read_exif_data -- Reads header information stored in TIFF and JPEG images
    Description
    array exif_read_data ( string filename, string sections, bool arrays, bool thumbnail)


    Note: The read_exif_data() function is an alias for exif_read_data().

    See also exif_thumbnail().

    User Contributed Notes
    read_exif_data
    inq@inq.dhs.org
    03-Jan-2001 03:52

    Each of my jpeg files are over 1 meg, and read_exif_data seems to read the
    whole file and it's very slow. So I wrote a function to read only the
    beginning of each file:

    function read_exif_data_quick($path) {
    $tmpfile = "/tmp/read_exif_data_quick.tmp_file";
    $in = fopen($path, "r");
    $out = fopen($tmpfile,"w");
    fwrite( $out, fread( $in, 15000 ) );
    fclose($in);
    fclose($out);
    return read_exif_data($tmpfile);
    }

    And so far it works for all of my jpegs (taken with my digital camera).



    garbage@sunflowerroad.com
    06-Jul-2001 05:33

    I started drooling when I saw that php could read the exif information
    automatically for me. Then I found out that read_exif_data is NOT
    compiled into the standard win32 build (think about including it please!).
    To get around this I found the following program that runs from the
    command line and works really well.
    it's actually a set of utilities that will even allow you to put exif data
    into images.

    It's freeware, but the license says no commercial use without written
    permission.


    http://www.users.bigpond.com/hughthomas/exif.html



    garbage@sunflowerroad.com
    06-Jul-2001 05:34

    By the way, it works under linux or win32



    ibaldin@anr.mcnc.org
    21-Aug-2001 11:43

    Perl Image::Info module is capable of reading EXIF tags (places them into
    an associative array). You can write a simple script to use the module and
    it will extract all or only required tags out of a jpeg file.



    peter@mf.lu.se
    12-Sep-2001 07:54

    This is a slight modification of the example1 script at the top. It works
    at least with Canon Digital Ixus and writes out the thumbnail as a picture
    instead of the code.

    $adress="IMG_XXX.JPG";
    $exif = read_exif_data ($adress);
    while(list($k,$v)=each($exif)) {
    if($k=="Thumbnail"){
    $fp=fopen ("/www/home/image/Thumbnail$adress",
    'a');
    fwrite ($fp, $v);
    fclose ($fp);
    echo "<br />\n";
    echo "\n";
    echo "<br />\n";
    }else{
    echo "$k: $v<br />\n";
    }
    }

    “如何用 php 从 .jpg 图像中读取 exif”的更多相关文章 》

    爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

    http://biancheng.dnbcw.info/php/324412.html pageNo:15
  • 相关阅读:
    2.HTML案例二 头条页面
    1.HTML入门
    33.1.网络编程入门
    32.原子性
    【转】风控中的特征评价指标(一)——IV和WOE
    【转】Python调用C语言动态链接库
    基于蒙特卡洛树搜索(MCTS)的多维可加性指标的异常根因定位
    正则表达式全集
    基于ray的分布式机器学习(二)
    基于ray的分布式机器学习(一)
  • 原文地址:https://www.cnblogs.com/ooooo/p/2254945.html
Copyright © 2011-2022 走看看