I have a need to upload some files that are not in a file format supported by getid3, unfortunately getid3 spits out an ugly error to the user because an exception is thrown when the file is analyzed.

This really should be caught by the module and better handled in drupal, for my application if there is no id3 information then these fields should be able to be left blank.

I have marked this issue under version 5.x.1.1 as that is what I am using but I just checked the 6.x code and it noticed this isn't handled there as well.

The simple fix I have come up with is shown below

/**
 * Analyze file and return its media information.
 */
function &getid3_analyze($path) {
  $info = array();
  if($id3 = &getid3_instance()) {
    try {
        $info = $id3-> analyze($path);
    } catch (getid3_exception $e) {
        // you could do something here with the error, maybe saved in drupal's error log
    }
    unset($id3);
  }
  return $info;
}

Comments

drewish’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Status: Active » Needs work

if this is a problem in 6.x we need to fix it there and then back port a fix.