IPFU
์ด ipfu
๋ชจ๋์ HEIC ํ์์ ์ด๋ฏธ์ง ํ์ผ์ ํฌํจํ ์น ์ด๋ฏธ์ง ํฌ๋งท(jpeg, jpg, png, gif, webp)์ JPEG๋ก ๋ณํํ๊ฑฐ๋, ์ด๋ฏธ์ง๋ฅผ ์์ถํ๋ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. ์ด ๋ชจ๋์ ์น ์ ํ๋ฆฌ์ผ์ด์
์์ ์ด๋ฏธ์ง ์ฒ๋ฆฌ ์๊ตฌ์ฌํญ์ ์ฝ๊ฒ ๊ตฌํํ ์ ์๋๋ก ๋์์ค๋๋ค.
๊ธฐ๋ฅ
- HEIC to JPEG ๋ณํ: HEIC ํ์์ ํ์ผ์ JPEG ํ์์ผ๋ก ๋ณํํฉ๋๋ค.
- ์ด๋ฏธ์ง ์์ถ: ์ง์ ๋ ์ต๋ ํฌ๊ธฐ๋ก ์ด๋ฏธ์ง๋ฅผ ์์ถํฉ๋๋ค.
์ค์น ๋ฐฉ๋ฒ
npm์ ์ฌ์ฉํ์ฌ ์ค์น:
bash
npm install ipfu
์ฌ์ฉ ์์
import { processImage } from "image-handler";
const fileInput = document.querySelector('input[type="file"]');
fileInput.addEventListener("change", async (event) => {
const file = event.target.files[0];
try {
const processedFile = await processImage(file);
console.log("์ฒ๋ฆฌ๋ ํ์ผ:", processedFile);
} catch (error) {
console.error("ํ์ผ ์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:", error);
}
});
๊ฐ๋ฐ์ ์ ๋ณด
- ๊ฐ๋ฐ์: guui_george
- ๋ผ์ด์ ์ค: ISC
์์กด์ฑ
- heic2any
- browser-image-compression