[metadata] EXIF data on .avi files #76

Closed
opened 2026-10-04 23:42:38 +02:00 by adam · 3 comments
Owner

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

**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&#039;ve installed charlie&#039;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&#039;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 // &gt; prevent .avi to read for exif if (strncmp(substr(strtolower($filename),-4),&quot;.jpg&quot;,4) == 0) { // &lt; prevent .avi to read for exif if ($exif = @read_exif_data($filename)) { foreach ($map as $key =&gt; $field) { if (strpos($field, &#039;;&#039;) === false) { if (isset($exif[$field])) { $result[$key] = $exif[$field]; } } else { $tokens = explode(&#039;;&#039;, $field); if (isset($exif[$tokens[0]][$tokens[1]])) { $result[$key] = $exif[$tokens[0]][$tokens[1]]; } } } } // &gt; prevent .avi to read for exif } // &lt; prevent .avi to read for exif [Piwigo Bugtracker #917](http://piwigo.org/bugs/view.php?id=917) <!-- github-sync-id:97225582 -->
adam closed this issue 2026-10-04 23:42:38 +02:00
Author
Owner

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 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&#039;t you have the same error when you switch on metadata display on picture.php? <!-- github-comment-id:124891478 -->
Author
Owner

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&#039;ve tried on a .3gp video. My url looks like : /photos/picture.php?/18687/category/1123&amp;metadata but in the code of the file you mention, there is : if ($exif = @read_exif_data($picture[&#039;current&#039;][&#039;image_path&#039;])) I did not check but the $picture may restrict to picture files no ? <!-- github-comment-id:124891510 -->
Author
Owner

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.

**Comment posted by plg on 27 Jan 2009 21:50** manuel_flury wrote: &gt; I did not check but the $picture may restrict to picture files no ? no. <!-- github-comment-id:124891516 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#76