hi,
please see the attached .vcf file. the photo item is wrong and this leads to the following exception while unmarshalling:
java.lang.IllegalArgumentException: Length not a multiple of 4
at net.wimpi.pim.util.Base64.decode(Base64.java:197)
at net.wimpi.pim.util.EncodingUtility.decodeBase64(EncodingUtility.java:35)
at net.wimpi.pim.contact.io.vcard.PHOTOItemHandler.handleItem(PHOTOItemHandler.java:58)
at net.wimpi.pim.contact.io.vcard.vCardUnmarshaller.processItem(vCardUnmarshaller.java:119)
at net.wimpi.pim.contact.io.vcard.vCardUnmarshaller.processCard(vCardUnmarshaller.java:108)
at net.wimpi.pim.contact.io.vcard.vCardUnmarshaller.unmarshallContacts(vCardUnmarshaller.java:67)
at ch.flurischt.jpimpatches.UnMarshallTester.main(UnMarshallTester.java:20)
this is correct, but ContactUnmarshaller.unmarshallContacts() will return null for this contact. in my opinion only the PHOTO should be skipped and all other data in the file should be unmarshalled. this way the vcf file will be still usable.
i created the following patch, which works for me:
http://code.flurischt.ch/dev/patches/PHOTOItemHandler_patch.txt
instead of skipping the whole contact, the exception is catched in the PhotoItemHandler class and the i just return without adding the photo.
regards
a vcf file containing one contact with a wrong PHOTO item