Skip to content

Commit aabff22

Browse files
committed
Reverted:
ECP-261 Offload Catalog Image Resizing from Magento ECP-262 Offload Catalog Image Watermarking from Magento ECP-263 Deprecate Rotation Support in Magento
1 parent 06b999f commit aabff22

File tree

33 files changed

+981
-492
lines changed

33 files changed

+981
-492
lines changed

app/code/Magento/Catalog/Block/Rss/Category.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
use Magento\Framework\Exception\NoSuchEntityException;
1111

1212
/**
13-
* Category feed block
13+
* Class Category
14+
*
15+
* @package Magento\Catalog\Block\Rss
1416
*
1517
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1618
*/

app/code/Magento/Catalog/Block/Rss/Product/NewProducts.php

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
use Magento\Framework\App\Rss\DataProviderInterface;
99

1010
/**
11-
* New products feed block
11+
* Class NewProducts
12+
* @package Magento\Catalog\Block\Rss\Product
1213
*/
1314
class NewProducts extends \Magento\Framework\View\Element\AbstractBlock implements DataProviderInterface
1415
{
@@ -54,8 +55,6 @@ public function __construct(
5455
}
5556

5657
/**
57-
* Init
58-
*
5958
* @return void
6059
*/
6160
protected function _construct()
@@ -65,15 +64,15 @@ protected function _construct()
6564
}
6665

6766
/**
68-
* @inheritdoc
67+
* {@inheritdoc}
6968
*/
7069
public function isAllowed()
7170
{
7271
return $this->_scopeConfig->isSetFlag('rss/catalog/new', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
7372
}
7473

7574
/**
76-
* @inheritdoc
75+
* {@inheritdoc}
7776
*/
7877
public function getRssData()
7978
{
@@ -98,13 +97,10 @@ public function getRssData()
9897
$item->setAllowedInRss(true);
9998
$item->setAllowedPriceInRss(true);
10099

101-
$this->_eventManager->dispatch(
102-
'rss_catalog_new_xml_callback',
103-
[
104-
'row' => $item->getData(),
105-
'product' => $item
106-
]
107-
);
100+
$this->_eventManager->dispatch('rss_catalog_new_xml_callback', [
101+
'row' => $item->getData(),
102+
'product' => $item
103+
]);
108104

109105
if (!$item->getAllowedInRss()) {
110106
continue;
@@ -136,8 +132,6 @@ public function getRssData()
136132
}
137133

138134
/**
139-
* Get store id
140-
*
141135
* @return int
142136
*/
143137
protected function getStoreId()
@@ -183,16 +177,14 @@ protected function renderPriceHtml(\Magento\Catalog\Model\Product $product)
183177
}
184178

185179
/**
186-
* @inheritdoc
180+
* {@inheritdoc}
187181
*/
188182
public function getCacheLifetime()
189183
{
190184
return 600;
191185
}
192186

193187
/**
194-
* Get feeds
195-
*
196188
* @return array
197189
*/
198190
public function getFeeds()
@@ -207,7 +199,7 @@ public function getFeeds()
207199
}
208200

209201
/**
210-
* @inheritdoc
202+
* {@inheritdoc}
211203
*/
212204
public function isAuthRequired()
213205
{

app/code/Magento/Catalog/Block/Rss/Product/Special.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
use Magento\Framework\App\Rss\DataProviderInterface;
1010

1111
/**
12-
* Special products feed block
12+
* Class Special
13+
* @package Magento\Catalog\Block\Rss\Product
1314
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1415
*/
1516
class Special extends \Magento\Framework\View\Element\AbstractBlock implements DataProviderInterface
@@ -97,8 +98,6 @@ public function __construct(
9798
}
9899

99100
/**
100-
* Init
101-
*
102101
* @return void
103102
*/
104103
protected function _construct()
@@ -108,8 +107,6 @@ protected function _construct()
108107
}
109108

110109
/**
111-
* Get RSS data
112-
*
113110
* @return array
114111
*/
115112
public function getRssData()
@@ -159,8 +156,6 @@ public function getRssData()
159156
}
160157

161158
/**
162-
* Get entry data
163-
*
164159
* @param \Magento\Catalog\Model\Product $item
165160
* @return array
166161
*/
@@ -250,16 +245,14 @@ public function isAllowed()
250245
}
251246

252247
/**
253-
* @inheritdoc
248+
* {@inheritdoc}
254249
*/
255250
public function getCacheLifetime()
256251
{
257252
return 600;
258253
}
259254

260255
/**
261-
* Get feeds
262-
*
263256
* @return array
264257
*/
265258
public function getFeeds()
@@ -273,7 +266,7 @@ public function getFeeds()
273266
}
274267

275268
/**
276-
* @inheritdoc
269+
* {@inheritdoc}
277270
*/
278271
public function isAuthRequired()
279272
{

app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Exception\LocalizedException;
1212

1313
/**
14-
* Upload product image action controller
14+
* Class Upload
1515
*/
1616
class Upload extends \Magento\Backend\App\Action implements HttpPostActionInterface
1717
{

app/code/Magento/Catalog/Helper/Image.php

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@
55
*/
66
namespace Magento\Catalog\Helper;
77

8-
use Magento\Catalog\Model\Config\CatalogMediaConfig;
9-
use Magento\Catalog\Model\View\Asset\PlaceholderFactory;
108
use Magento\Framework\App\Helper\AbstractHelper;
11-
use Magento\Framework\App\ObjectManager;
12-
use Magento\Framework\Exception\LocalizedException;
139
use Magento\Framework\View\Element\Block\ArgumentInterface;
1410

1511
/**
16-
* Catalog image helper.
12+
* Catalog image helper
1713
*
1814
* @api
1915
* @SuppressWarnings(PHPMD.TooManyFields)
20-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2116
* @since 100.0.2
2217
*/
2318
class Image extends AbstractHelper implements ArgumentInterface
@@ -45,15 +40,13 @@ class Image extends AbstractHelper implements ArgumentInterface
4540
* Scheduled for rotate image
4641
*
4742
* @var bool
48-
* @deprecated unused
4943
*/
5044
protected $_scheduleRotate = false;
5145

5246
/**
5347
* Angle
5448
*
5549
* @var int
56-
* @deprecated unused
5750
*/
5851
protected $_angle;
5952

@@ -136,38 +129,31 @@ class Image extends AbstractHelper implements ArgumentInterface
136129
protected $attributes = [];
137130

138131
/**
139-
* @var PlaceholderFactory
132+
* @var \Magento\Catalog\Model\View\Asset\PlaceholderFactory
140133
*/
141134
private $viewAssetPlaceholderFactory;
142135

143-
/**
144-
* @var CatalogMediaConfig
145-
*/
146-
private $mediaConfig;
147-
148136
/**
149137
* @param \Magento\Framework\App\Helper\Context $context
150138
* @param \Magento\Catalog\Model\Product\ImageFactory $productImageFactory
151139
* @param \Magento\Framework\View\Asset\Repository $assetRepo
152140
* @param \Magento\Framework\View\ConfigInterface $viewConfig
153-
* @param PlaceholderFactory $placeholderFactory
154-
* @param CatalogMediaConfig $mediaConfig
141+
* @param \Magento\Catalog\Model\View\Asset\PlaceholderFactory $placeholderFactory
155142
*/
156143
public function __construct(
157144
\Magento\Framework\App\Helper\Context $context,
158145
\Magento\Catalog\Model\Product\ImageFactory $productImageFactory,
159146
\Magento\Framework\View\Asset\Repository $assetRepo,
160147
\Magento\Framework\View\ConfigInterface $viewConfig,
161-
PlaceholderFactory $placeholderFactory = null,
162-
CatalogMediaConfig $mediaConfig = null
148+
\Magento\Catalog\Model\View\Asset\PlaceholderFactory $placeholderFactory = null
163149
) {
164150
$this->_productImageFactory = $productImageFactory;
165151
parent::__construct($context);
166152
$this->_assetRepo = $assetRepo;
167153
$this->viewConfig = $viewConfig;
168154
$this->viewAssetPlaceholderFactory = $placeholderFactory
169-
?: ObjectManager::getInstance()->get(PlaceholderFactory::class);
170-
$this->mediaConfig = $mediaConfig ?: ObjectManager::getInstance()->get(CatalogMediaConfig::class);
155+
?: \Magento\Framework\App\ObjectManager::getInstance()
156+
->get(\Magento\Catalog\Model\View\Asset\PlaceholderFactory::class);
171157
}
172158

173159
/**
@@ -396,10 +382,9 @@ public function constrainOnly($flag)
396382
*/
397383
public function backgroundColor($colorRGB)
398384
{
399-
$args = func_get_args();
400385
// assume that 3 params were given instead of array
401386
if (!is_array($colorRGB)) {
402-
$colorRGB = $args;
387+
$colorRGB = func_get_args();
403388
}
404389
$this->_getModel()->setBackgroundColor($colorRGB);
405390
return $this;
@@ -410,7 +395,6 @@ public function backgroundColor($colorRGB)
410395
*
411396
* @param int $angle
412397
* @return $this
413-
* @deprecated unused
414398
*/
415399
public function rotate($angle)
416400
{
@@ -542,16 +526,7 @@ protected function isScheduledActionsAllowed()
542526
public function getUrl()
543527
{
544528
try {
545-
switch ($this->mediaConfig->getMediaUrlFormat()) {
546-
case CatalogMediaConfig::IMAGE_OPTIMIZATION_PARAMETERS:
547-
$this->initBaseFile();
548-
break;
549-
case CatalogMediaConfig::HASH:
550-
$this->applyScheduledActions();
551-
break;
552-
default:
553-
throw new LocalizedException(__("The specified Catalog media URL format is not supported."));
554-
}
529+
$this->applyScheduledActions();
555530
return $this->_getModel()->getUrl();
556531
} catch (\Exception $e) {
557532
return $this->getDefaultPlaceholderUrl();
@@ -620,7 +595,6 @@ protected function _getModel()
620595
*
621596
* @param int $angle
622597
* @return $this
623-
* @deprecated unused
624598
*/
625599
protected function setAngle($angle)
626600
{
@@ -632,7 +606,6 @@ protected function setAngle($angle)
632606
* Get Rotation Angle
633607
*
634608
* @return int
635-
* @deprecated unused
636609
*/
637610
protected function getAngle()
638611
{

app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

app/code/Magento/Catalog/Model/Config/Source/Web/CatalogMediaUrlFormat.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)