Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: neos/metadata-extractor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.0
Choose a base ref
...
head repository: neos/metadata-extractor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Mar 16, 2017

  1. TASK: Style fixes

    ComiR committed Mar 16, 2017

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    5c065b9 View commit details
  2. TASK: Singleton where possible

    ComiR committed Mar 16, 2017

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    7a01f28 View commit details
  3. Unverified

    The committer email address is not verified.
    Copy the full SHA
    a927e1e View commit details
  4. Unverified

    The committer email address is not verified.
    Copy the full SHA
    0d58fad View commit details
  5. Unverified

    The committer email address is not verified.
    Copy the full SHA
    5be9374 View commit details

Commits on Mar 22, 2017

  1. Unverified

    The committer email address is not verified.
    Copy the full SHA
    13c024d View commit details
  2. Unverified

    The committer email address is not verified.
    Copy the full SHA
    4cc1b2e View commit details
  3. Merge pull request #9 from ElementareTeilchen/patch-3

    Style fixes, Singletons, Exceptions instead of Checks
    daniellienert authored Mar 22, 2017
    Copy the full SHA
    7c46b7e View commit details

Commits on Mar 23, 2017

  1. BUGFIX: Correct variable name

    ComiR committed Mar 23, 2017

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    406876f View commit details

Commits on Mar 24, 2017

  1. Merge pull request #10 from ElementareTeilchen/patch-3

    BUGFIX: Correct variable name
    kdambekalns authored Mar 24, 2017
    Copy the full SHA
    783765a View commit details

Commits on Mar 29, 2017

  1. Unverified

    The committer email address is not verified.
    Copy the full SHA
    a19dfb9 View commit details
  2. Merge pull request #11 from ElementareTeilchen/patch-1

    BUGFIX: require ext-mbstring & use mb_convert_econding instead of utf8_encode
    daniellienert authored Mar 29, 2017
    Copy the full SHA
    f7961a6 View commit details
  3. Copy the full SHA
    4245f74 View commit details

Commits on Sep 28, 2017

  1. TASK: Update MetaData on assetUpdate

    When an asset is updated, the metadata are also updated.
    gerdemann authored Sep 28, 2017
    Copy the full SHA
    8d80d90 View commit details

Commits on Jan 4, 2018

  1. Merge pull request #12 from gerdemann/patch-1

    TASK: Update MetaData on assetUpdate
    daniellienert authored Jan 4, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    be80dd0 View commit details
  2. BUGFIX: Persist changes to assets

    Changes should be persistet when the command terminates
    daniellienert committed Jan 4, 2018
    Copy the full SHA
    7dda953 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6ad11ff View commit details
  4. Merge pull request #14 from neos/revert-12-patch-1

    Revert "TASK: Update MetaData on assetUpdate"
    daniellienert authored Jan 4, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2778d07 View commit details
  5. Merge pull request #13 from daniellienert/bugfix/persist-changes-to-a…

    …ssets
    
    BUGFIX: Persist changes to assets
    daniellienert authored Jan 4, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    66ffd0a View commit details

Commits on Apr 27, 2018

  1. Copy the full SHA
    d6ae224 View commit details

Commits on May 2, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6c851bc View commit details

Commits on Sep 10, 2018

  1. Copy the full SHA
    0fd6a23 View commit details

Commits on Sep 11, 2018

  1. Merge pull request #15 from daniellienert/task/listen-on-asset-update…

    …-signal
    
    TASK: Listen on asset updated signal
    daniellienert authored Sep 11, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6db6ec9 View commit details

