clanrbr has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks.
Android applications is sending images to perl script
IN JAVA
and they are putting this in a string and send it to the script. Here is the perl part i get this binary file.ByteArrayOutputStream byteArrayBitmapStream = new ByteArrayOutputStrea +m(); bitmapPicture.compress(Bitmap.CompressFormat.JPEG, COMPRESSION_QUALITY +, byteArrayBitmapStream); byte[] b = byteArrayBitmapStream.toByteArray();
The $info yell there is no such known file format. So i checked the binary code that app sends me. I saw it is JFIF and this is JPEG. Any suggestions what i might do to fix this ? I want to save it to JPEG. When i dump the binary code to .txt and change it to .jpeg image is not shown. What should i do i am using IMAGER module. P.S. Not the image is the problem i tried with LWP and it made it binary and i've saved it. The problem comes from JAVA.if ( open ( PICTF,"> smepath/file.jpeg" ) ) { binmode PICTF; print PICTF $contentpic; close (PICTF); } my ($x, $y, $info) = imgsize("somepath/file.jpeg");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Images from - Android
by BrowserUk (Patriarch) on Dec 18, 2012 at 12:33 UTC | |
by clanrbr (Novice) on Dec 18, 2012 at 12:46 UTC | |
by BrowserUk (Patriarch) on Dec 18, 2012 at 13:20 UTC | |
Re: Images from - Android
by zentara (Archbishop) on Dec 18, 2012 at 12:31 UTC |
Back to
Seekers of Perl Wisdom