Skip to content

Commit

Permalink
Size url generation
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOkulov committed May 21, 2020
1 parent 11235fc commit fe931f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Phact/Orm/Fields/ImageField.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ public function sizeCleanPath($prefix)
{
/** @var StorageFile $storageFile */
$storageFile = $this->getAttribute();
$prefixName = $prefix.'_'.$storageFile->getName();
list($filename, $extension) = $this->getSizeFilenameAndExt($prefix, $storageFile->getBaseName());
$newBasename = $prefix . '_' . $filename . ($extension ? '.' . $extension : '');
$basePath = dirname($storageFile->getPath());
return $basePath.DIRECTORY_SEPARATOR.$prefixName;
return $basePath.DIRECTORY_SEPARATOR.$newBasename;
}

public function sizeUrl($prefix)
Expand Down

0 comments on commit fe931f0

Please sign in to comment.