Commits on Nov 7, 2018

  1. Copy the full SHA
    7807b0d View commit details
  2. TASK: Code style and type hints

    ComiR authored and daniellienert committed Nov 7, 2018

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    5d41675 View commit details
  3. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8605a1a View commit details
  4. Copy the full SHA
    9069cd4 View commit details
  5. Copy the full SHA
    efbba02 View commit details
  6. BUGFIX: Just wait for ConfigurationManager to be available when conne…

    …cting signal/slots (#17)
    
    * BUGFIX: Just wait for ConfigurationManager to be available when connecting signal/slots
    ComiR authored and daniellienert committed Nov 7, 2018

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1a4f2a9 View commit details

Commits on Aug 15, 2019

  1. 1
    Copy the full SHA
    ac99429 View commit details
  2. TASK: Amend Readme.md

    kdambekalns authored and daniellienert committed Aug 15, 2019
    Copy the full SHA
    88ab671 View commit details

Commits on Sep 19, 2019

  1. BUGFIX: Fix leading zeros missing in DateConverter (#24)

    * fix leading zeros missing in DateConverter
    * Fix global namespace sprintf
    gjwnc authored and daniellienert committed Sep 19, 2019
    Copy the full SHA
    de1b0b9 View commit details

Commits on Sep 26, 2019

  1. BUGFIX: Check for getCopyrightNotice() method before use

    On Neos older than 4.2 the `Asset` has no `getCopyrightNotice()`,
    but since this package claims compatibility, it needs to check before
    calling it.
    
    Fixes #26
    kdambekalns authored Sep 26, 2019
    Copy the full SHA
    9159c97 View commit details

Commits on Sep 27, 2019

  1. Copy the full SHA
    61f3002 View commit details
  2. Copy the full SHA
    f5efecb View commit details
  3. Merge pull request #27 from kdambekalns/bugfix/26-getCopyrightNotice-…

    …check
    
    BUGFIX: Check for getCopyrightNotice() method before use
    kdambekalns authored Sep 27, 2019
    Copy the full SHA
    2e179e7 View commit details

Commits on Oct 30, 2019

  1. Copy the full SHA
    ca05aff View commit details

Commits on Oct 31, 2019

  1. Merge pull request #29 from ElementareTeilchen/upgrade

    Add compatability with Flow 6.0 / Neos 5.0
    daniellienert authored Oct 31, 2019
    Copy the full SHA
    d9bc90b View commit details

Commits on Sep 30, 2021

  1. TASK: Allow NEOS 7.x (#30)

    gjwnc authored Sep 30, 2021
    Copy the full SHA
    0c1444d View commit details

Commits on Apr 20, 2022

  1. Copy the full SHA
    d0bbccc View commit details
  2. Copy the full SHA
    3aa6d21 View commit details

Commits on Apr 22, 2022

  1. Merge pull request #31 from kdambekalns/task/flow-neos-8-compatibility

    Add compatibility with Flow / Neos 8.0
    kdambekalns authored Apr 22, 2022
    Copy the full SHA
    0ac8b43 View commit details
97 changes: 93 additions & 4 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,95 @@
preset: psr2

finder:
path:
- "Neos.MetaData.Extractor/Classes"
- "Neos.MetaData.Extractor/Tests"
risky: true

enabled:
- alpha_ordered_imports
- array_indentation
- binary_operator_spaces
- combine_consecutive_issets
- combine_consecutive_unsets
- comment_to_phpdoc
- compact_nullable_typehint
- concat_with_spaces
- fully_qualified_strict_types
- function_typehint_space
- hash_to_slash_comment
- include
- is_null
- linebreak_after_opening_tag
- lowercase_cast
- magic_constant_casing
- method_chaining_indentation
- method_separation
- modernize_types_casting
- multiline_comment_opening_closing
- native_function_casing
- newline_before_semicolons_chained
- no_alias_functions
- no_alternative_syntax
- no_blank_lines_after_class_opening
- no_blank_lines_after_phpdoc
- no_blank_lines_after_return
- no_blank_lines_after_throw
- no_blank_lines_before_namespace
- no_blank_lines_between_imports
- no_empty_comment
- no_empty_phpdoc
- no_empty_statement
- no_extra_block_blank_lines
- no_homoglyph_names
- no_leading_import_slash
- no_leading_namespace_whitespace
- no_multiline_whitespace_around_double_arrow
- no_null_property_initialization
- no_php4_constructor
- no_short_bool_cast
- no_singleline_whitespace_before_semicolons
- no_spaces_inside_offset
- no_spaces_outside_offset
- no_superfluous_elseif
- no_trailing_comma_in_singleline_array
- no_unneeded_curly_braces
- no_unneeded_final_method
- no_unused_imports
- no_useless_else
- no_useless_return
- no_whitespace_before_comma_in_array
- no_whitespace_in_blank_line
- non_printable_character
- normalize_index_brace
- object_operator_without_whitespace
- phpdoc_add_missing_param_annotation
- phpdoc_annotation_without_dot
- phpdoc_indent
- phpdoc_no_access
- phpdoc_no_package
- phpdoc_no_useless_inheritdoc
- phpdoc_return_self_reference
- phpdoc_scalar
- phpdoc_single_line_var_spacing
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- post_increment
- print_to_echo
- property_separation
- self_accessor
- semicolon_after_instruction
- short_array_syntax
- short_list_syntax
- short_scalar_cast
- simplified_null_return
- single_quote
- space_after_semicolon
- standardize_increment
- standardize_not_equals
- strict_comparison
- ternary_operator_spaces
- ternary_to_null_coalescing
- trailing_comma_in_multiline_array
- trim_array_spaces
- unalign_double_arrow
- unalign_equals
- unary_operator_spaces
- whitespace_after_comma_in_array
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: php
matrix:
include:
- php: 7.0
- php: 7.2
sudo: false
before_install:
- export NEOS_TARGET_VERSION=3.0
- export NEOS_TARGET_VERSION=5.0
- cd ..
- git clone https://github.com/neos/neos-base-distribution.git -b ${NEOS_TARGET_VERSION}
- cd neos-base-distribution
18 changes: 16 additions & 2 deletions Classes/Command/MetaDataCommandController.php
Original file line number Diff line number Diff line change
@@ -5,12 +5,13 @@
* This file is part of the Neos.MetaData.Extractor package.
*/

use Neos\MetaData\Extractor\Domain\ExtractionManager;
use Neos\MetaData\Extractor\Exception\ExtractorException;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
use Neos\Flow\Persistence\Doctrine\PersistenceManager;
use Neos\Media\Domain\Model\Asset;
use Neos\Media\Domain\Repository\AssetRepository;
use Neos\MetaData\Extractor\Domain\ExtractionManager;
use Neos\MetaData\Extractor\Exception\ExtractorException;

/**
* @Flow\Scope("singleton")
@@ -29,8 +30,16 @@ class MetaDataCommandController extends CommandController
*/
protected $extractionManager;

/**
* @Flow\Inject
* @var PersistenceManager
*/
protected $persistenceManager;

/**
* Extracts MetaData from Assets
*
* @return void
*/
public function extractCommand()
{
@@ -47,8 +56,13 @@ public function extractCommand()
}

$this->output->progressAdvance(1);

if ($iterator->key() % 100 === 0) {
$this->persistenceManager->persistAll();
}
}

$this->persistenceManager->persistAll();
$this->outputLine("\nFinished extraction.");
}
}
18 changes: 10 additions & 8 deletions Classes/Converter/CoordinatesConverter.php
Original file line number Diff line number Diff line change
@@ -11,28 +11,30 @@
* source code.
*/

