private static function calculateResizeData(array $srcSize = [], array $dstOptions = []): array
    {
        $srcRatio = $srcSize['w'] / $srcSize['h'];
        $dstSize = ['w' => 0, 'h' => 0];

        if ($dstOptions['w'] > $srcSize['w']) {
            $dstOptions['w'] = $srcSize['w'];
        }
        if ($dstOptions['h'] > $srcSize['h']) {
            $dstOptions['h'] = $srcSize['h'];
        }

        if ($dstOptions['w'] <= 0 && $dstOptions['h'] <= 0) {
            $dstOptions['w'] = $srcSize['w'];
            $dstOptions['h'] = $srcSize['h'];
        } elseif ($dstOptions['w'] <= 0) {
            $dstOptions['w'] = $dstOptions['h'] * $srcRatio;
        } elseif ($dstOptions['h'] <= 0) {
            $dstOptions['h'] = $dstOptions['w'] / $srcRatio;
        }

        $dstRatio = $dstOptions['w'] / $dstOptions['h'];
        $dstSize['w'] = (int)\floor($dstOptions['w']);
        $dstSize['h'] = (int)\floor($dstOptions['h']);
        $dstSize['src-box'] = static::calculateSourceBox($srcSize, $srcRatio, $dstSize, $dstRatio);

        return $dstSize;
    }