- Модуль: disk
- Путь к файлу: ~/bitrix/modules/disk/lib/bitrix24disk/legacy/diskstorage.php
- Класс: BitrixDiskBitrix24DiskLegacyDiskStorage
- Вызов: DiskStorage::processImageRotate
protected function processImageRotate(TmpFile $tmpFile, File $fileModel)
{
if (!$this->hasImageOrientation($tmpFile, $fileModel))
{
return;
}
$ds = DIRECTORY_SEPARATOR;
$targetDir = CTempFile::getDirectoryName(2, 'disk_rotation' . $ds . md5(uniqid('dr', true)));
checkDirPath($targetDir);
$tmpFilePath = IOPath::normalize($targetDir) . $ds . uniqid('rotation', true);
checkDirPath($tmpFilePath);
if (copy($tmpFile->getAbsolutePath(), $tmpFilePath))
{
$this->addShutdownTask(function() use($fileModel, $tmpFilePath) {
$fileData = CFile::makeFileArray($tmpFilePath);
if ($fileData && $fileModel->uploadVersion($fileData, $fileModel->getCreatedBy()))
{
$result = InternalsFileTable::changeSyncDateTime($fileModel->getId(), (new DateTime())->add('1 seconds'));
if ($result->isSuccess() && Loader::includeModule('pull'))
{
Event::send();
}
}
});
}
}