use Neos\Flow\Annotations as Flow;

/**
* @Flow\Scope("singleton")
* @see http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf data type definitions
*/
class CoordinatesConverter
{
/**
* Converts coordinates in DMS (degrees, minutes, seconds) and the cardinal direction reference (E,W,N,S) into
* Converts coordinates in DMS (degrees, minutes, seconds) and the cardinal direction reference (E,W,N,S) into
* DD (decimal degrees) notation.
*
* @param array<float> $dmsArray Coordinates in DMS (degrees, minutes, seconds)
* @param float[] $dmsArray Coordinates in DMS (degrees, minutes, seconds)
* @param string $cardinalDirectionReference cardinal direction reference (E,W,N,S)
*
* @return float Coordinates in DD (decimal degrees)
*/
public static function convertDmsToDd($dmsArray, $cardinalDirectionReference)
public static function convertDmsToDd(array $dmsArray, string $cardinalDirectionReference) : float
{
$degrees = isset($dmsArray[0]) ? $dmsArray[0] : 0.0;
$minutes = isset($dmsArray[1]) ? $dmsArray[1] : 0.0;
$seconds = isset($dmsArray[2]) ? $dmsArray[2] : 0.0;
$degrees = $dmsArray[0] ?? 0.0;
$minutes = $dmsArray[1] ?? 0.0;
$seconds = $dmsArray[2] ?? 0.0;

$flip = ($cardinalDirectionReference === 'W' || $cardinalDirectionReference === 'S') ? -1 : 1;

return round($flip * ($degrees + $minutes / 60 + $seconds / 3600), 6);
return \round($flip * ($degrees + $minutes / 60 + $seconds / 3600), 6);
}
}
28 changes: 12 additions & 16 deletions Classes/Converter/DateConverter.php
Original file line number Diff line number Diff line change
@@ -17,34 +17,30 @@ class DateConverter
* Combines the EXIF GPSTimeStamp and GPSDateStamp into a DateTime object
*
* @param string $gpsDateStamp
* @param array $gpsTimeStamp
*
* @param string[] $gpsTimeStamp
* @return \DateTime
*/
public static function convertGpsDateAndTime($gpsDateStamp, $gpsTimeStamp)
public static function convertGpsDateAndTime(string $gpsDateStamp, array $gpsTimeStamp) : \DateTime
{
return \DateTime::createFromFormat('Y:m:d H:i:s', $gpsDateStamp . ' ' . (int)$gpsTimeStamp[0] . ':' . (int)$gpsTimeStamp[1] . ':' . (int)$gpsTimeStamp[2]);
return \DateTime::createFromFormat(
'Y:m:d H:i:s',
$gpsDateStamp . ' ' . \sprintf('%02d:%02d:%02d', (int)$gpsTimeStamp[0], (int)$gpsTimeStamp[1], (int)$gpsTimeStamp[2])
);
}

