cjs/index.js
function createIHDRChunk(width, height) {
	const data = buffer.Buffer.alloc(13);

	// Width
	data.writeUInt32BE(width);
	// Height
	data.writeUInt32BE(height, 4);
	// Bit depth
	data.writeUInt8(8, 8);
	// RGBA mode
	data.writeUInt8(6, 9);
	// No compression
	data.writeUInt8(0, 10);
	// No filter
	data.writeUInt8(0, 11);
	// No interlacing
	data.writeUInt8(0, 12);

	return createChunk('IHDR', data);
}
function createIHDRChunk(width, height) {
	const data = buffer.Buffer.alloc(13);

	// Width
	data.writeUInt32BE(width);
	// Height
	data.writeUInt32BE(height, 4);
	// Bit depth
	data.writeUInt8(8, 8);
	// RGBA mode
	data.writeUInt8(6, 9);
	// No compression
	data.writeUInt8(0, 10);
	// No filter
	data.writeUInt8(0, 11);
	// No interlacing
	data.writeUInt8(0, 12);

	return createChunk('IHDR', data);
}
function createIHDRChunk ( width , height ) { const data = buffer . Buffer . alloc ( 13 ) ; // Width data . writeUInt32BE ( width ) ; // Height data . writeUInt32BE ( height , 4 ) ; // Bit depth data . writeUInt8 ( 8 , 8 ) ; // RGBA mode data . writeUInt8 ( 6 , 9 ) ; // No compression data . writeUInt8 ( 0 , 10 ) ; // No filter data . writeUInt8 ( 0 , 11 ) ; // No interlacing data . writeUInt8 ( 0 , 12 ) ; return createChunk ( 'IHDR' , data ) ; }
Create the IHDR chunk.

@param width
@param height
@returns {Buffer}
Create the IHDR chunk .