Add the file metadata app. This app uses binary wrappers called drivers to extract properties from the file of documents. The default driver uses the exiftool to extract the EXIF record from JPEG images. The exiftool can also extra some properties from other files like PDFs, office files and sound file. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
25 lines
561 B
Python
25 lines
561 B
Python
from __future__ import unicode_literals
|
|
|
|
import logging
|
|
|
|
from django.apps import apps
|
|
|
|
from mayan.celery import app
|
|
|
|
from .classes import FileMetadataDriver
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
@app.task(ignore_result=True)
|
|
def task_process_document_version(document_version_id):
|
|
DocumentVersion = apps.get_model(
|
|
app_label='documents', model_name='DocumentVersion'
|
|
)
|
|
|
|
document_version = DocumentVersion.objects.get(pk=document_version_id)
|
|
|
|
FileMetadataDriver.process_document_version(
|
|
document_version=document_version
|
|
)
|