Remove mplayer, delegate technical read to MediaVorus

This commit is contained in:
Romain Neutron
2012-05-04 16:29:05 +02:00
parent ad59dbcb36
commit 516008d84d
20 changed files with 494 additions and 713 deletions

View File

@@ -454,7 +454,6 @@ class API_V1_adapter extends API_V1_Abstract
'unoconv' => $registry->get('GV_unoconv'),
'ffmpeg' => $registry->get('GV_ffmpeg'),
'mp4box' => $registry->get('GV_mp4box'),
'mplayer' => $registry->get('GV_mplayer'),
'pdftotext' => $registry->get('GV_pdftotext'),
'pdfmaxpages' => $registry->get('GV_pdfmaxpages'),),
'mainConfiguration' => array(

View File

@@ -150,20 +150,22 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
/**
*
* @param system_file $file
* @param string $file The path to the file
* @return Feed_Adapter
*/
public function set_icon(system_file $file)
public function set_icon($file)
{
if ( ! file_exists($file)) {
throw new \Alchemy\Phrasea\Exception\InvalidArgumentException('File does not exists');
}
$registry = registry::get_instance();
$config_file = $registry->get('GV_RootPath')
. 'config/feed_' . $this->get_id() . '.jpg';
$www_file = $registry->get('GV_RootPath')
. 'www/custom/feed_' . $this->get_id() . '.jpg';
$config_file = $registry->get('GV_RootPath') . 'config/feed_' . $this->get_id() . '.jpg';
$www_file = $registry->get('GV_RootPath') . 'www/custom/feed_' . $this->get_id() . '.jpg';
copy($file->getPathname(), $config_file);
copy($file->getPathname(), $www_file);
copy($file, $config_file);
copy($file, $www_file);
$this->icon_url = null;
return $this;

View File

@@ -9,6 +9,9 @@
* file that was distributed with this source code.
*/
use MediaVorus\MediaVorus;
use MediaVorus\Media\Media;
/**
*
* @package subdefs
@@ -101,12 +104,41 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
*/
protected $is_physically_present = false;
/**
* Players types constants
*/
const TYPE_VIDEO_MP4 = 'VIDEO_MP4';
const TYPE_VIDEO_FLV = 'VIDEO_FLV';
const TYPE_FLEXPAPER = 'FLEXPAPER';
const TYPE_AUDIO_MP3 = 'AUDIO_MP3';
const TYPE_IMAGE = 'IMAGE';
const TYPE_NO_PLAYER = 'UNKNOWN';
/**
* Technical datas types constants
*/
const TC_DATA_WIDTH = 'Width';
const TC_DATA_HEIGHT = 'Height';
const TC_DATA_COLORSPACE = 'ColorSpace';
const TC_DATA_CHANNELS = 'Channels';
const TC_DATA_ORIENTATION = 'Orientation';
const TC_DATA_COLORDEPTH = 'ColorDepth';
const TC_DATA_DURATION = 'Duration';
const TC_DATA_AUDIOCODEC = 'AudioCodec';
const TC_DATA_AUDIOSAMPLERATE = 'AudioSamplerate';
const TC_DATA_VIDEOCODEC = 'VideoCodec';
const TC_DATA_FRAMERATE = 'FrameRate';
const TC_DATA_MIMETYPE = 'MimeType';
const TC_DATA_FILESIZE = 'FileSize';
const TC_DATA_LONGITUDE = 'Longitude';
const TC_DATA_LATITUDE = 'Latitude';
const TC_DATA_FOCALLENGTH = 'FocalLength';
const TC_DATA_CAMERAMODEL = 'CameraModel';
const TC_DATA_FLASHFIRED = 'FlashFired';
const TC_DATA_APERTURE = 'Aperture';
const TC_DATA_SHUTTERSPEED = 'ShutterSpeed';
const TC_DATA_HYPERFOCALDISTANCE = 'HyperfocalDistance';
const TC_DATA_ISO = 'ISO';
const TC_DATA_LIGHTVALUE = 'LightValue';
/**
* @todo the presence of file is checked on constructor, it would be better
@@ -525,16 +557,15 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
return array(\databox_subdef::DEVICE_ALL);
}
try
{
try {
return $this->record
->get_databox()
->get_subdef_structure()
->get_subdef($this->record->get_type(), $this->get_name())
->getDevices();
}
catch(\Exception_Databox_SubdefNotFound $e)
{
} catch (\Exception_Databox_SubdefNotFound $e) {
return array();
}
}
@@ -553,7 +584,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$Core = \bootstrap::getCore();
$specs = new MediaAlchemyst\Specification\Image();
$specs = new \MediaAlchemyst\Specification\Image();
$specs->setRotationAngle($angle);
try {
@@ -564,31 +595,100 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
return $this;
}
$result = new system_file($this->get_pathfile());
$media = MediaVorus::guess(new SplFileInfo($this->get_pathfile()));
$tc_datas = $result->get_technical_datas();
if ($tc_datas[system_file::TC_DATAS_WIDTH] && $tc_datas[system_file::TC_DATAS_HEIGHT]) {
$sql = "UPDATE subdef
$sql = "UPDATE subdef
SET height = :height , width = :width, updated_on = NOW()
WHERE record_id = :record_id AND name = :name";
$params = array(
':width' => $tc_datas[system_file::TC_DATAS_WIDTH]
, ':height' => $tc_datas[system_file::TC_DATAS_HEIGHT]
, ':record_id' => $this->get_record_id()
, ':name' => $this->get_name()
);
$params = array(
':width' => $media->getWidth(),
':height' => $media->getHeight(),
':record_id' => $this->get_record_id(),
':name' => $this->get_name(),
);
$stmt = $this->record->get_databox()->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
$this->delete_data_from_cache();
}
unset($media);
$stmt = $this->record->get_databox()->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
$this->delete_data_from_cache();
return $this;
}
/**
* Read the technical datas of the file.
* Returns an empty array for non physical present files
*
* @return array An array of technical datas Key/values
*/
public function readTechnicalDatas()
{
if ( ! $this->is_physically_present()) {
return array();
}
$media = MediaVorus::guess(new \SplFileInfo($this->get_pathfile()));
switch ($media->getType()) {
case Media::TYPE_IMAGE:
$datas = array(
self::TC_DATA_WIDTH => $media->getWidth(),
self::TC_DATA_HEIGHT => $media->getHeight(),
self::TC_DATA_FOCALLENGTH => $media->getFocalLength(),
self::TC_DATA_CHANNELS => $media->getChannels(),
self::TC_DATA_COLORDEPTH => $media->getColorDepth(),
self::TC_DATA_CAMERAMODEL => $media->getCameraModel(),
self::TC_DATA_FLASHFIRED => $media->getFlashFired(),
self::TC_DATA_APERTURE => $media->getAperture(),
self::TC_DATA_SHUTTERSPEED => $media->getShutterSpeed(),
self::TC_DATA_HYPERFOCALDISTANCE => $media->getHyperfocalDistance(),
self::TC_DATA_ISO => $media->getISO(),
self::TC_DATA_LIGHTVALUE => $media->getLightValue(),
self::TC_DATA_COLORSPACE => $media->getColorSpace(),
);
break;
case Media::TYPE_VIDEO:
$datas = array(
self::TC_DATA_WIDTH => $media->getWidth(),
self::TC_DATA_HEIGHT => $media->getHeight(),
self::TC_DATA_FOCALLENGTH => $media->getFocalLength(),
self::TC_DATA_CHANNELS => $media->getChannels(),
self::TC_DATA_COLORDEPTH => $media->getColorDepth(),
self::TC_DATA_CAMERAMODEL => $media->getCameraModel(),
self::TC_DATA_FLASHFIRED => $media->getFlashFired(),
self::TC_DATA_APERTURE => $media->getAperture(),
self::TC_DATA_SHUTTERSPEED => $media->getShutterSpeed(),
self::TC_DATA_HYPERFOCALDISTANCE => $media->getHyperfocalDistance(),
self::TC_DATA_ISO => $media->getISO(),
self::TC_DATA_LIGHTVALUE => $media->getLightValue(),
self::TC_DATA_COLORSPACE => $media->getColorSpace(),
self::TC_DATA_DURATION => $media->getDuration(),
self::TC_DATA_FRAMERATE => $media->getFrameRate(),
self::TC_DATA_AUDIOSAMPLERATE => $media->getAudioSampleRate(),
self::TC_DATA_VIDEOCODEC => $media->getVideoCodec(),
self::TC_DATA_AUDIOCODEC => $media->getAudioCodec(),
);
break;
case Media::TYPE_FLASH:
case Media::TYPE_AUDIO:
case Media::TYPE_DOCUMENT:
default:
break;
}
$datas[self::TC_DATA_LONGITUDE] = $media->getLongitude();
$datas[self::TC_DATA_LATITUDE] = $media->getLatitude();
$datas[self::TC_DATA_MIMETYPE] = $media->getFile()->getMimeType();
$datas[self::TC_DATA_FILESIZE] = $media->getFile()->getSize();
unset($media);
return $datas;
}
/**
*
* @param record_Interface $record
@@ -602,22 +702,27 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$databox = $record->get_databox();
$connbas = $databox->get_connection();
$media = MediaVorus::guess($system_file);
$path = $system_file->getPath();
$newname = $system_file->getFilename();
$datas = $system_file->get_technical_datas();
$params = array(
':path' => $path,
':file' => $newname,
':baseurl' => $baseurl,
':width' => isset($datas[system_file::TC_DATAS_WIDTH]) ? $datas[system_file::TC_DATAS_WIDTH] : '',
':height' => isset($datas[system_file::TC_DATAS_HEIGHT]) ? $datas[system_file::TC_DATAS_HEIGHT] : '',
':width' => 0,
':height' => 0,
':mime' => $system_file->get_mime(),
':size' => $system_file->getSize(),
':dispatched' => 1,
);
if (in_array($media->getType(), array(Media::TYPE_IMAGE, Media::TYPE_VIDEO))) {
$params[':width'] = $media->getWidth();
$params[':height'] = $media->getHeight();
}
try {
$subdef = new self($record, $name);
@@ -653,6 +758,8 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$subdef->get_permalink()->delete_data_from_cache();
}
unset($media);
return $subdef;
}

View File

@@ -452,7 +452,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
public function get_duration()
{
if ( ! $this->duration) {
$this->duration = $this->get_technical_infos(system_file::TC_DATAS_DURATION);
$this->duration = $this->get_technical_infos(media_subdef::TC_DATA_DURATION);
}
return $this->duration;
@@ -740,12 +740,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$stmt->closeCursor();
foreach ($rs as $row) {
switch ($row['name']) {
case 'size':
case system_file::TC_DATAS_WIDTH:
case system_file::TC_DATAS_COLORDEPTH:
case system_file::TC_DATAS_HEIGHT:
case system_file::TC_DATAS_DURATION:
switch (true) {
case ctype_digit($row['value']):
$this->technical_datas[$row['name']] = (int) $row['value'];
break;
default:
@@ -956,6 +952,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$base_url = '';
$media = MediaVorus\MediaVorus::guess($pathfile);
$original_file = $subdef_def = false;
if ($name == 'document') {
@@ -1016,8 +1014,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$connbas = connection::getPDOConnection($this->get_sbas_id());
$image_size = $system_file->get_technical_datas();
$sql = 'UPDATE subdef
SET baseurl = :baseurl,
file = :filename,
@@ -1036,8 +1032,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
':name' => $name,
':baseurl' => $base_url,
':filename' => $system_file->getFilename(),
':width' => $image_size[system_file::TC_DATAS_WIDTH],
':height' => $image_size[system_file::TC_DATAS_HEIGHT],
':width' => $media->getWidth(),
':height' => $media->getHeight(),
':mime' => $system_file->get_mime(),
':path' => $system_file->getPath(),
':filesize' => $system_file->getSize()
@@ -1063,6 +1059,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
unset($media);
return $this;
}
@@ -1365,17 +1363,15 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$system_file2 = new system_file($pathhd . $newname);
$system_file2->write_uuid($uuid);
media_subdef::create($record, 'document', $system_file2);
$subdef = media_subdef::create($record, 'document', $system_file2);
$record->delete_data_from_cache(record_adapter::CACHE_SUBDEFS);
$tc_datas = $system_file->get_technical_datas();
$sql = 'REPLACE INTO technical_datas (id, record_id, name, value)
VALUES (null, :record_id, :name, :value)';
$stmt = $connbas->prepare($sql);
foreach ($tc_datas as $name => $value) {
foreach ($subdef->readTechnicalDatas() as $name => $value) {
if (is_null($value))
continue;

View File

@@ -202,7 +202,6 @@ class setup
'xpdf (pdf2text)' => $registry->get('GV_pdftotext'),
'ImageMagick (composite)' => $registry->get('GV_pathcomposite'),
'FFmpeg' => $registry->get('GV_ffmpeg'),
'MPlayer' => $registry->get('GV_mplayer')
);
$constraints = array();

View File

@@ -292,101 +292,6 @@ class system_file extends \SplFileInfo
return $this->sha256;
}
public function get_technical_datas()
{
if ( ! $this->technical_datas)
$this->read_technical_datas();
return $this->technical_datas;
}
protected function read_image_datas()
{
$this->technical_datas[self::TC_DATAS_ORIENTATION] = null;
if (in_array(
$this->get_mime(), array(
'image/tif', 'image/tiff',
'image/jpg', 'image/pjpeg', 'image/pjpg', 'image/jpeg'
)
)
) {
if ($ex = @exif_read_data($this->getPathname(), 'FILE')) {
if (array_key_exists('Orientation', $ex))
$this->technical_datas[self::TC_DATAS_ORIENTATION] = $ex['Orientation'];
}
}
$datas = exiftool::extract_metadatas($this, exiftool::EXTRACT_XML_RDF);
$domrdf = new DOMDocument();
$domrdf->recover = true;
$domrdf->preserveWhiteSpace = false;
if ($domrdf->loadXML($datas)) {
$xptrdf = new DOMXPath($domrdf);
$xptrdf->registerNamespace('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
$pattern = "(xmlns:([a-zA-Z-_0-9]+)=[']{1}(https?:[/{2,4}|\\{2,4}][\w:#%/;$()~_?/\-=\\\.&]*)[']{1})";
preg_match_all($pattern, $datas, $matches, PREG_PATTERN_ORDER, 0);
$xptrdf->registerNamespace('XMP-exif', 'http://ns.exiftool.ca/XMP/XMP-exif/1.0/');
$xptrdf->registerNamespace('PHRASEANET', 'http://phraseanet.com/metas/PHRASEANET/1.0/');
foreach ($matches[2] as $key => $value)
$xptrdf->registerNamespace($matches[1][$key], $value);
$descriptionNode = @$xptrdf->query('/rdf:RDF/rdf:Description')->item(0);
if ($descriptionNode) {
for ($x = $descriptionNode->firstChild; $x; $x = $x->nextSibling) {
if ($x->nodeType !== XML_ELEMENT_NODE)
continue;
switch ($x->nodeName) {
case 'Composite:ImageSize':
if ((count($_t = explode('x', $x->textContent))) == 2) {
$this->technical_datas[self::TC_DATAS_WIDTH] = 0 + $_t[0];
$this->technical_datas[self::TC_DATAS_HEIGHT] = 0 + $_t[1];
}
break;
case 'ExifIFD:ExifImageWidth':
if ( ! array_key_exists('width', $this->technical_datas))
$this->technical_datas[self::TC_DATAS_WIDTH] = 0 + $x->textContent;
break;
case 'ExifIFD:ExifImageHeight':
if ( ! array_key_exists('height', $this->technical_datas))
$this->technical_datas[self::TC_DATAS_HEIGHT] = 0 + $x->textContent;
break;
case 'File:ColorComponents':
case 'IFD0:SamplesPerPixel':
if ( ! array_key_exists('channels', $this->technical_datas))
$this->technical_datas[self::TC_DATAS_CHANNELS] = 0 + $x->textContent;
break;
case 'File:BitsPerSample':
case 'IFD0:BitsPerSample':
if ( ! array_key_exists('bits', $this->technical_datas))
$this->technical_datas[self::TC_DATAS_COLORDEPTH] = 0 + $x->textContent;
break;
}
if (count($_t = explode(':', $x->nodeName)) !== 2)
continue;
switch ($_t[1]) {
case 'ImageWidth':
if ( ! array_key_exists('width', $this->technical_datas))
$this->technical_datas[self::TC_DATAS_WIDTH] = 0 + $x->textContent;
break;
case 'ImageHeight':
if ( ! array_key_exists('height', $this->technical_datas))
$this->technical_datas[self::TC_DATAS_HEIGHT] = 0 + $x->textContent;
break;
}
}
}
}
return $this;
}
protected function read_pdf_datas()
{
$system = system_server::get_platform();
@@ -420,129 +325,6 @@ class system_file extends \SplFileInfo
return $pdf_text;
}
protected function read_video_datas()
{
$registry = registry::get_instance();
$retour = array('width' => 0, 'height' => 0, 'CMYK' => false);
$hdPath = $this->getPathname();
$datas = exiftool::get_fields(
$hdPath, array('Duration', 'Image Width', 'Image Height')
);
$duration = 0;
if ($datas['Duration']) {
$data = explode('_', trim($datas['Duration']));
$data = explode(':', $data[0]);
$factor = 1;
while ($segment = array_pop($data)) {
$duration += $segment * $factor;
$factor *=60;
}
}
$width = $height = false;
if ($datas['Image Width']) {
if ((int) $datas['Image Width'] > 0)
$width = $datas['Image Width'];
}
if ($datas['Image Height']) {
if ((int) $datas['Image Height'] > 0)
$height = $datas['Image Height'];
}
$this->technical_datas = array();
if ( ! is_executable($registry->get('GV_mplayer'))) {
return $this;
}
$cmd = $registry->get('GV_mplayer')
. ' -identify '
. escapeshellarg($hdPath)
. ' -ao null -vo null -frames 0 | grep ^ID_';
$docProps = array(
'ID_VIDEO_WIDTH' => self::TC_DATAS_WIDTH,
'ID_VIDEO_HEIGHT' => self::TC_DATAS_HEIGHT,
'ID_VIDEO_FPS' => self::TC_DATAS_FRAMERATE,
'ID_AUDIO_CODEC' => self::TC_DATAS_AUDIOCODEC,
'ID_VIDEO_CODEC' => self::TC_DATAS_VIDEOCODEC,
'ID_VIDEO_BITRATE' => self::TC_DATAS_VIDEOBITRATE,
'ID_AUDIO_BITRATE' => self::TC_DATAS_AUDIOBITRATE,
'ID_AUDIO_RATE' => self::TC_DATAS_AUDIOSAMPLERATE
);
$stdout = shell_exec($cmd);
$this->technical_datas = array();
$stdout = explode("\n", $stdout);
foreach ($stdout as $property) {
$props = explode('=', $property);
if (array_key_exists($props[0], $docProps))
$this->technical_datas[$docProps[$props[0]]] = $props[1];
}
$datas = exiftool::extract_metadatas($this, exiftool::EXTRACT_XML_RDF);
$dom_document = new DOMDocument();
if ($dom_document->loadXML($datas)) {
$xq = new DOMXPath($dom_document);
$xq->registerNamespace('RIFF', 'http://ns.exiftool.ca/RIFF/RIFF/1.0/');
$nodes_width = $xq->query('/rdf:RDF/rdf:Description/RIFF:ImageWidth');
$nodes_height = $xq->query('/rdf:RDF/rdf:Description/RIFF:ImageHeight');
if ($nodes_height->length > 0 && $nodes_width->length > 0) {
$width = $nodes_width->item(0)->nodeValue;
$height = $nodes_height->item(0)->nodeValue;
}
}
$this->technical_datas[self::TC_DATAS_DURATION] = $duration;
if ($width)
$this->technical_datas[self::TC_DATAS_WIDTH] = $width;
if ($height)
$this->technical_datas[self::TC_DATAS_HEIGHT] = $height;
return $this;
}
protected function read_audio_datas()
{
return $this->read_video_datas();
}
protected function read_technical_datas()
{
$this->technical_datas = array();
switch ($this->get_phrasea_type()) {
case 'image' :
$this->read_image_datas();
break;
case 'document';
$this->read_image_datas();
// $this->read_pdf_datas();
break;
case 'video':
$this->read_video_datas();
break;
case 'audio':
$this->read_audio_datas();
break;
default:
break;
}
$this->technical_datas[self::TC_DATAS_MIMETYPE] = $this->get_mime();
$this->technical_datas[self::TC_DATAS_FILESIZE] = $this->getSize();
return;
}
/**
*
* @return string
@@ -890,7 +672,16 @@ class system_file extends \SplFileInfo
$tfields = array();
$technical_datas = $this->get_technical_datas();
$media = MediaVorus\MediaVorus::guess($this);
$width = $height = $channels = $colorDepth = array();
if (in_array($media, array(\MediaVorus\Media\Media::TYPE_IMAGE, \MediaVorus\Media\Media::TYPE_VIDEO))) {
$width[] = $media->getWidth();
$height[] = $media->getHeight();
$channels[] = $media->getChannels();
$colorDepth[] = $media->getColorDepth();
}
$tfields[metadata_description_PHRASEANET_tfmimetype::get_source()]
= array($this->get_mime());
@@ -903,36 +694,24 @@ class system_file extends \SplFileInfo
$tfields[metadata_description_PHRASEANET_tffilename::get_source()]
= array($this->get_phrasea_tech_field(self::TECH_FIELD_ORIGINALNAME));
$tfields[metadata_description_PHRASEANET_tfextension::get_source()]
= array($this->get_extension());
$tfields[metadata_description_PHRASEANET_tfwidth::get_source()]
= isset($technical_datas[system_file::TC_DATAS_WIDTH]) ? array(($technical_datas[system_file::TC_DATAS_WIDTH])) : array();
$tfields[metadata_description_PHRASEANET_tfheight::get_source()]
= isset($technical_datas[system_file::TC_DATAS_HEIGHT]) ? array(($technical_datas[system_file::TC_DATAS_HEIGHT])) : array();
$tfields[metadata_description_PHRASEANET_tfbits::get_source()]
= isset($technical_datas[system_file::TC_DATAS_COLORDEPTH]) ? array(($technical_datas[system_file::TC_DATAS_COLORDEPTH])) : array();
$tfields[metadata_description_PHRASEANET_tfchannels::get_source()]
= isset($technical_datas[system_file::TC_DATAS_CHANNELS]) ? array(($technical_datas[system_file::TC_DATAS_CHANNELS])) : array();
$tfields[metadata_description_PHRASEANET_tfextension::get_source()] = array($this->get_extension());
$tfields[metadata_description_PHRASEANET_tfwidth::get_source()] = $width;
$tfields[metadata_description_PHRASEANET_tfheight::get_source()] = $height;
$tfields[metadata_description_PHRASEANET_tfbits::get_source()] = $colorDepth;
$tfields[metadata_description_PHRASEANET_tfchannels::get_source()] = $channels;
$tfields[metadata_description_PHRASEANET_tfctime::get_source()]
= array(date('Y/m/d H:i:s', $this->getCTime()));
$tfields[metadata_description_PHRASEANET_tfmtime::get_source()]
= array(date('Y/m/d H:i:s', $this->getMTime()));
$tfields[metadata_description_PHRASEANET_tfatime::get_source()]
= array(date('Y/m/d H:i:s', $this->getATime()));
$tfields[metadata_description_PHRASEANET_tfctime::get_source()] = array(date('Y/m/d H:i:s', $this->getCTime()));
$tfields[metadata_description_PHRASEANET_tfmtime::get_source()] = array(date('Y/m/d H:i:s', $this->getMTime()));
$tfields[metadata_description_PHRASEANET_tfatime::get_source()] = array(date('Y/m/d H:i:s', $this->getATime()));
$time = time();
$tfields[metadata_description_PHRASEANET_tfarchivedate::get_source()]
= array(date('Y/m/d H:i:s', $time));
$tfields[metadata_description_PHRASEANET_tfeditdate::get_source()]
= array(date('Y/m/d H:i:s', $time));
$tfields[metadata_description_PHRASEANET_tfchgdocdate::get_source()]
= array(date('Y/m/d H:i:s', $time));
$tfields[metadata_description_PHRASEANET_tfarchivedate::get_source()] = array(date('Y/m/d H:i:s', $time));
$tfields[metadata_description_PHRASEANET_tfeditdate::get_source()] = array(date('Y/m/d H:i:s', $time));
$tfields[metadata_description_PHRASEANET_tfchgdocdate::get_source()] = array(date('Y/m/d H:i:s', $time));
if ($this->get_mime() === 'application/pdf') {
$tfields[metadata_description_PHRASEANET_pdftext::get_source()]
= $this->read_pdf_datas();
$tfields[metadata_description_PHRASEANET_pdftext::get_source()] = $this->read_pdf_datas();
}
$datas = exiftool::extract_metadatas($this, exiftool::EXTRACT_XML_RDF);

View File

@@ -195,14 +195,9 @@ class task_period_upgradetov32 extends task_abstract
foreach ($rs as $row) {
try {
$record = new record_adapter($this->sbas_id, $row['record_id']);
$system_file = $record->get_hd_file();
$document = $record->get_subdef('document');
if ( ! $system_file instanceof system_file)
continue;
$tc_datas = $system_file->get_technical_datas();
foreach ($tc_datas as $name => $value) {
foreach ($document->readTechnicalDatas() as $name => $value) {
if (is_null($value))
continue;