PageSourceSearch

https://room-designer.ai/_nuxt/CQH4FgRi.js

js room-designer.ai collected 2026-10-05 12:32:12 UTC 1,723 bytes, 1 lines download raw bytes

1var e=[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`],t=t=>{let n=t.type||``,r=t.name?t.name.lastIndexOf(`.`):-1,i=r>=0?t.name.slice(r+1).toLowerCase():``,a=e.includes(n);return{status:a?`success`:`failed`,image_type:n,image_size:(t.size/1024).toFixed(2),raw_type:n,raw_ext:i,raw_size_kb:(t.size/1024).toFixed(2),fail_reason:a?``:`format_unsupported`}};async function n(e,t=1024){return new Promise((n,r)=>{let i=new FileReader;i.onload=i=>{let a=new Image;a.onload=()=>{let i=document.createElement(`canvas`),o=i.getContext(`2d`),s=a.width,c=a.height,l=.9,u=1920,d=1080;if(s>u||c>d){let e=Math.min(u/s,d/c);s*=e,c*=e}i.width=s,i.height=c,o.drawImage(a,0,0,s,c),(async()=>{let u=.1,d=.9,f=null;for(let e=0;e<10;e++){l=(u+d)/2;let e=await new Promise(e=>{i.toBlob(e,`image/jpeg`,l)});if(e.size<=t*1024){if(f=e,u=l,l>.7)break}else d=l;if(d-u<.01)break}if(!f||f.size>t*1024){let e=Math.sqrt(t*1024/f.size);i.width=s*e,i.height=c*e,o.drawImage(a,0,0,i.width,i.height),await new Promise(e=>{i.toBlob(t=>{f=t,e()},`image/jpeg`,.8)})}let p=new File([f],e.name.replace(/\.[^/.]+$/,`.jpg`),{type:`image/jpeg`}),m=new FileReader;m.onload=()=>{n({file:p,base64:m.result})},m.onerror=()=>{r(Error(`Base64 conversion failed`))},m.readAsDataURL(f)})()},a.onerror=()=>{r(Error(`Image load failed`))},a.src=i.target.result},i.onerror=()=>{r(Error(`File read failed`))},i.readAsDataURL(e)})}var r=async e=>{try{let t=await(await fetch(e)).blob(),n=window.URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e.split(`/`).pop()||`downloaded-image.jpg`,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}catch(e){console.error(`Image download failed:`,e)}};export{n,r,t};

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.