- Your Image Is Probably Not Decorative — Smashing Magazine1
- JPG vs JPEG: Understanding the Most Common Image Format
- Using Modern Image Formats: AVIF And WebP — Smashing Magazine2
- Building an effective Image Component3
- Using Performant Next-Gen Images in CSS with image-set | CSS-Tricks4
- A Guide to the Responsive Images Syntax in HTML | CSS-Tricks5
- Frequently Asked Questions | WebP | Google Developers6
- Picture perfect images with the modern <img> element - Stack Overflow
- Learn Images | web.dev
- GitHub - JonasKruckenberg/imagetools: Load and transform images using a toolbox of custom import directives!
- Cloudflare Image Optimization · Cloudflare Image Optimization docs
Footnotes
커스텀 폰트 사용 시, 배포 중 Provided Edge Function is too large 에러가 발생할 경우 로컬 파일로 사용하지말고 fetch로 해당 폰트를 가져온다.12
Footnotes
-- PNG 마다: 여백을 자르고 절반으로
half :: Image -> Image
half img = resize (round (w / 2), round (h / 2)) t
where t = trim img -- 가장자리 여백 제거
(w, h) = size t -- 잘린 뒤 크기를 다시 읽는다
-- for entry in fg('./**/*.png'): half entry → entry.replace(.png, .half.png)
-- crop: extract { left = 50, top = 50, width = 200, height = 400 }
-- 헤드리스 브라우저에서 이미지 꺼내기
data Way = InPageCanvas | InPageRefetch | Cdp | OnResponse
images :: Page -> IO [Buffer]
images page = do
cdp <- createCDPSession page
tree <- send cdp "Page.getResourceTree"
forM (resources tree) $ \r -> do
c <- send cdp "Page.getResourceContent" (frameId tree, url r)
pure (decode (if base64Encoded c then Base64 else Utf8) (content c))
-- 또는: page.on('response', r => r.buffer())