note 10427 added to read_exif_data
| From: | inq at inq dot dhs dot org | Date: | Wed, 03 Jan 2001 08:52:34 +0000 |
| Subject: | note 10427 added to read_exif_data | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9329@lists.php.net to get a copy of this message | ||
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).
http://www.php.net/manual/function.read-exif-data.php