MCPcopy Index your code
hub / github.com/blueimp/JavaScript-Load-Image / replaceJPEGHead

Function replaceJPEGHead

js/load-image-meta.js:194–199  ·  view source on GitHub ↗

* Replaces the head of a JPEG Blob * * @param {Blob} blob Blob object * @param {ArrayBuffer} oldHead Old JPEG head * @param {ArrayBuffer} newHead New JPEG head * @returns {Blob} Combined Blob

(blob, oldHead, newHead)

Source from the content-addressed store, hash-verified

192 * @returns {Blob} Combined Blob
193 */
194 function replaceJPEGHead(blob, oldHead, newHead) {
195 if (!blob || !oldHead || !newHead) return null
196 return new Blob([newHead, blobSlice.call(blob, oldHead.byteLength)], {
197 type: 'image/jpeg'
198 })
199 }
200
201 /**
202 * Replaces the image head of a JPEG blob with the given one.

Callers 1

replaceHeadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected