diff --git a/src/Phact/Orm/Fields/ImageField.php b/src/Phact/Orm/Fields/ImageField.php index c14687b..e01ebe5 100644 --- a/src/Phact/Orm/Fields/ImageField.php +++ b/src/Phact/Orm/Fields/ImageField.php @@ -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)