Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : svgMeasure.js
'use strict';

var xmldoc = require('xmldoc');

/** Strip unit postfix, parse number, but return undefined instead of NaN for bad input */
function stripUnits(textVal) {
	var n = parseFloat(textVal);
	if (typeof n !== 'number' || isNaN(n)) {
		return undefined;
	}
	return n;
}

/** Make sure it's valid XML and the root tage is <svg/>, returns xmldoc DOM */
function parseSVG(svgString) {
	var doc;

	try {
		doc = new xmldoc.XmlDocument(svgString);
	} catch (err) {
		throw new Error('SVGMeasure: ' + err);
	}

	if (doc.name !== "svg") {
		throw new Error('SVGMeasure: expected <svg> document');
	}

	return doc;
}

function SVGMeasure() {
}

SVGMeasure.prototype.measureSVG = function (svgString) {

	var doc = parseSVG(svgString);

	var docWidth = stripUnits(doc.attr.width);
	var docHeight = stripUnits(doc.attr.height);

	if ((docWidth == undefined || docHeight == undefined) && typeof doc.attr.viewBox == 'string') {
		var viewBoxParts = doc.attr.viewBox.split(/[,\s]+/);
		if (viewBoxParts.length !== 4) {
			throw new Error("Unexpected svg viewbox format, should have 4 entries but found: '" + doc.attr.viewBox + "'");
		}
		if (docWidth == undefined) {
			docWidth = stripUnits(viewBoxParts[2]);
		}
		if (docHeight == undefined) {
			docHeight = stripUnits(viewBoxParts[3]);
		}
	}

	return {
		width: docWidth,
		height: docHeight
	};
};

SVGMeasure.prototype.writeDimensions = function (svgString, dimensions) {

	var doc = parseSVG(svgString);

	doc.attr.width = "" + dimensions.width;
	doc.attr.height = "" + dimensions.height;

	return doc.toString();
};

module.exports = SVGMeasure;
© 2026 GrazzMean
Page non trouvée – APK Comptoir Hammami
Jannah Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.

404 :(

Oups ! Cette page est introuvable.

Il semble que nous ne puissions pas trouver ce que vous cherchez. Peut-être qu'une recherche pourrait vous aider.

Bouton retour en haut de la page