function chunkSet(pngData, chunkNameUint32, data) {
	/** @type {DataView} */
	let startPart;
	/** @type {DataView} */
	let endPart;

	const existingChunk = chunkGet(pngData, chunkNameUint32);
	if (existingChunk) {
		startPart = new DataView(pngData, 0, existingChunk.byteOffset - 8);
		endPart = new DataView(pngData, existingChunk.byteOffset + existingChunk.byteLength + 4);
	} else {
		const endChunkStart = pngData.byteLength - 12; // 12 - end chunk length
		startPart = new DataView(pngData, 0, endChunkStart);
		endPart = new DataView(pngData, endChunkStart);
	}

	const chunkHeader = new DataView(new ArrayBuffer(8));
	chunkHeader.setUint32(0, data.length);
	chunkHeader.setUint32(4, chunkNameUint32);

	return new Blob([
		startPart,

		// new chunk
		chunkHeader,
		data,
		new Uint32Array([0]),	// CRC fake - not calculated

		endPart
	],
	{ type: 'image/png' });
}
@param {ArrayBuffer} pngData
@param {number} chunkNameUint32 chunk name as Uint32
@param {Uint8Array} data
@returns {Blob} new png