Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Added many properties to EXIF/IPTC DTOs #4

Merged
merged 7 commits into from
Nov 23, 2016

Conversation

ComiR
Copy link
Contributor

@ComiR ComiR commented Nov 15, 2016

also improved code style and fixed a possible bug.

@@ -13,7 +13,10 @@

use Doctrine\Common\Collections\ArrayCollection;

/**
* ArrayCollection for meta data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments always tend to get outdated. So if a comment doesn't add any information, just leave it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without comments it looks kind of unfinished. But you're probably right.

@@ -13,21 +13,21 @@

use TYPO3\Flow\Utility\Arrays;

/**
* AbstractMetaDataDto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about comments above ;)

*
* @param array $properties
*/
public function __construct(array $properties)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think defining the default properties in the constructor is better than just defining it in the array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh: because of the ClassOverridesFieldOfSuperClassInspection of https://github.com/kalessil/phpinspectionsea#inspections-lists-architecture ;)

I can't really decide on which one is better. :/

*/
class Exif extends AbstractMetaDataDto
{
/**
* EXIF MetaData constructor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about comments above ;)

*/
class Iptc extends AbstractMetaDataDto
{
/**
* @var array
* IPTC MetaData constructor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded comment

@@ -14,12 +14,16 @@
use Neos\MetaData\Domain\Collection\MetaDataCollection;
use TYPO3\Media\Domain\Model\Asset;

/**
* Meta Data Mapper Interface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded comment


/**
* Meta Data Manager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded comment

# tags: '${asset.Tags}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not bad to comment that one out. But why not include the keywords?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to show what is happening by default. Nothing but runtime would change by uncommenting that line.

* **EXIF:** Exchangeable image file format for digital still cameras, the technical meta data of an image. For further specifications see: [http://www.exif.org/Exif2-2.PDF]().
* **Asset**: The asset DTO provides basic data about the asset, like original file name.
* **IPTC**: Image meta data, title and description of the photograph and the author. For further specifications see: [https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata]()
* **EXIF**: Exchangeable image file format for digital still cameras, the technical meta data of an image. For further specifications see: [http://www.exif.org/Exif2-2.PDF]().
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

'YResolution' => 0.0,
'ResolutionUnit' => '',
// 'StripOffsets' => ?,
// 'RowsPerStrip' => ?,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't want to support these, we should leave them out. Looks somehow unfinished.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. I don't think they will be used and it wasn't immediately clear to me how to represent these. Do you have an idea? If not they can be removed entirely.

@@ -83,7 +103,7 @@ public function mapMetaData(Asset $asset, MetaDataCollection $metaDataCollection
$contextVariables = array_merge($this->defaultContextVariables, $metaDataCollection->toArray());

if (isset($this->metaDataMappingConfiguration['title'])) {
$asset->setTitle((string)EelUtility::evaluateEelExpression($this->metaDataMappingConfiguration['title'], $this->eelEvaluator, $contextVariables));
$asset->setTitle(substr((string)EelUtility::evaluateEelExpression($this->metaDataMappingConfiguration['title'], $this->eelEvaluator, $contextVariables), 0, 255));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it shouldn't be adjustable since the title cannot be longer than 255 chars (see TYPO3\Media\Domain\Model\Asset).

ComiR and others added 3 commits November 17, 2016 16:21
* removed some unnecessary comments
* override parent property `properties` instead setting it in constructor
* removed comments of EXIF properties not implemented
* updated link to EXIF specification in ReadMe
@daniellienert daniellienert merged commit 0cfb1f2 into neos:master Nov 23, 2016
@ComiR ComiR deleted the production branch March 16, 2017 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants