I found a free PNG encoder at www.chrfr.de
Problem is that to save an image and its thumbnail I:
-capture the image from the camera (I get the raw byte array data) so I can save this
-clip the image to create a thumbnail Image
-get bytearray data from clipped image using PNG.toPNG() method in the PNG class I found at the previous address.
-save new bytearray of the thumbnail image in a file in the phone
Problem is the thumbnail has the correct size but it shows (if opened on the phone) only the first few lines of the image the rest is blank
Even stranger is that if I load the image in my pc and view the png image (thumbnail) saved in the phone by my midlet the image shows perfectly with all the pixels, not only the first few lines.
Can anyone take a look at the code in the PNG class to see if there is something wrong? My guess is that there is something wrong with the header because if when transferred to the pc the image shows OK it means the data part is all there...