Code Monkey home page Code Monkey logo

metadata's People

Contributors

awuttig avatar fabarea avatar fnagel avatar fsaris avatar jmverges avatar jokumer avatar lorenzulrich avatar mueller-sebastian avatar scanacs-agruhn avatar sgrossberndt avatar tobias-linke avatar wazum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

metadata's Issues

Datatype definition for focal_length must not be int

Although focal_length is a value calculated by a division

$metadata['focal_length'] = $parts[0] / $parts[1];

in

$metadata['focal_length'] = $parts[0] / $parts[1];

and thus can contain floats like 6.1 the database definition for the column is

focal_length int(4) unsigned DEFAULT '0' NOT NULL

in

focal_length int(4) unsigned DEFAULT '0' NOT NULL,

At least with PostgreSQL this leads to a PDOException if such a value is encountered in FileStorageExtractionTask:

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: »6.1« (0) - {"exception":"PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: \u00bb6.1\u00ab in vendor\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php:91\nStack trace:
#0 vendor\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php(91): PDOStatement->execute(Array)
#1 vendor\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(1008): Doctrine\\DBAL\\Driver\\PDOStatement->execute(Array)
#2 vendor\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(678): Doctrine\\DBAL\\Connection->executeUpdate('UPDATE \"sys_fil...', Array, Array)
#3 typo3_src-8.7.10\/typo3\/sysext\/core\/Classes\/Database\/Connection.php(357): Doctrine\\DBAL\\Connection->update('\"sys_file_metad...', Array, Array, Array)
#4 typo3_src-8.7.10\/typo3\/sysext\/core\/Classes\/Resource\/Index\/MetaDataRepository.php(193): TYPO3\\CMS\\Core\\Database\\Connection->update('sys_file_metada...', Array, Array, Array)
#5 typo3_src-8.7.10\/typo3\/sysext\/core\/Classes\/Resource\/Index\/Indexer.php(154): TYPO3\\CMS\\Core\\Resource\\Index\\MetaDataRepository->update(1379, Array)
#6 typo3_src-8.7.10\/typo3\/sysext\/core\/Classes\/Resource\/Index\/Indexer.php(114): TYPO3\\CMS\\Core\\Resource\\Index\\Indexer->extractMetaData(Object(TYPO3\\CMS\\Core\\Resource\\File))
#7 typo3_src-8.7.10\/typo3\/sysext\/scheduler\/Classes\/Task\/FileStorageExtractionTask.php(49): TYPO3\\CMS\\Core\\Resource\\Index\\Indexer->runMetaDataExtraction(100)
#8 typo3_src-8.7.10\/typo3\/sysext\/scheduler\/Classes\/Scheduler.php(181): TYPO3\\CMS\\Scheduler\\Task\\FileStorageExtractionTask->execute()

component="TYPO3.CMS.Scheduler.Task.FileStorageExtractionTask": A Task Exception was captured: An exception occurred while executing
UPDATE "sys_file_metadata" 
SET "pid" = ?, "tstamp" = ?, "crdate" = ?, "cruser_id" = ?, "sys_language_uid" = ?, "l10n_parent" = ?, "l10n_diffsource" = ?, "t3ver_oid" = ?, "t3ver_id" = ?, "t3ver_wsid" = ?, "t3ver_label" = ?, "t3ver_state" = ?, "t3ver_stage" = ?, "t3ver_count" = ?, "t3ver_tstamp" = ?, "t3ver_move_id" = ?, "t3_origuid" = ?, "file" = ?, "title" = ?, "width" = ?, "height" = ?, "description" = ?, "alternative" = ?, "visible" = ?, "status" = ?, "keywords" = ?, "caption" = ?, "creator_tool" = ?, "download_name" = ?, "creator" = ?, "publisher" = ?, "source" = ?, "copyright" = ?, "location_country" = ?, "location_region" = ?, "location_city" = ?, "latitude" = ?, "longitude" = ?, "ranking" = ?, "content_creation_date" = ?, "content_modification_date" = ?, "note" = ?, "unit" = ?, "duration" = ?, "color_space" = ?, "pages" = ?, "language" = ?, "fe_groups" = ?, "l10n_state" = ?, "categories" = ?, "copyright_notice" = ?, "aperture_value" = ?, "shutter_speed_value" = ?, "iso_speed_ratings" = ?, "camera_model" = ?, "focal_length" = ?, "flash" = ?, "metering_mode" = ?, "horizontal_resolution" = ?, "vertical_resolution" = ?
WHERE "uid" = ?' with params ["0", 1519306909, "1508339162", "3", "0", "0", "", "0", "0", "0", "", "0", "0", "0", "0", "0", "0", "1379", null, "900", "675", null, null, "1", "", null, null, "Adobe Photoshop CS3 Macintosh", "", "", "", "", null, "", "", "", "0.00000000000000", "0.00000000000000", "0", "1264852285", "1264957253", null, "px", "0", "sRGB", "0", "", null, null, "0", "", "2.9", "1\/999", "80", "Canon PowerShot G11", "6.1", "16", "5", "72", "72", 1379]

`content_creation_date` from EXIF is overridden by IPTC with wrong data

Metadata is first fetched from EXIF and the overridden by IPTC:
https://github.com/fabarea/metadata/blob/master/Classes/Index/ImageMetadataExtractor.php#L140

content_creation_date is fetched in EXIF using:
https://github.com/fabarea/metadata/blob/master/Classes/Index/ImageMetadataExtractor.php#L229

and in IPTC using
https://github.com/fabarea/metadata/blob/master/Classes/Index/ImageMetadataExtractor.php#L66
and
https://github.com/fabarea/metadata/blob/master/Classes/Index/ImageMetadataExtractor.php#L348

Consider a picture from an iOS device which contains EXIF and IPTC.

Currently there are two issues:

  1. An IPTC "Date created" is not parsed with strtotime() and leads to wrong timestamps written to the database (the database columns contains the unparsed 20201202 instead of 1606863600.
  2. The correctly parsed and more accurate EXIF timestamp int(1606916942) is overridden.

PdfIndexer is not able to handle array of keywords

The pdf indexer fails if the file contains an array of keywords in the pdf metadata block.
In this cails the scheduler task fails and an entry to the typo3 log is written. Every index run.
The error occurs when the values of the metadata block are parsed and converted to xml.
This should be improved to handle single values and also arrays.
The second image shows the array $pdf->properties.

TYPO3: 10.4.17
PHP: 7.4.20
EXT:metadata: 4.0.0

grafik
grafik

TYPO3 7.4 support

In TYPO3 7.4.0 the tasks fails with an error message:

Serialization of 'Closure' is not allowed

missing categories in tca for filetype image

by overwriting $tca['types'] for the filetype image the configuration for showing the categories ("--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category, categories,") gets removed.
This results in being unable to edit categories for images in the backend.

keyword import does not work from PDF exported by Adobe InDesign

Hi,

I created a document with Adobe InDesign Cloud 2019 and added all kinds of metadata. I exported the document as PDF and when I import the PDF into TYPO3 the keywords are missing in the TYPO3 backend. Nothing gets imported.

When I edit the PDF with Adobe Acrobat the keywords are present so I wonder why it's not working with the exported InDesign file.

I use TYPO3 9.5.13.

SQL exception for color_space with value 65535

The EXIF definition for ColorSpace defined 65535 as "Uncalibrated".
https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html

As this is currently not defined in the $colorSpaceToNameMapping in

protected $colorSpaceToNameMapping = array(

the method getColorSpace() in

protected function getColorSpace($value) {

returns the bare value 65535 and sets it as color_space.

But the SQL definition for this column in filemetadata is color_space varchar(4) DEFAULT '', which only allows 4 characters. So when trying to add metadata for a file with a color_space value of 65535 at least on PostgreSQL an SQL PDOException is thrown as the value is too long for the field.

SQL exception for images w/o GPS coordinates on PostgreSQL

On PostgreSQL an SQL exception is thrown if an image does not contain a GPS coordinate because lat/lon are defined as

latitude decimal(24,14) DEFAULT '0.00000000000000',
longitude decimal(24,14) DEFAULT '0.00000000000000',

in TYPO3 Core, but the current implementation in EXT:metadata sets an empty string '' as lat/lon if no coordinate is found in https://github.com/fabarea/metadata/blob/master/Classes/Index/ImageMetadataExtractor.php#L418

As an empty string is not numeric this fails on PostgreSQL (MySQL tolerates it).

IPTC source should be saved in metadata source field

Instead of
'2#115' => 'publisher',

should it not be
'2#115' => 'source',

Otherwise IPTC source metadata is saved in publisher instead of source.
Or is this on purpose? I'm not that deep into metadata stuff....

Compatibility with TYPO3 9

Hello,

looking on TER I found this extension where it is defined that supported up to TYPO3 8.
On GitHub, however, it would seem to also support TYPO3 9.
Are you developing and it hasn't been released yet?
Do you already have the expected time for the possible release?

Thanks for your attention.

regards
Abramo

EXT:metadata prevents adding other custom columns

If EXT:metadata is installed I can't see my custom added columns in file mata data TCA.

I add my columns like this in sys_file_metadata.php:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
    'sys_file_metadata',
    [
        'myField' => [
            'exclude' => 0,
            'label'   =>'myFieldLabel',
            'config'  => [
                'type' => 'input',
                'size' => 30,
                'max'  => 1000,
                'eval' => 'trim',
            ],
        ],
    ]
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
    'sys_file_metadata',
    ', --div--;myDivLabel, myField,',
    '',
    'after'
);

The reason is, that EXT:metadata uses ArrayUtility::mergeRecursiveWithOverrule in metadata/Configuration/TCA/Overrides/sys_file_metadata.php

\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['sys_file_metadata'], $tca);

Wrong "GPS Coordinate" parsing if value isn't present

I got some troubles with inserting GPS coordinates when lattitude/longitude aren't present in metadata...

Following change in function parseGpsCoordinate worked for me:
return ($value === null || $value === '' || $value == 0) ? '0.00000000000000' : (string)$value;

instead of:
return $value === null ? null : (string)$value;

Best regards,
Roman

Compatibility for TYPO3 CMS 9.5

Version 2.4.0-dev is not compatible with current TYPO3 CMS 9.5, which should be to support upgrade.

If you install current version in TYPO3 CMS version 9.5.5, then

  • extension configuration check uses deprecated TYPO3_CONF_VARS key
  • extension configuration breaks by class loading from extension configuration user-function which renders result for PHP extension check (exif & iptc)
  • extension configuration will not render with new introduced css classes for success/warning

I will add a pull request, which solves these issue..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.