Code Duplication    Length = 16-17 lines in 2 locations

ecrire/inc/svg.php 2 locations

@@ 303-319 (lines=17) @@
300
	}
301
302
	$coeff = 1;
303
	if (isset($attributs['width'])
304
	  and $w = svg_dimension_to_pixels($attributs['width'])) {
305
		$width = $w;
306
	}
307
	else {
308
		// si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale
309
		$width = $viewBox[2];
310
		if ($width < 1) {
311
			$coeff = max($coeff, 1000);
312
		}
313
		elseif ($width < 10) {
314
			$coeff = max($coeff, 100);
315
		}
316
		elseif ($width < 100) {
317
			$coeff = max($coeff, 10);
318
		}
319
	}
320
	if (isset($attributs['height'])
321
	  and $h = svg_dimension_to_pixels($attributs['height'])) {
322
		$height = $h;
@@ 320-335 (lines=16) @@
317
			$coeff = max($coeff, 10);
318
		}
319
	}
320
	if (isset($attributs['height'])
321
	  and $h = svg_dimension_to_pixels($attributs['height'])) {
322
		$height = $h;
323
	}
324
	else {
325
		$height = $viewBox[3];
326
		if ($height < 1) {
327
			$coeff = max($coeff, 1000);
328
		}
329
		elseif ($height < 10) {
330
			$coeff = max($coeff, 100);
331
		}
332
		elseif ($height < 100) {
333
			$coeff = max($coeff, 10);
334
		}
335
	}
336
337
	// arrondir le width et height en pixel in fine
338
	$width = round($coeff * $width);