From: [EMAIL PROTECTED] Operating system: FreeBSD 4.6-RELEASE PHP version: 4.3.0RC2 PHP Bug Type: *Graphics related Bug description: Failure of the storing Exif tag data elemens after the 2nd
ext/exif/exif.c: In exif_iif_add_value() , since the increment of value pointer is not appropriately performed, when length is larger than 1, the elements after 2nd are overwritten by 1st element. ex) GPS.GPSLatitude if the real value of GPSLatitude is "36/1 43859/1000 0/1", $exif = exif_read_data('filename',0,true); $lad = $exif["GPS"]["GPSLatitude"][0]; $lam = $exif["GPS"]["GPSLatitude"][1]; $las = $exif["GPS"]["GPSLatitude"][2]; "$lad,$lam,$las" has to be "36/1 43859/1000 0/1". But, it is set to "36/1 36/1 36/1" in the present. adhoc patch --- ext/exif/exif.c.orig Mon Dec 9 22:01:12 2002 +++ ext/exif/exif.c Mon Dec 9 22:03:10 2002 @@ -1520,6 +1520,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t len gth, void* value, int motorola_intel TSRMLS_DC) { size_t index; + void *vptr; image_info_value *info_value; image_info_data *info_data; image_info_data *list; @@ -1604,35 +1605,36 @@ } else { info_value = &info_data->value; } - for (index=0; index<length; index++) { + /**************/ + for (index=0,vptr=value; index<length; index++, vptr+=php_tiff_bytes_per_format[format]) { if (length>1) { info_value = &info_data->value.list[index]; } switch (format) { case TAG_FMT_USHORT: - info_value->u = php_ifd_get16u(value, motorola_intel); + info_value->u = php_ifd_get16u(vptr, motorola_intel); break; case TAG_FMT_ULONG: - info_value->u = php_ifd_get32u(value, motorola_intel); + info_value->u = php_ifd_get32u(vptr, motorola_intel); break; case TAG_FMT_URATIONAL: - info_value->ur.num = php_ifd_get32u(value, motorola_intel); - info_value->ur.den = php_ifd_get32u(4+(char *)value, motorola_intel); + info_value->ur.num = php_ifd_get32u(vptr, motorola_intel); + info_value->ur.den = php_ifd_get32u(4+(char *)vptr, motorola_intel); break; case TAG_FMT_SSHORT: - info_value->i = php_ifd_get16s(value, motorola_intel); + info_value->i = php_ifd_get16s(vptr, motorola_intel); break; case TAG_FMT_SLONG: - info_value->i = php_ifd_get32s(value, motorola_intel); + info_value->i = php_ifd_get32s(vptr, motorola_intel); break; case TAG_FMT_SRATIONAL: - info_value->sr.num = php_ifd_get32u(value, motorola_intel); - info_value->sr.den = php_ifd_get32u(4+(char *)value, motorola_intel); + info_value->sr.num = php_ifd_get32u(vptr, motorola_intel); + info_value->sr.den = php_ifd_get32u(4+(char *)vptr, motorola_intel); break; case TAG_FMT_SINGLE: -- Edit bug report at http://bugs.php.net/?id=20907&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=20907&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=20907&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=20907&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=20907&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=20907&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=20907&r=support Expected behavior: http://bugs.php.net/fix.php?id=20907&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=20907&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=20907&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=20907&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20907&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=20907&r=dst IIS Stability: http://bugs.php.net/fix.php?id=20907&r=isapi