Skip to content

Commit

Permalink
Merge pull request #158 from Kunstmaan/fix-for-custom-metadata
Browse files Browse the repository at this point in the history
fix so you can add custom meta data when importing media...
  • Loading branch information
Wim Vandersmissen committed Aug 15, 2014
2 parents 18387c2 + cfa8c66 commit 40a3caa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions Helper/File/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ public function prepareMedia(Media $media)
$media->setOriginalFilename($content->getClientOriginalName());
}

$metadata = array();

$media->setFileSize(filesize($media->getContent()));
$media->setMetadata($metadata);

$contentType = $this->mimeTypeGuesser->guess($media->getContent()->getPathname());
$media->setContentType($contentType);
Expand Down
8 changes: 3 additions & 5 deletions Helper/Image/ImageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ public function prepareMedia(Media $media)
$width = $imageInfo[0];
$height = $imageInfo[1];

$media->setMetaData(array(
'original_width' => $width,
'original_height' => $height,
));

$media
->setMetadataValue('original_width', $width)
->setMetadataValue('original_height', $height);
}
}
}

0 comments on commit 40a3caa

Please sign in to comment.