Replies: 1 comment
-
You will need to tell ImageMagick that the format of the image that you are reading is a const settings: MagickReadSettings = new MagickReadSettings();
settings.format = MagickFormat.Dng;
await ImageMagick.read(array, settings, async (image) => {
console.log('load image ',image.width,image.height) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
magick-wasm version
0.0.30
Description
version: https://cdn.jsdelivr.net/npm/@imagemagick/magick-wasm@0.0.30/dist/magick.wasm
loader:
async function loadWasm(wasmUrl) {
const wasmLocation = new URL(wasmUrl);
try {
console.log('wasm loading...')
await initializeImageMagick(wasmLocation)
console.log('wasm load success')
} catch (error) {
console.log('wasm load error:', error)
}
}
code:
await ImageMagick.read(array, async (image) => {
console.log('load image ',image.width,image.height)
await image.write(MagickFormat.Jpeg, async (data) => {
const blob = new Blob([data], { type: 'image/jpeg' })
url = URL.createObjectURL(blob)
// console.log(
load succes imgurl ${file.name} -> ${url}
)});
})
dngfile:
dng.dng.zip
Steps to Reproduce
unzip dng.dng.zip ,and get width and heigh ,this code output:
load image: 256 171
Images
No response
Beta Was this translation helpful? Give feedback.
All reactions