mirror of
https://github.com/nextcloud/server.git
synced 2026-03-01 13:00:44 -05:00
Merge pull request #32513 from nextcloud/backport/32496/stable24
[stable24] Fix crop condition
This commit is contained in:
commit
4e870ea41d
1 changed files with 11 additions and 3 deletions
|
|
@ -232,9 +232,17 @@ class Generator {
|
|||
|
||||
foreach ($nodes as $node) {
|
||||
$name = $node->getName();
|
||||
if (($prefix === '' || strpos($name, $prefix) === 0)
|
||||
&& (str_starts_with($name, '256-256-crop') && $crop || str_starts_with($name, '256-256') && !$crop)) {
|
||||
return $node;
|
||||
if (($prefix === '' || str_starts_with($name, $prefix))) {
|
||||
// Prefix match
|
||||
if (str_starts_with($name, $prefix . '256-256-crop') && $crop) {
|
||||
// Cropped image
|
||||
return $node;
|
||||
}
|
||||
|
||||
if (str_starts_with($name, $prefix . '256-256.') && !$crop) {
|
||||
// Uncropped image
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue