-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
@@ -13,7 +13,10 @@ | |||
|
|||
use Doctrine\Common\Collections\ArrayCollection; | |||
|
|||
/** | |||
* ArrayCollection for meta data |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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}' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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](). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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' => ?, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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).
* 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
also improved code style and fixed a possible bug.