note 10427 deleted from function.read-exif-data by sniper
| From: | sniper@php.net | Date: | Sun, 19 Oct 2003 08:07:02 +0000 |
| Subject: | note 10427 deleted from function.read-exif-data by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58872@lists.php.net to get a copy of this message | ||
Note Submitter: inq@inq.dhs.org
----
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).