1import{e as I}from"./worker-entrypoint-Cpi_3YOf.js";const N=async({inputIds:r,options:e,fs:u,emitProgress:d})=>{if(r.length===0)throw new Error("Extract Images requires at least one input file");const c=[],g=r.length;for(let l=0;l<r.length;l+=1){const b=r[l],m=await u.read(b),y=await m.getBlob(),t=Array.isArray(e==null?void 0:e.selectedCandidates)?e.selectedCandidates.filter(a=>!!a&&typeof a=="object"&&typeof a.fileId=="string"&&typeof a.pageNumber=="number"&&typeof a.candidateId=="string").filter(a=>a.fileId===b).map(a=>({pageNumber:a.pageNumber,candidateId:a.candidateId})):[],h=t.length>0?Array.from(new Set(t.map(a=>a.pageNumber))).sort((a,f)=>a-f):void 0;d==null||d(Math.max(1,Math.round(l/g*100)));const n=await I(y,m.getName(),{format:(e==null?void 0:e.format)==="jpeg"?"jpeg":"png",jpegQuality:typeof(e==null?void 0:e.jpegQuality)=="number"?e.jpegQuality:void 0,minWidth:typeof(e==null?void 0:e.minWidth)=="number"?e.minWidth:void 0,minHeight:typeof(e==null?void 0:e.minHeight)=="number"?e.minHeight:void 0,includeInlineImages:(e==null?void 0:e.includeInlineImages)!==!1,dedupe:(e==null?void 0:e.dedupe)!==!1,selectedCandidates:t,pageNumbers:h});for(const a of n){const f=await u.write(new File([a.blob],a.fileName,{type:a.blob.type}));c.push(f.id)}d==null||d(Math.round((l+1)/g*100))}return{outputIds:c}};export{N as run};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.