Skip to content

Commit dffb766

Browse files
author
pini-girit
committed
v3.1.1: changed default crop from fit to limit
1 parent d68a2d0 commit dffb766

File tree

2 files changed

+15
-2
lines changed
  • app/code/community/Cloudinary/Cloudinary/Helper
  • lib/CloudinaryExtension/Image/Transformation

2 files changed

+15
-2
lines changed

app/code/community/Cloudinary/Cloudinary/Helper/Image.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ private function createTransformation()
147147
} else {
148148
return $this->_configuration->getDefaultTransformation()
149149
->withDimensions($this->_dimensions)
150-
->withCrop(Crop::fit());
150+
//->withCrop(Crop::fit());
151+
->withCrop(Crop::limit());
151152
}
152153
}
153154
}

lib/CloudinaryExtension/Image/Transformation/Crop.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
class Crop
66
{
7-
const PAD = 'lpad';
7+
const PAD = 'pad';
8+
const LPAD = 'lpad';
89
const FIT = 'fit';
10+
const LIMIT = 'limit';
911

1012
private $value;
1113

@@ -24,11 +26,21 @@ public static function pad()
2426
return new Crop(self::PAD);
2527
}
2628

29+
public static function lpad()
30+
{
31+
return new Crop(self::LPAD);
32+
}
33+
2734
public static function fit()
2835
{
2936
return new Crop(self::FIT);
3037
}
3138

39+
public static function limit()
40+
{
41+
return new Crop(self::LIMIT);
42+
}
43+
3244
public function __toString()
3345
{
3446
return $this->value;

0 commit comments

Comments
 (0)