Code Duplication    Length = 16-17 lines in 2 locations

typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php 2 locations

@@ 2301-2316 (lines=16) @@
2298
        $w = (int)$w;
2299
        $h = (int)$h;
2300
        // If there are max-values...
2301
        if (!empty($options['maxW'])) {
2302
            // If width is given...
2303
            if ($w) {
2304
                if ($w > $options['maxW']) {
2305
                    $w = $options['maxW'];
2306
                    // Height should follow
2307
                    $max = 1;
2308
                }
2309
            } else {
2310
                if ($info[0] > $options['maxW']) {
2311
                    $w = $options['maxW'];
2312
                    // Height should follow
2313
                    $max = 1;
2314
                }
2315
            }
2316
        }
2317
        if (!empty($options['maxH'])) {
2318
            // If height is given...
2319
            if ($h) {
@@ 2317-2333 (lines=17) @@
2314
                }
2315
            }
2316
        }
2317
        if (!empty($options['maxH'])) {
2318
            // If height is given...
2319
            if ($h) {
2320
                if ($h > $options['maxH']) {
2321
                    $h = $options['maxH'];
2322
                    // Height should follow
2323
                    $max = 1;
2324
                }
2325
            } else {
2326
                // Changed [0] to [1] 290801
2327
                if ($info[1] > $options['maxH']) {
2328
                    $h = $options['maxH'];
2329
                    // Height should follow
2330
                    $max = 1;
2331
                }
2332
            }
2333
        }
2334
        $out['origW'] = $w;
2335
        $out['origH'] = $h;
2336
        $out['max'] = $max;