Skip to content

Commit

Permalink
[VisualSearch] Allow PNG #ESP-289
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreGauthier committed Oct 6, 2021
1 parent 9b2c493 commit 183e39d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/module-elasticsuite-visual-search/Model/Api/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function recognize(string $imagePath): array
$imageResizer->keepAspectRatio(true);
$imageResizer->open($imagePath);
$imageResizer->resize($this->config->getImagesOptimalSize());
$imagePath = "{$pathParts['dirname']}/{$pathParts['filename']}.jpg";
$imageResizer->save($imagePath);

// Check file size.
Expand Down
2 changes: 1 addition & 1 deletion src/module-elasticsuite-visual-search/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<url>https://sqjciip0r3.execute-api.eu-west-1.amazonaws.com/</url>
</api>
<images>
<allowed_extensions>jpg,jpeg</allowed_extensions>
<allowed_extensions>jpg,jpeg,png</allowed_extensions>
<maximum_size>100</maximum_size>
<optimal_resized_width>640</optimal_resized_width>
</images>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $helper = $this->helper('Magento\Search\Helper\Data');

<form id="search-by-image-popin-content"
method="post"
action="<? /* @escapeNotVerified */ echo $block->getUrl('visual_search/search/byImage') ?>"
action="<?php /* @escapeNotVerified */ echo $block->getUrl('visual_search/search/byImage') ?>"
enctype="multipart/form-data"
style="display: none">
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
.page-title-wrapper {
display: flex;
align-items: center;
justify-content: space-between;
.search-image {
max-width: 200px;
margin-top: -50px;
Expand Down

0 comments on commit 183e39d

Please sign in to comment.