Bodmer / TJpg_Decoder

Jpeg decoder library based on Tiny JPEG Decompressor
Other
228 stars 43 forks source link

TJpgDec.getJpgSize #40

Closed oneandonlyonebutyou closed 2 years ago

oneandonlyonebutyou commented 2 years ago

I do not know how to convert the image to binary I used the web-tool provided for diff image the size is zero ...

TJpgDec.getJpgSize(&w, &h, img, sizeof(img));

what is the specification of the image, and why it is zero ?

08:48:20.252 ->  Size of: 2446
08:48:20.286 -> Width = 0, height = 0
08:48:20.321 -> 0 ms
Bodmer commented 2 years ago

I now use the tool and instructions detailed here.

Jpeg file arrays should start with the marker values: 0xFF,0xD8,0xFF,

oneandonlyonebutyou commented 2 years ago

@Bodmer Thank you but I still have the same issue The array does not start with :

 file arrays should start with the marker values: 0xFF,0xD8,0xFF,
image

https://www.cleanpng.com/png-candle-birthday-cake-clip-art-burning-candles-85642/

Bodmer commented 2 years ago

A PNG format file cannot be decoded with a jpeg decoder. Convert the png to a jpeg first with an image handling program like GIMP or MS Paint. Alternatively use a PNG decoder library.

Bodmer commented 2 years ago

You can read about image formats here: https://en.wikipedia.org/wiki/Image_file_format