/**
* Combines ISO 8601 like date and time string into a DateTime Object
*
* @param $dateString
* @param $timeString
* @return bool|\DateTime
* @param string $dateString
* @param string|null $timeString
* @return \DateTime|bool
*/
public static function convertIso8601DateAndTimeString($dateString, $timeString)
public static function convertIso8601DateAndTimeString(string $dateString, string $timeString = null)
{
if (empty($dateString)) {
return false;
}

if (empty($timeString)) {
$timeString = '000000+0000';
} else {
if(!strpos($timeString, '+')) {
$timeString .= '+0000';
}
} elseif (\strpos($timeString, '+') === false && \strpos($timeString, '-') === false) {
$timeString .= '+0000';
}

return \DateTime::createFromFormat('YmdHisO', $dateString . $timeString);
22 changes: 13 additions & 9 deletions Classes/Converter/NumberConverter.php
Original file line number Diff line number Diff line change
@@ -11,18 +11,22 @@
* source code.
*/

use Neos\Flow\Annotations as Flow;

/**
* @Flow\Scope("singleton")
*/
class NumberConverter
{
/**
* Converts a rational string like EXIF / (S)RATIONAL into a float number.
*
* @param string $rationalString
*
* @return float
*/
public static function convertRationalToFloat($rationalString)
public static function convertRationalToFloat(string $rationalString) : float
{
if (preg_match('#^(-?\d+)\/(\d+)$#', $rationalString, $matches)) {
if (\preg_match('#^(-?\d+)\/(\d+)$#', $rationalString, $matches)) {
$divisor = (float)$matches[2];
if ($divisor !== 0.0) {
return (int)$matches[1] / $divisor;
@@ -33,16 +37,16 @@ public static function convertRationalToFloat($rationalString)
}

/**
* Converts a version in the format like 0x02020000
* to 2.2.0.0
* Converts a version in the format like 0x02020000 to 2.2.0.0
*
* @param string $binaryVersion
* @return string
*/
public static function convertBinaryToVersion($binaryVersion)
public static function convertBinaryToVersion(string $binaryVersion) : string
{
$versionParts = str_split((string)bin2hex($binaryVersion), 2);
$versionParts = array_map('intval', $versionParts);
return implode('.', $versionParts);
$versionParts = \str_split(\bin2hex($binaryVersion), 2);
$versionParts = \array_map('\intval', $versionParts);

return \implode('.', $versionParts);
}
}
Loading