jpeg-python icon indicating copy to clipboard operation
jpeg-python copied to clipboard

Broken jpg and strange decoding

Open smarttty opened this issue 6 years ago • 4 comments

Hey! After encoding, i have broken jpeg. Its HEX contains only 0x31 and 0x30. After decoding i have a very bad image. Help)

smarttty avatar Apr 12 '18 13:04 smarttty

Same condition, too! And I wondered why I got a larger jpeg... 😩

LovelyBuggies avatar Nov 06 '18 03:11 LovelyBuggies

Same condition, too! And I wondered why I got a larger jpeg... 😩

I got it. The output is not jpeg. It's a text file, wich consists of '1' and '0', so, this is why text file is larger then image.

smarttty avatar Nov 06 '18 06:11 smarttty

@smarttty When you got a broken JEPG, were you using an image with transparent background? If not, can you post a link to the image that you used?

@LovelyBuggies The reason for the larger JPEG is what @smarttty mentioned:

he output is not jpeg. It's a text file, wich consists of '1' and '0', so, this is why text file is larger then image.

When I wrote this JPEG encoder/decoder, I had in mind that it should be as short and easy to understand as possible, so if you're looking for good performance, you better use something else.

ghallak avatar Nov 07 '18 09:11 ghallak

Hey, the reason for all that is because the decoder assumes a square image even though there is no such restriction on encoder.

jindalakshunn avatar Jun 28 '19 19:06 jindalakshunn