Apache Directory Project - [jira] Commented: (DIREVE-163) Putting a jpeg picture in the inetOrgPerson jpegPhoto a

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > August 2005 > [jira] Commented: (DIREVE-163) Putting a jpeg picture in the inetOrgPerson jpegPhoto a





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Commented: (DIREVE-163) Putting a jpeg picture in the inetOrgPerson jpegPhoto a
Emmanuel Lecharny (JIRA)

2005-08-31, 2:45 am

[ http://issues.apache.org/jira/brows...action_12320672 ]

Emmanuel Lecharny commented on DIREVE-163:
------------------------------------------

Attribute values are generally stored as String. This is a major problem for binary attributes, as we loose information (jpegPhoto for instance).

here is an exemple of code where this problem occurs :
org.apache.ldap.common.berlib.asn1.decoder.compare.CompareAVARule {
....


public void finish()
{
// pop the ByteBuffer the super method pushed
ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
// peek at the CompareRequest underneath whose name we set
CompareRequest req = ( CompareRequest ) getDigester().peek() ;

byte[] octets = null ;
if ( buf.limit() == buf.capacity() && buf.hasArray() )
{
// use the backing store
octets = buf.array() ;
}
else
{
// copy because we don't have accessible array or data < array
octets = new byte[buf.remaining()] ;
buf.get( octets ) ;
}

if ( req.getAttributeId() == null )
{
req.setAttributeId( new String( octets ) ) ;
}
else
{
req.setAssertionValue( new String( octets ) ) ;
}
}


The "new String(octets)" is destructing when applied to binary values.


> Putting a jpeg picture in the inetOrgPerson jpegPhoto attribute alter the bytes datas of the picture
> ----------------------------------------------------------------------------------------------------
>
> Key: DIREVE-163
> URL: http://issues.apache.org/jira/browse/DIREVE-163
> Project: Directory Server
> Type: Bug
> Versions: 0.9
> Environment: Windows XP SP2
> JRE 1.5
> Built with Netbeans 4.0
> Mevenide.
> Reporter: Tony Blanchard
> Priority: Minor
> Fix For: 0.9.3
> Attachments: BinaryTest.java
>
> All the picture byte values like those (-113 , -115, -112, -127 and -99) are changed to the "63" value when reading jpeg datas. "-39" value is changed to "0".
> This is on my jpeg sample picture but I think there is enought datas to be representative.
> I have tried to put a picture with JXplorer and my own client program. The same thing happens...
> Seems to be a server problem.


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com