I have an upload method that works with all the images I ever throw at it, 
apart from the signature component image. So I am assuming there is 
somethign wrong with the image from the sig component maybe? 

I simply do this

signature = sig.getSignatureImage();
Image myImage = Image.createImage(signature.getWidth(), 
signature.getHeight());
myImage.getGraphics().drawImage(signature, 0, 0);
 upload(incident_id,question.question_id,myImage,false);  //my upload 
mehtod that works with other images, 

Can you see any issues?



upload basically does this an embeds the base64 into json:
String base64 = null;
        try {
            ImageIO imgIO = ImageIO.getImageIO();
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            imgIO.save(photo, out, ImageIO.FORMAT_JPEG, 0.8f);
            byte[] ba = out.toByteArray();
            base64 = Base64.encode(ba);
         //   toast("Uploading image",currentForm);
        } catch (Exception e) {
            _("//// error uploading photo "+e.getMessage());
            e.printStackTrace();
        }

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/b4508cff-9e1a-469d-9a63-4b51eebccb09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to