Closed shamun closed 9 years ago
Shamun,
The hash of the picture does not contain the actual picture data but is used for verification purposes. If you want a picture, you can look at the example in https://github.com/KeejOow/eidlib/blob/master/eidlibsamples/src/be/belgium/eid/samples/InformationRetrieval.java.
eID.getIDPhoto()
Returns an IDPhoto
object with a number of methods to write the file, get the raw data, convert the file, and so on.
@KeejOow : Thank you. My situation is the picture has to be sent to a server (not the case writeToFile() method).
I checked eID.getIDPhoto()
methods which has getImage(), getPhoto(), verifyHash(byte[] hash)
.
Now, Which method gives me RAW PNG or JPEG data? I have to save that data over GET or POST method to PHP server and then display it to a web-browser.
Dear,
eID.getIDPhoto().getPhoto() returns a byte array that you can send to the server.
Cheers, Kristof.
On Wed, May 27, 2015 at 9:30 AM, Shamun Toha notifications@github.com wrote:
@KeejOow https://github.com/KeejOow : Thank you. My situation is the picture has to be sent to a server (not the case writeToFile() method).
I checked eID.getIDPhoto() methods which has getImage(), getPhoto(), verifyHash(byte[] hash).
Now, Which method gives me RAW PNG or JPEG data? I have to save that data over GET or POST method to PHP server and then display it to a web-browser.
— Reply to this email directly or view it on GitHub https://github.com/KeejOow/eidlib/issues/5#issuecomment-105798607.
Met vriendelijke groeten, Kristof Overdulve.
OK - Many thanks.
Can you please check why i cant see picture? I tried following but i cant see the picture yet? i used eID.getIDPhoto().getPhoto() and got some value like [B@..... then i used that value but not showing any picture.
<?php
$byteArray = "[B@14a3da8"; //eID.getIDPhoto().getPhoto() Java SDK returned this value
$byteArray = base64_encode($byteArray); // Try with encode or without
$img = "<img src= 'data:image/jpeg;base64, $byteArray' />";
echo ($img); // Should show the picture now in web browser but nothing is showing.
exit;
?>
Well .. cause a byte array is a binary structure and what you are posting is the object reference to the full object. It would be one hell of a compression algorithm if an image would be encoded as less than 20 bytes. You can perhaps compute a base64 encoding of the image in Java and then copy that into the PHP byte array.
Cheers, Kristof.
On Wed, May 27, 2015 at 10:00 AM, Shamun Toha notifications@github.com wrote:
Can you please check why i cant see picture? I tried following but i cant see the picture yet? i used eID.getIDPhoto().getPhoto() and got some value like [B@..... then i used that value but not showing any picture.
<?php $byteArray = "[B@14a3da8"; //eID.getIDPhoto().getPhoto() Java SDK returned this value $byteArray = base64_encode($byteArray); // Try with encode or without $img = ""; echo ($img); // Should show the picture now in web browser but nothing is showing. exit; ?>
— Reply to this email directly or view it on GitHub https://github.com/KeejOow/eidlib/issues/5#issuecomment-105809259.
Met vriendelijke groeten, Kristof Overdulve.
Using the SDK i get following field:
Hash picture: *P¿aÁ†?y2=....
How can i decode it now into PNG or JPEG? is the has picture is in JPEG? following did not worked.