this function ($exif = @read_exif_data($filename)) runs on .avi files for some reason (I've installed charlie's content plugin to be able to have video in pwg)
Steps to reproduce: I just synchronized exif data with the standard tool and when it encounters .avi file it crashes
Additional information: I've added a simple test to prevent this error to happen and only have exif data for .jpg files (which is perfect for me) :
// Read EXIF data
// > prevent .avi to read for exif
if (strncmp(substr(strtolower($filename),-4),".jpg",4) == 0)
{
// < prevent .avi to read for exif
if ($exif = @read_exif_data($filename))
{
foreach ($map as $key => $field)
{
if (strpos($field, ';') === false)
{
if (isset($exif[$field]))
{
$result[$key] = $exif[$field];
}
}
else
{
$tokens = explode(';', $field);
if (isset($exif[$tokens[0]][$tokens[1]]))
{
$result[$key] = $exif[$tokens[0]][$tokens[1]];
}
}
}
}
// > prevent .avi to read for exif
}
// < prevent .avi to read for exif
**Reported by manuel_flury on 25 Jan 2009 19:02**
**Version:** 1.7.3
In the file :
// | branch : BSF (Best So Far)
// | file : $Id: functions_metadata.inc.php 1900 2007-03-12 22:33:53Z rub $
// | last update : $Date: 2007-03-12 23:33:53 +0100 (Mon, 12 Mar 2007) $
// | last modifier : $Author: rub $
// | revision : $Revision: 1900 $
this function ($exif = @read_exif_data($filename)) runs on .avi files for some reason (I've installed charlie's content plugin to be able to have video in pwg)
**Steps to reproduce:** I just synchronized exif data with the standard tool and when it encounters .avi file it crashes
**Additional information:** I've added a simple test to prevent this error to happen and only have exif data for .jpg files (which is perfect for me) :
// Read EXIF data
// > prevent .avi to read for exif
if (strncmp(substr(strtolower($filename),-4),".jpg",4) == 0)
{
// < prevent .avi to read for exif
if ($exif = @read_exif_data($filename))
{
foreach ($map as $key => $field)
{
if (strpos($field, ';') === false)
{
if (isset($exif[$field]))
{
$result[$key] = $exif[$field];
}
}
else
{
$tokens = explode(';', $field);
if (isset($exif[$tokens[0]][$tokens[1]]))
{
$result[$key] = $exif[$tokens[0]][$tokens[1]];
}
}
}
}
// > prevent .avi to read for exif
}
// < prevent .avi to read for exif
[Piwigo Bugtracker #917](http://piwigo.org/bugs/view.php?id=917)
<!-- github-sync-id:97225582 -->
The function read_exif_data is also called from include/picture_metadata.inc.php (included by picture.php), don't you have the same error when you switch on metadata display on picture.php?
**Comment posted by plg on 25 Jan 2009 20:18**
The function read_exif_data is also called from include/picture_metadata.inc.php (included by picture.php), don't you have the same error when you switch on metadata display on picture.php?
<!-- github-comment-id:124891478 -->
Comment posted by manuel_flury on 25 Jan 2009 20:27
No, it seems to work perfectly, I've tried on a .3gp video.
My url looks like :
/photos/picture.php?/18687/category/1123&metadata
but in the code of the file you mention, there is :
if ($exif = @read_exif_data($picture['current']['image_path']))
I did not check but the $picture may restrict to picture files no ?
**Comment posted by manuel_flury on 25 Jan 2009 20:27**
No, it seems to work perfectly, I've tried on a .3gp video.
My url looks like :
/photos/picture.php?/18687/category/1123&metadata
but in the code of the file you mention, there is :
if ($exif = @read_exif_data($picture['current']['image_path']))
I did not check but the $picture may restrict to picture files no ?
<!-- github-comment-id:124891510 -->
> I did not check but the $picture may restrict to picture files no ?
no.
**Comment posted by plg on 27 Jan 2009 21:50**
manuel_flury wrote:
> I did not check but the $picture may restrict to picture files no ?
no.
<!-- github-comment-id:124891516 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reported by manuel_flury on 25 Jan 2009 19:02
Version: 1.7.3
In the file :
// | branch : BSF (Best So Far)
// | file :
Id: functions_metadata.inc.php 1900 2007-03-12 22:33:53Z rub// | last update :
Date: 2007-03-12 23:33:53 +0100 (Mon, 12 Mar 2007)// | last modifier :
Author: rub// | revision :
Revision: 1900this function ($exif = @read_exif_data($filename)) runs on .avi files for some reason (I've installed charlie's content plugin to be able to have video in pwg)
Steps to reproduce: I just synchronized exif data with the standard tool and when it encounters .avi file it crashes
Additional information: I've added a simple test to prevent this error to happen and only have exif data for .jpg files (which is perfect for me) :
// Read EXIF data
// > prevent .avi to read for exif
if (strncmp(substr(strtolower($filename),-4),".jpg",4) == 0)
{
// < prevent .avi to read for exif
if ($exif = @read_exif_data($filename))
{
foreach ($map as $key => $field)
{
if (strpos($field, ';') === false)
{
if (isset($exif[$field]))
{
$result[$key] = $exif[$field];
}
}
else
{
$tokens = explode(';', $field);
if (isset($exif[$tokens[0]][$tokens[1]]))
{
$result[$key] = $exif[$tokens[0]][$tokens[1]];
}
}
}
}
// > prevent .avi to read for exif
}
// < prevent .avi to read for exif
Piwigo Bugtracker #917
Comment posted by plg on 25 Jan 2009 20:18
The function read_exif_data is also called from include/picture_metadata.inc.php (included by picture.php), don't you have the same error when you switch on metadata display on picture.php?
Comment posted by manuel_flury on 25 Jan 2009 20:27
No, it seems to work perfectly, I've tried on a .3gp video.
My url looks like :
/photos/picture.php?/18687/category/1123&metadata
but in the code of the file you mention, there is :
if ($exif = @read_exif_data($picture['current']['image_path']))
I did not check but the $picture may restrict to picture files no ?
Comment posted by plg on 27 Jan 2009 21:50
manuel_flury wrote:
> I did not check but the $picture may restrict to picture files no ?
no.